Re: [U-Boot] [PATCH] patman: fix series-notes handling for buildman

2016-01-31 Thread Albert ARIBAUD
Hello Simon,

On Thu, 19 Nov 2015 20:29:11 -0700, Simon Glass 
wrote:
> Hi Albert,
> 
> On 13 November 2015 at 19:35, Simon Glass  wrote:
> > On 9 November 2015 at 14:36, Albert ARIBAUD  
> > wrote:
> >> Hello Simon,
> >>
> >> On Mon, 9 Nov 2015 12:24:55 -0800, Simon Glass  wrote:
> >>> On 9 November 2015 at 06:19, Albert ARIBAUD  
> >>> wrote:
> >>> > A patman series with a 'Series-notes' section causes
> >>> > buildman to crash with:
> >>> >
> >>> > self.series.notes += self.section
> >>> > TypeError: cannot concatenate 'str' and 'list' objects
> >>> >
> >>> > Fix by initializing series.notes as a one-element array
> >>> > rathen than a scalar.
> >>> >
> >>> > Signed-off-by: Albert ARIBAUD 
> >>> > ---
> >>> >
> >>> >  tools/patman/series.py | 2 +-
> >>> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> Acked-by: Simon Glass 
> >>
> >> Note: just spotted a typo, 'rathen' instead of 'rather'. If this patch
> >> gets applied, please fix that on-the-fly.
> >>
> >> Amicalement,
> >> --
> >> Albert.
> >
> > Fixed typo and
> >
> > Applied to u-boot-dm, thanks!
> 
> Hmm, actually I've had to drop this as it breaks 'Series-version'.
> That currently does not expect a list.

Hmm, I can't reproduce this here. How do you trigger the Series-version
break?

> I wonder if Series-notes needs a special case, instead?
> 
> Regards,
> Simon

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


Re: [U-Boot] [PATCH v2 17/23] tegra: video: Convert tegra20 LCD driver to driver model

2016-01-31 Thread Anatolij Gustschin
On Sat, 30 Jan 2016 16:37:56 -0700
Simon Glass s...@chromium.org wrote:

> Move this driver over to use driver model. This involves rearranging the
> code somewhat. The effect is that everything is run from the probe() method.
> 
> Boards which use this are fixed up, but only seaboard is tested.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2:
> - Fix a checkpatch warning
> 
>  arch/arm/dts/tegra20-seaboard.dts   |   4 +
>  arch/arm/dts/tegra20.dtsi   |   2 +
>  arch/arm/include/asm/arch-tegra20/display.h |  26 --
>  board/compal/paz00/paz00.c  |   2 +-
>  configs/colibri_t20_defconfig   |   4 +
>  configs/harmony_defconfig   |   6 +-
>  configs/medcom-wide_defconfig   |   4 +
>  configs/paz00_defconfig |   4 +
>  configs/seaboard_defconfig  |   4 +
>  configs/tec_defconfig   |   4 +
>  configs/ventana_defconfig   |   4 +
>  drivers/video/tegra.c   | 385 
> +---
>  include/configs/colibri_t20.h   |   2 -
>  include/configs/harmony.h   |   2 -
>  include/configs/medcom-wide.h   |   2 -
>  include/configs/paz00.h |   2 -
>  include/configs/seaboard.h  |   2 -
>  include/configs/tec.h   |   2 -
>  include/configs/ventana.h   |   2 -
>  19 files changed, 208 insertions(+), 255 deletions(-)

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


Re: [U-Boot] [PATCH 1/2] arm: imx6: Add DDR3 calibration code for MX6 Q/D/DL

2016-01-31 Thread Marek Vasut
On Monday, January 25, 2016 at 12:30:00 AM, Tom Rini wrote:
> On Mon, Jan 25, 2016 at 12:00:05AM +0100, Marek Vasut wrote:
> > On Sunday, January 24, 2016 at 11:21:51 PM, Tom Rini wrote:
> > > On Sun, Jan 24, 2016 at 11:07:30PM +0100, Marek Vasut wrote:
> > > > On Sunday, January 24, 2016 at 08:33:57 PM, Tom Rini wrote:
> > > > > On Sun, Jan 24, 2016 at 06:22:10PM +0100, Marek Vasut wrote:
> > > > > > On Sunday, January 24, 2016 at 06:18:23 PM, Stefano Babic wrote:
> > > > > > > On 24/01/2016 18:11, Marek Vasut wrote:
> > > > > > > > It is not clear when the wait_for_bit() will be applied, I am
> > > > > > > > certain there will be another round for so. I do not want to
> > > > > > > > wait for it and I don't see a reason why those patches should
> > > > > > > > block this if the conversion can be done afterward.
> > > > > > > 
> > > > > > > Just wait for a while - if it takes too much, I reconsider to
> > > > > > > apply this first and factorize wait_for_bit() in a follow-up
> > > > > > > patch.
> > > > > > 
> > > > > > I have waited for over a month and I fail to see a reason why
> > > > > > patches which will be applied at uncertain point in the future
> > > > > > shall block this patchset. The wait_for_bit() can be removed by
> > > > > > a subsequent patch, it is already pulled out explicitly in the
> > > > > > code, so I don't see a problem with applying this.
> > > > > 
> > > > > Did I miss something or isn't v4 of wait_for_bit good to go?
> > > > 
> > > > I don't really know if it's good to go, but this patch does not
> > > > depend on it in any way. A subsequent patch can drop the
> > > > wait_for_bit() from here, it's the same as the wait_for_bit() in
> > > > dwc2 and other wait_for_bit() anywhere else, but I don't see a
> > > > reason why this patch should not be applied now.
> > > > 
> > > > If I follow the logic in this thread, it would also be possible to
> > > > say that this patch should wait until Eric submits the MX6S DDR
> > > > support for example. We could indefinitelly wait for new and new
> > > > stuff which might possibly block this.
> > > 
> > > Why don't you ack/test/review the wait_for_bit series and post a
> > > follow-up to this one that uses the common function, which can be
> > > squashed into the original and then this gets picked up?
> > 
> > Why ? I can send subsequent patch which removes the duplicate
> > wait_for_bit() from this code once the wait_for_bit series is applied. I
> > don't see a problem with that and the wait_for_bit() being so explicitly
> > pulled out from the code is done with that in mind. But that does not
> > block this patch from being applied now. Does it?
> 
> If I tell you I'm probably going to have the wait_for_bit stuff applied
> before the next imx PR is ready... ?

So, why is this patchset not applied yet ... ?

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


Re: [U-Boot] [PATCH v2 11/23] tegra: nyan-big: Move the LCD driver to driver model

2016-01-31 Thread Anatolij Gustschin
On Sat, 30 Jan 2016 16:37:50 -0700
Simon Glass s...@chromium.org wrote:

> Adjust the driver to use driver model. The SOR becomes a bridge device. We
> use the normal simple_panel driver to handle the display itself. We also
> need to enable some options such as regulators, PWMs and DM_VIDEO itself.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2: None
> 
>  configs/nyan-big_defconfig   |   9 +++
>  drivers/video/Kconfig|   1 +
>  drivers/video/simple_panel.c |   1 +
>  drivers/video/tegra124/display.c | 169 
> ---
>  drivers/video/tegra124/dp.c  |  53 
>  drivers/video/tegra124/sor.c | 162 +
>  drivers/video/tegra124/sor.h |  45 +--
>  include/configs/nyan-big.h   |   2 -
>  include/fdtdec.h |   1 -
>  lib/fdtdec.c |   1 -
>  10 files changed, 246 insertions(+), 198 deletions(-)

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


Re: [U-Boot] [PATCH v2 22/23] tegra: video: Move LCD driver to use the DM PWM driver

2016-01-31 Thread Anatolij Gustschin
On Sat, 30 Jan 2016 16:38:01 -0700
Simon Glass s...@chromium.org wrote:

> Use the driver-model PWM driver in preference to the old code.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2: None
> 
>  arch/arm/dts/tegra20-colibri.dts |  4 
>  arch/arm/dts/tegra20-harmony.dts |  4 
>  arch/arm/dts/tegra20-medcom-wide.dts |  4 
>  arch/arm/dts/tegra20-paz00.dts   |  4 
>  arch/arm/dts/tegra20-seaboard.dts|  4 
>  arch/arm/dts/tegra20-tec.dts |  4 
>  arch/arm/dts/tegra20-ventana.dts |  4 
>  arch/arm/mach-tegra/Kconfig  |  1 +
>  drivers/pwm/Kconfig  |  1 +
>  drivers/video/tegra.c| 20 
>  10 files changed, 46 insertions(+), 4 deletions(-)

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


[U-Boot] [PATCH] OMAP3: omap3_logic: Enable Android Fastboot

2016-01-31 Thread Adam Ford
Android Fastboot requires USB.  The TWL4030 PMIC on omap3_logic handles USB 
traffic.
This patch sets up the USB gadget and Android Fastboot to match what is done in 
the
omap3_beagle project.

Signed-off-by: Adam Ford 
---
 board/logicpd/omap3som/omap3logic.c | 37 +
 include/configs/omap3_logic.h   | 21 +
 2 files changed, 58 insertions(+)

diff --git a/board/logicpd/omap3som/omap3logic.c 
b/board/logicpd/omap3som/omap3logic.c
index 05f6587..345bc93 100644
--- a/board/logicpd/omap3som/omap3logic.c
+++ b/board/logicpd/omap3som/omap3logic.c
@@ -27,6 +27,11 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include "omap3logic.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -105,6 +110,34 @@ void get_board_mem_timings(struct board_sdrc_timings 
*timings)
 }
 #endif
 
+#ifdef CONFIG_USB_MUSB_OMAP2PLUS
+static struct musb_hdrc_config musb_config = {
+   .multipoint = 1,
+   .dyn_fifo   = 1,
+   .num_eps= 16,
+   .ram_bits   = 12,
+};
+
+static struct omap_musb_board_data musb_board_data = {
+   .interface_type = MUSB_INTERFACE_ULPI,
+};
+
+static struct musb_hdrc_platform_data musb_plat = {
+#if defined(CONFIG_USB_MUSB_HOST)
+   .mode   = MUSB_HOST,
+#elif defined(CONFIG_USB_MUSB_GADGET)
+   .mode   = MUSB_PERIPHERAL,
+#else
+#error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
+#endif
+   .config = _config,
+   .power  = 100,
+   .platform_ops   = _ops,
+   .board_data = _board_data,
+};
+#endif
+
+
 /*
  * Routine: misc_init_r
  * Description: Configure board specific parts
@@ -126,6 +159,10 @@ int misc_init_r(void)
omap_die_id_display();
putc('\n');
 
+#ifdef CONFIG_USB_MUSB_OMAP2PLUS
+   musb_register(_plat, _board_data, (void *)MUSB_BASE);
+#endif
+
return 0;
 }
 
diff --git a/include/configs/omap3_logic.h b/include/configs/omap3_logic.h
index b2778ca..1e00455 100644
--- a/include/configs/omap3_logic.h
+++ b/include/configs/omap3_logic.h
@@ -74,8 +74,29 @@
 #define EXPANSION_EEPROM_I2C_BUS   2   /* I2C Bus for AT24C64 */
 #define CONFIG_OMAP3_LOGIC_USE_NEW_PRODUCT_ID
 
+/* USB */
+#define CONFIG_USB_MUSB_GADGET
+#define CONFIG_USB_MUSB_OMAP2PLUS
+#define CONFIG_USB_MUSB_PIO_ONLY
+#define CONFIG_USB_GADGET_DUALSPEED
+#define CONFIG_USB_ETHER
+#define CONFIG_USB_ETHER_RNDIS
+#define CONFIG_USB_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW0
+#define CONFIG_USB_GADGET_DOWNLOAD
+#define CONFIG_G_DNL_VENDOR_NUM0x0451
+#define CONFIG_G_DNL_PRODUCT_NUM   0xd022
+#define CONFIG_G_DNL_MANUFACTURER  "TI"
+#define CONFIG_USB_FUNCTION_FASTBOOT
+#define CONFIG_CMD_FASTBOOT
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_FASTBOOT_BUF_ADDR   CONFIG_SYS_LOAD_ADDR
+#define CONFIG_FASTBOOT_BUF_SIZE   0x0700
+#define CONFIG_SYS_CACHELINE_SIZE  64
+
 /* TWL4030 */
 #define CONFIG_TWL4030_PWM
+#define CONFIG_TWL4030_USB
 
 /* Board NAND Info. */
 #ifdef CONFIG_NAND
-- 
1.9.1

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


Re: [U-Boot] [PATCH v2 15/23] tegra: video: Move the check for CONFIG_OF_CONTROL to Kconfig

2016-01-31 Thread Anatolij Gustschin
On Sat, 30 Jan 2016 16:37:54 -0700
Simon Glass s...@chromium.org wrote:

> We can check this in Kconfig now.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2: None
> 
>  drivers/video/Kconfig | 1 +
>  drivers/video/tegra.c | 4 
>  2 files changed, 1 insertion(+), 4 deletions(-)

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


Re: [U-Boot] [PATCH v2 14/23] tegra: video: Merge the display driver into one file

2016-01-31 Thread Anatolij Gustschin
On Sat, 30 Jan 2016 16:37:53 -0700
Simon Glass s...@chromium.org wrote:

> At present we have code in arch/arm and code in drivers/video. Move it all
> into drivers/video since it is a display driver and our current approach is
> to put all driver code in drivers/.
> 
> Make a few functions static now that they are not used outside the file.
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2:
> - Fix a checkpatch warning
> 
>  arch/arm/include/asm/arch-tegra20/display.h |  21 --
>  arch/arm/mach-tegra/tegra20/Makefile|   2 -
>  arch/arm/mach-tegra/tegra20/display.c   | 378 --
>  drivers/video/tegra.c   | 396 
> 
>  4 files changed, 396 insertions(+), 401 deletions(-)

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


Re: [U-Boot] [PATCH v2 02/23] dm: video: Flush the cache after a puts()

2016-01-31 Thread Anatolij Gustschin
Hi Simon,

On Sat, 30 Jan 2016 16:37:41 -0700
Simon Glass s...@chromium.org wrote:

> This helps keep the display consistent. puts() is used when printing the
> prompt, so is a useful way to make sure the current display contents is
> visible.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2: None
> 
>  drivers/video/vidconsole-uclass.c | 1 +
>  1 file changed, 1 insertion(+)

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


Re: [U-Boot] [PATCH v2 08/23] tegra: lcd: Merge tegra124-lcd.c into display.c

2016-01-31 Thread Anatolij Gustschin
On Sat, 30 Jan 2016 16:37:47 -0700
Simon Glass s...@chromium.org wrote:

> There isn't a lot of benefit of have two separate files. With driver model
> the code needs to be in the same driver, so it's better to have it in the
> same file.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2: None
> 
>  arch/arm/include/asm/arch-tegra/dc.h  |  5 --
>  drivers/video/tegra124/Makefile   |  1 -
>  drivers/video/tegra124/display.c  | 81 -
>  drivers/video/tegra124/tegra124-lcd.c | 95 
> ---
>  4 files changed, 79 insertions(+), 103 deletions(-)
>  delete mode 100644 drivers/video/tegra124/tegra124-lcd.c

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


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

2016-01-31 Thread Albert ARIBAUD
Hello Tom,

The following changes since commit 8cdae1dacde7dbe74d53a8ac1a05761a53c4f191:

  video: Correct 'tor' typo in comment (2016-01-30 10:58:47 +0100)

are available in the git repository at:

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

for you to fetch changes up to 735b1a2e5a61401868bb35702b6e5e18bce6eb97:

  arm: novena: Fix EEPROM i2c configuration (2016-01-31 16:32:56 +0100)


Albert ARIBAUD (1):
  armv7: add cacheline sizes where missing

Marek Vasut (4):
  arm: Replace test for CONFIG_ARMV7 with CONFIG_CPU_V7
  arm: Remove S bit from MMU section entry
  arm: cache: Implement cache range check for v7
  arm: novena: Fix EEPROM i2c configuration

Peng Fan (1):
  arm: config: enforce -fno-pic for gcc

Wang Dongsheng (1):
  ARM: Disable "DISCARD" for secure section if CONFIG_ARMV7_SECURE_BASE 
isn't defined

 arch/arm/config.mk  |  1 +
 arch/arm/cpu/armv7/cache_v7.c   | 21 +
 arch/arm/cpu/u-boot.lds | 27 ++-
 arch/arm/include/asm/system.h   |  7 +++
 arch/arm/lib/cache-cp15.c   |  2 +-
 include/configs/am3517_crane.h  |  2 ++
 include/configs/am3517_evm.h|  2 ++
 include/configs/at91-sama5_common.h |  2 ++
 include/configs/bcm_ep_board.h  |  1 +
 include/configs/cm_t35.h|  2 ++
 include/configs/cm_t3517.h  |  2 ++
 include/configs/colibri_vf.h|  2 ++
 include/configs/kzm9g.h |  2 ++
 include/configs/nokia_rx51.h|  2 ++
 include/configs/novena.h|  3 ++-
 include/configs/pcm052.h|  2 ++
 include/configs/rcar-gen2-common.h  |  2 ++
 include/configs/rk3036_common.h |  2 ++
 include/configs/rk3288_common.h |  2 ++
 include/configs/s5p_goni.h  |  2 ++
 include/configs/smdkc100.h  |  2 ++
 include/configs/tao3530.h   |  2 ++
 include/configs/ti814x_evm.h|  2 ++
 include/configs/ti816x_evm.h|  2 ++
 include/configs/ti_omap3_common.h   |  5 +
 include/configs/tricorder.h |  2 ++
 include/configs/vexpress_common.h   |  2 ++
 include/configs/vf610twr.h  |  2 ++
 28 files changed, 88 insertions(+), 19 deletions(-)

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


[U-Boot] [PATCH] OMAP3: omap3_logic: Remove YAFFS support.

2016-01-31 Thread Adam Ford
UBIFS is the preferred OS, and YAFFS isn't officially included in
Linux.  Removing this feature reduces the code size.

Signed-off-by: Adam Ford 
---
 include/configs/omap3_logic.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/configs/omap3_logic.h b/include/configs/omap3_logic.h
index a153928..3cb71f1 100644
--- a/include/configs/omap3_logic.h
+++ b/include/configs/omap3_logic.h
@@ -66,8 +66,6 @@
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DHCP
 
-#define CONFIG_YAFFS2
-
 /* I2C */
 #define CONFIG_SYS_I2C_OMAP34XX
 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50/* EEPROM AT24C64  */
-- 
1.9.1

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


Re: [U-Boot] Conversion of serial_pxa.c to driver model

2016-01-31 Thread Marek Vasut
On Sunday, January 31, 2016 at 05:16:37 PM, Simon Glass wrote:
> Hi Marek,

Hi,

> Are you planning to convert this to driver model?

No, I don't plan to convert it any soon. CCing some more interested parties.

> I see that two boards still use it.

That's only because you removed the rest apparently ...

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


Re: [U-Boot] [PATCH v2 20/23] tegra: video: Move all fdt-decoding into a single function

2016-01-31 Thread Anatolij Gustschin
On Sat, 30 Jan 2016 16:37:59 -0700
Simon Glass s...@chromium.org wrote:

> Join the two functions which decode the device tree and put them in the
> ofdata_to_platdata() method.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2: None
> 
>  drivers/video/tegra.c | 264 
> --
>  1 file changed, 105 insertions(+), 159 deletions(-)

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


Re: [U-Boot] [PATCH v2 18/23] tegra: video: Remove the static variables

2016-01-31 Thread Fabio Estevam
On Sat, Jan 30, 2016 at 9:37 PM, Simon Glass  wrote:

> diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c
> index bb2601f..f49f95d 100644
> --- a/drivers/video/tegra.c
> +++ b/drivers/video/tegra.c
> @@ -2,7 +2,7 @@
>   * Copyright (c) 2011 The Chromium OS Authors.
>   * SPDX-License-Identifier:GPL-2.0+
>   */
> -#define DEBUG
> +

This is an unrelated change.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] OMAP3: omap3_logic: Enable CONFIG_SMC911X_32_BIT

2016-01-31 Thread Adam Ford
The interface automatically converts one 32-bit word into two 16 words.
The README said it is permissible to use this flag in that scenario.

Signed-off-by: Adam Ford 
---
 include/configs/omap3_logic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/omap3_logic.h b/include/configs/omap3_logic.h
index 1e00455..a153928 100644
--- a/include/configs/omap3_logic.h
+++ b/include/configs/omap3_logic.h
@@ -286,7 +286,7 @@
 /* SMSC922x Ethernet */
 #if defined(CONFIG_CMD_NET)
 #define CONFIG_SMC911X
-#define CONFIG_SMC911X_16_BIT
+#define CONFIG_SMC911X_32_BIT
 #define CONFIG_SMC911X_BASE0x0800
 #endif /* (CONFIG_CMD_NET) */
 
-- 
1.9.1

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


Re: [U-Boot] [PATCH v2 19/23] tegra: video: Move LCD enums into the driver

2016-01-31 Thread Anatolij Gustschin
On Sat, 30 Jan 2016 16:37:58 -0700
Simon Glass s...@chromium.org wrote:

> There is no need to have these in a separate file as they are not
> referenced from anywhere else.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2: None
> 
>  arch/arm/include/asm/arch-tegra20/display.h | 22 --
>  drivers/video/tegra.c   | 20 
>  2 files changed, 20 insertions(+), 22 deletions(-)

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


[U-Boot] [PATCH] Revert "arm: Remove wireless_space board"

2016-01-31 Thread Albert ARIBAUD
Revert commit b352182a and complete generic board support.

Signed-off-by: Albert ARIBAUD 
---
 arch/arm/mach-kirkwood/Kconfig  |   4 +
 board/LaCie/wireless_space/Kconfig  |  12 ++
 board/LaCie/wireless_space/MAINTAINERS  |   6 +
 board/LaCie/wireless_space/Makefile |  12 ++
 board/LaCie/wireless_space/kwbimage.cfg |  71 +++
 board/LaCie/wireless_space/wireless_space.c | 165 +
 configs/wireless_space_defconfig|   7 ++
 include/configs/wireless_space.h| 179 
 8 files changed, 456 insertions(+)
 create mode 100644 board/LaCie/wireless_space/Kconfig
 create mode 100644 board/LaCie/wireless_space/MAINTAINERS
 create mode 100644 board/LaCie/wireless_space/Makefile
 create mode 100644 board/LaCie/wireless_space/kwbimage.cfg
 create mode 100644 board/LaCie/wireless_space/wireless_space.c
 create mode 100644 configs/wireless_space_defconfig
 create mode 100644 include/configs/wireless_space.h

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 9205b1e..9249564 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -37,6 +37,9 @@ config TARGET_NET2BIG_V2
 config TARGET_NETSPACE_V2
bool "LaCie netspace_v2 Board"
 
+config TARGET_WIRELESS_SPACE
+   bool "LaCie Wireless_space Board"
+
 config TARGET_IB62X0
bool "ib62x0 Board"
 
@@ -68,6 +71,7 @@ source "board/iomega/iconnect/Kconfig"
 source "board/keymile/km_arm/Kconfig"
 source "board/LaCie/net2big_v2/Kconfig"
 source "board/LaCie/netspace_v2/Kconfig"
+source "board/LaCie/wireless_space/Kconfig"
 source "board/raidsonic/ib62x0/Kconfig"
 source "board/Seagate/dockstar/Kconfig"
 source "board/Seagate/goflexhome/Kconfig"
diff --git a/board/LaCie/wireless_space/Kconfig 
b/board/LaCie/wireless_space/Kconfig
new file mode 100644
index 000..75a2fc5
--- /dev/null
+++ b/board/LaCie/wireless_space/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_WIRELESS_SPACE
+
+config SYS_BOARD
+   default "wireless_space"
+
+config SYS_VENDOR
+   default "LaCie"
+
+config SYS_CONFIG_NAME
+   default "wireless_space"
+
+endif
diff --git a/board/LaCie/wireless_space/MAINTAINERS 
b/board/LaCie/wireless_space/MAINTAINERS
new file mode 100644
index 000..c32ecb8
--- /dev/null
+++ b/board/LaCie/wireless_space/MAINTAINERS
@@ -0,0 +1,6 @@
+WIRELESS_SPACE BOARD
+M: Albert ARIBAUD 
+S: Maintained
+F: board/LaCie/wireless_space/
+F: include/configs/wireless_space.h
+F: configs/wireless_space_defconfig
diff --git a/board/LaCie/wireless_space/Makefile 
b/board/LaCie/wireless_space/Makefile
new file mode 100644
index 000..90a84f4
--- /dev/null
+++ b/board/LaCie/wireless_space/Makefile
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2011 Simon Guinot 
+#
+# Based on Kirkwood support:
+# (C) Copyright 2009
+# Marvell Semiconductor 
+# Written-by: Prafulla Wadaskar 
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  := wireless_space.o ../common/common.o
diff --git a/board/LaCie/wireless_space/kwbimage.cfg 
b/board/LaCie/wireless_space/kwbimage.cfg
new file mode 100644
index 000..037248b
--- /dev/null
+++ b/board/LaCie/wireless_space/kwbimage.cfg
@@ -0,0 +1,71 @@
+#
+# Copyright (C) 2012 Albert ARIBAUD 
+#
+# Based on netspace_v2 kwbimage.cfg:
+# Copyright (C) 2011 Simon Guinot 
+#
+# Based on Kirkwood support:
+# (C) Copyright 2009
+# Marvell Semiconductor 
+# Written-by: Prafulla Wadaskar 
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Refer doc/README.kwbimage for more details about how-to configure
+# and create kirkwood boot image
+#
+
+# Boot Media configurations
+BOOT_FROM  nand# Boot from NAND flash
+NAND_PAGE_SIZE 800
+
+# SOC registers configuration using bootrom header extension
+# Maximum KWBIMAGE_MAX_CONFIG configurations allowed
+
+# Values taken from image original LaCie U-Boot header dump!
+
+# Configure RGMII-0 interface pad voltage to 1.8V
+DATA 0xFFD100e0 0x1B1B1B9B
+
+#Dram initalization for SINGLE x16 CL=5 @ 400MHz
+DATA 0xFFD01400 0x43000c30 # DDR Configuration register
+
+DATA 0xFFD01404 0x37743000 # DDR Controller Control Low
+
+DATA 0xFFD01408 0x11012228 # DDR Timing (Low) (active cycles value +1)
+
+DATA 0xFFD0140C 0x0A19 #  DDR Timing (High)
+
+DATA 0xFFD01410 0x #  DDR Address Control
+
+DATA 0xFFD01414 0x #  DDR Open Pages Control
+
+DATA 0xFFD01418 0x #  DDR Operation
+
+DATA 0xFFD0141C 0x0662 #  DDR Mode
+
+DATA 0xFFD01420 0x0004 #  DDR Extended Mode
+
+DATA 0xFFD01424 0xF07F #  DDR Controller Control High
+
+DATA 0xFFD01428 0x00096630 # DDR2 ODT Read Timing (default values)
+
+DATA 0xFFD0147C 0x9663 # DDR2 ODT Write Timing (default values)
+
+DATA 0xFFD01504 0x0FF1 # CS[0]n Size

Re: [U-Boot] [PATCH v2 12/23] tegra: video: Rename CONFIG_VIDEO_TEGRA to CONFIG_VIDEO_TEGRA20

2016-01-31 Thread Anatolij Gustschin
On Sat, 30 Jan 2016 16:37:51 -0700
Simon Glass s...@chromium.org wrote:

> This option refers only to the tegra20 video driver, so name it as such
> to avoid confusion with tegra124.
> 
> Also move this option to Kconfig.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2: None
> 
>  arch/arm/mach-tegra/tegra20/Makefile| 2 +-
>  board/toradex/colibri_t20/colibri_t20.c | 2 +-
>  configs/colibri_t20_defconfig   | 1 +
>  configs/harmony_defconfig   | 1 +
>  configs/medcom-wide_defconfig   | 1 +
>  configs/paz00_defconfig | 1 +
>  configs/seaboard_defconfig  | 1 +
>  configs/tec_defconfig   | 1 +
>  configs/ventana_defconfig   | 1 +
>  drivers/video/Kconfig   | 8 
>  drivers/video/Makefile  | 2 +-
>  include/configs/colibri_t20.h   | 1 -
>  include/configs/harmony.h   | 1 -
>  include/configs/medcom-wide.h   | 1 -
>  include/configs/paz00.h | 1 -
>  include/configs/seaboard.h  | 1 -
>  include/configs/tec.h   | 1 -
>  include/configs/ventana.h   | 1 -
>  18 files changed, 18 insertions(+), 10 deletions(-)

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


Re: [U-Boot] [PATCH v2 18/23] tegra: video: Remove the static variables

2016-01-31 Thread Anatolij Gustschin
On Sat, 30 Jan 2016 16:37:57 -0700
Simon Glass s...@chromium.org wrote:

> We can move the static variables into the driver-private data.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2: None
> 
>  drivers/video/tegra.c | 31 +++
>  1 file changed, 15 insertions(+), 16 deletions(-)

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


Re: [U-Boot] [PATCH 00/14] EFI payload / application support v2

2016-01-31 Thread Alexander Graf



On 01/31/2016 04:17 PM, Simon Glass wrote:

Hi Alexander,

On 14 January 2016 at 22:06, Alexander Graf  wrote:

This is my Christmas present for my openSUSE friends :).

U-Boot is a great project for embedded devices. However, convincing
everyone involved that only for "a few oddball ARM devices" we need to
support different configuration formats from grub2 when all other platforms
(PPC, System Z, x86) are standardized on a single format is a nightmare.

Well some might argue that grub2 and UEFI are their own nightmares :-)


They are, but they are the same nightmare everyone else is dreaming ;).




So we started to explore alternatives. At first, people tried to get
grub2 running using the u-boot api interface. However, FWIW that one
doesn't support relocations, so you need to know where to link grub2 to
at compile time. It also seems to be broken more often than not. And on
top of it all, it's a one-off interface, so yet another thing to maintain.

The API interface is mostly for closed-source work I think.


That led to a nifty idea. What if we can just implement the EFI application
protocol on top of U-Boot? Then we could compile a single grub2 binary for
uEFI based systems and U-Boot based systems and as soon as that one's loaded,
everything looks and feels (almost) the same.

This patch set is the result of pursuing this endeavor.

   - I am successfully able to run grub2 and Linux EFI binaries with this code.
   - When enabled, the resulting U-Boot binary only grows by ~10kb,
 so it's very light weight.
   - It works on 32bit ARM and AArch64.
   - All storage devices are directly accessible
   - No EFI variables
   - Removable media booting (search for /efi/boot/boota{a64,arm}.efi)

Of course, there are still a few things one could do on top:

   - Improve disk media detection (don't scan, use what information we have)
   - Add EFI variable support using NVRAM
   - Add GFX support
   - Make EFI Shell work ;)
   - Network device support
   - Support for payload exit

But so far, I'm very happy with the state of the patches. They completely
eliminate potential arguments against U-Boot internally and give users the
chance to run with the same level of comfort on all firmware types.

I'd suggest creating a README with the above info. The cover letter
will vanish pretty fast. Perhaps also update README.efi with this new
option.


Good idea.



Another thing you could list is efi_set_watchdog_timer().


What about it exactly? That it's not supported atm?




Version 2 was successfully tested to boot grub2 and Linux from there on a
HiKey (AArch64, dcache disabled) and on a BeagleBone Black.

Do you have a UEFI image for BBB that I can put on an SD card or otherwise boot?


Phew, I hand-crafted one to play around with. You can use the hip04d01 
image from


http://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/HIP04D01/images/openSUSE-Tumbleweed-ARM-JeOS-hip04d01.armv7l.install.tar.xz

Just extract the tar.xz, to get to the actual image .xz file.

That image obviously has an incorrect kernel for the BBB, but everything 
up to grub2 should work with it.


My plan was to slowly move all openSUSE arm targets that use our own 
u-boot binaries to EFI once this patch set goes in ;).



For now I've had a play with Minnowboard, which is x86. The main thing
I noticed is that the API function implements should have EFIAPI on
them also.


Yes :). I didn't expect anyone to actually care about running this on 
x86 which is the only architecture that has different calling 
conventions for EFI. I'm very pleasantly surprised that you are 
interested and since you already have a patch to add them, I guess you 
can as well just post that once the base support is in :).



  I'll make a few other comments on the patches. But overall
it seems to function and I think your implementation is nice.


Thanks :)



I was able to get grub to boot but it just says  'Welcome to GRUB!'
and then 'error: disk ',gpt4' not found'. I'm not sure what that
means.


It might mean memory corruption. I'm not sure where from though :). It 
could also mean register clobbering.





U-Boot 2016.01-00860-geb4b602-dirty (Jan 31 2016 - 08:02:54 -0700)

CPU: x86_64, vendor Intel, device 30673h
DRAM:  2 GiB
efi_runtime_relocate: Relocating to offset=7ba5d000
MMC:   ValleyView SDHCI: 0, ValleyView SDHCI: 1
SF: Detected W25Q64DW with page size 256 Bytes, erase size 4 KiB, total 8 MiB
*** Warning - bad CRC, using default environment

Video: 1280x1024x16
Model: Intel Minnowboard Max
SF: Detected W25Q64DW with page size 256 Bytes, erase size 4 KiB, total 8 MiB
SCSI:  SATA link 0 timeout.
Target spinup took 0 ms.
AHCI 0001.0300 32 slots 2 ports 3 Gbps 0x3 impl SATA mode
flags: 64bit ncq stag pm led clo pio slum part sxs
scanning bus for devices...
   Device 0: (1:0) Vendor: ATA Prod.: ADATA SP310 Rev: 5.2
 Type: Hard Disk
 Capacity: 30533.8 MB = 29.8 GB (62533296 x 512)
Found 1 device(s).
Net:

Re: [U-Boot] [PATCH v2 16/23] tegra: video: Merge the two config structures together

2016-01-31 Thread Anatolij Gustschin
On Sat, 30 Jan 2016 16:37:55 -0700
Simon Glass s...@chromium.org wrote:

> We have a structure for the display panel and another for the controller.
> There is some overlap between them. Merge them to simplify the driver.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2: None
> 
>  arch/arm/include/asm/arch-tegra20/display.h | 39 
>  drivers/video/tegra.c   | 72 
> +
>  2 files changed, 53 insertions(+), 58 deletions(-)

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


Re: [U-Boot] [PATCH] fdt: introudce fdt_get_child_count

2016-01-31 Thread Peng Fan
Hi Simon,

On Sun, Jan 31, 2016 at 08:37:45AM -0700, Simon Glass wrote:
>Hi Peng,
>
>On 30 January 2016 at 23:38, Peng Fan  wrote:
>> Introudce fdt_get_child_count for get the number of subnodes of
>> one parent node.
>>
>> Signed-off-by: Peng Fan 
>> Cc: Simon Glass 
>> ---
>>  include/libfdt.h | 18 ++
>>  1 file changed, 18 insertions(+)
>>
>> diff --git a/include/libfdt.h b/include/libfdt.h
>> index e48c21a..94d29e6 100644
>> --- a/include/libfdt.h
>> +++ b/include/libfdt.h
>> @@ -193,6 +193,24 @@ int fdt_next_subnode(const void *fdt, int offset);
>>  node >= 0; \
>>  node = fdt_next_subnode(fdt, node))
>>
>> +/**
>> + * fdt_get_child_count() - get the number of subnodes of one node
>> + *
>> + * @fdt:   FDT blob
>> + * @node:  Offset of node
>> + * @return number of child nodes of node, or 0 if there is no subnode.
>> + */
>> +static inline int fdt_get_child_count(void *fdt, int node)
>
>Does this need to be inline. It doesn't seem important to me.

I just follow linux kernel and add inline. If inline is not needed, I can
move the piece code to lib/fdtdec.c.

You mean this API is not important?

Thanks,
Peng

>
>> +{
>> +   int subnode;
>> +   int num = 0;
>> +
>> +   fdt_for_each_subnode(fdt, subnode, node)
>> +   num++;
>> +
>> +   return num;
>> +}
>> +
>>  /**/
>>  /* General functions  */
>>  /**/
>> --
>> 2.6.2
>>
>
>Regards,
>Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] armv8/ls1043a: Implement workaround for erratum A009660

2016-01-31 Thread Mingkai Hu


> -Original Message-
> From: york sun
> Sent: Saturday, January 30, 2016 4:40 AM
> To: Mingkai Hu; u-boot@lists.denx.de
> Subject: Re: [PATCH] armv8/ls1043a: Implement workaround for erratum
> A009660
> 
> On 01/25/2016 10:12 PM, Mingkai Hu wrote:
> >
> >
> >> -Original Message-
> >> From: york sun
> >> Sent: Saturday, January 23, 2016 1:44 AM
> >> To: Mingkai Hu; Mingkai Hu; u-boot@lists.denx.de
> >> Subject: Re: [PATCH] armv8/ls1043a: Implement workaround for erratum
> >> A009660
> >>
> >> On 01/21/2016 11:50 PM, Mingkai Hu wrote:
> >>>
> >>>
>  -Original Message-
>  From: Mingkai Hu
>  Sent: Thursday, January 21, 2016 11:18 AM
>  To: york sun; Mingkai Hu; u-boot@lists.denx.de
>  Subject: RE: [PATCH] armv8/ls1043a: Implement workaround for
>  erratum
>  A009660
> 
> 
> 
> > -Original Message-
> > From: york sun
> > Sent: Thursday, January 21, 2016 12:21 AM
> > To: Mingkai Hu; u-boot@lists.denx.de
> > Cc: Mingkai Hu
> > Subject: Re: [PATCH] armv8/ls1043a: Implement workaround for
> > erratum
> > A009660
> >
> > On 01/19/2016 10:44 PM, Mingkai Hu wrote:
> >> From: Mingkai Hu 
> >>
> >> Memory controller performance is not optimal with default
> >> internal target queue register value, write required value for
> >> optimal DDR performance.
> >>
> >> Signed-off-by: Mingkai Hu 
> >> ---
> >>  arch/arm/cpu/armv8/fsl-layerscape/soc.c   | 13
> >> +
> >>  arch/arm/include/asm/arch-fsl-layerscape/config.h |  1 +
> >>  2 files changed, 14 insertions(+)
> >>
> >> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
> >> b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
> >> index 23d6b73..485f5cd 100644
> >> --- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
> >> +++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
> >> @@ -210,6 +210,18 @@ static void erratum_a009929(void)  #endif  }
> >>
> >> +/*
> >> + * This erratum requires setting a value to eddrtqcr1 to
> >> + * optimal the DDR performance.
> >> + */
> >> +static void erratum_a009660(void) { #ifdef
> >> +CONFIG_SYS_FSL_ERRATUM_A009660
> >> +  u32 *eddrtqcr1 = (void *)CONFIG_SYS_FSL_SCFG_ADDR + 0x20c;
> >> +  out_be32(eddrtqcr1, 0x63b20042); #endif }
> >> +
> >>  void fsl_lsch2_early_init_f(void)  {
> >>struct ccsr_cci400 *cci = (struct ccsr_cci400
> >> *)CONFIG_SYS_CCI400_ADDR; @@ -232,6 +244,7 @@ void
> >> fsl_lsch2_early_init_f(void)
> >>
> >>/* Erratum */
> >>erratum_a009929();
> >> +  erratum_a009660();
> >>  }
> >>  #endif
> >>
> >> diff --git a/arch/arm/include/asm/arch-fsl-layerscape/config.h
> >> b/arch/arm/include/asm/arch-fsl-layerscape/config.h
> >> index 49b113d..66399b2 100644
> >> --- a/arch/arm/include/asm/arch-fsl-layerscape/config.h
> >> +++ b/arch/arm/include/asm/arch-fsl-layerscape/config.h
> >> @@ -167,6 +167,7 @@
> >>  #define GICC_BASE 0x01402000
> >>
> >>  #define CONFIG_SYS_FSL_ERRATUM_A009929
> >> +#define CONFIG_SYS_FSL_ERRATUM_A009660
> >>  #else
> >>  #error SoC not defined
> >>  #endif
> >>
> >
> > NACK.
> >
> > Erratum A009660 is cancelled. The workaround is integrated into
> >> A008514.
> > Please revise workaround for A008514. Besides, you are using ARMv7
> > offset for ARMv8.
> > Please check if this workaround applies to LS2 SoCs. While you are
> > on it, please add a comment to LS1 workaround with the word
> > A008514 so we can grep it.
> >
> 
>  Hi York,
> 
>  I discussed with design team and got the erratum in LS1043A CE
>  before preparing the patch. The value (0x63b20042) is the same one
>  described in
>  A008514 of LS1021A and the register offset of LS1043A is same with
>  the one used for LS1021A which is in the SCFG space.
> 
>  I will double check with the design team about if the erraum number
>  is still A009660 and keep you in the loop.
> 
>  For LS2, I got the A008514 in the LS2085A CE, but 1. The value is
>  63b2_0002 which is different from the value used on ls1043 platform.
>  2. The address is in DCFG space.
>  3. I did not get the A008514 in the LS2080A CE (RevD).
> 
>  So it's better to confirm with design team about the value used and
>  the consistence between LS2085A and LS2080A.
> 
> >>> York,
> >>>
> >>> As discussed with design team, the erratum A009660 is the correct
> >>> one
> >> and the value/offset is also correct.
> >>>
> >>> Do you prefer to submit a new patch to fix ls2085 or fix it on this
> >> patch?
> >>>
> >>
> >> Mingkai,
> >>
> >> If the erratum A009660 is republished, and A008514 is updated for
> >> LS2085/LS1021, you can keep this patch, but adding a check to 

Re: [U-Boot] 64-bit x86 U-Boot?

2016-01-31 Thread Albert ARIBAUD
Hello Simon,

On Sun, 31 Jan 2016 19:20:31 -0700, Simon Glass 
wrote:
> Hi Bin,
> 
> At present U-Boot supports booting a 64-bit kernel directly. It can
> also be loaded as a 64-bit payload from EFI. But it cannot be built as
> a 64-bit boot loader.
> 
> I took a bit of a look at this. It looks like we need to stay in
> 32-bit mode until the FSP is loaded. Also, to get to 64-bit mode I'm
> pretty sure we need page tables, which means we need somewhere to put
> them!
> 
> Looking at the board_f init sequence, it seems that arch_cpu_init() is
> the earlist we could switch to 64-bit. We'd need to grab some memory
> from somewhere to do this - I wonder if this can be CAR? There is no
> SRAM on x86 chips I think.
> 
> For non-FSP devices we don't init the RAM until much later -
> dram_init(). That means that a significant portion of the init
> sequence would be 32-bit code. I'm not sure that will work.
> 
> I suppose one option is to only go to 64-bit mode when relocating. But
> then we end up with lots of code that needs to run in 32-bit and
> 64-bit.
> 
> Do you have any ideas on this?

How about starting with implementing the last option, i.e. switch to 64
bits when DDR is available, mainline that, then progressively work your
way toward an earlier switch?

> Regards,
> Simon

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


Re: [U-Boot] [PATCH v4 2/4] QE: add QE support on ls1043ardb

2016-01-31 Thread Mingkai Hu


> -Original Message-
> From: Zhao Qiang [mailto:qiang.z...@nxp.com]
> Sent: Friday, January 29, 2016 12:28 PM
> To: Mingkai Hu
> Cc: tr...@konsulko.com; york sun; u-boot@lists.denx.de; Qiang Zhao
> Subject: [PATCH v4 2/4] QE: add QE support on ls1043ardb
> 
> Upload qe microcode on ls1043ardb
> 
> Signed-off-by: Zhao Qiang 
> ---
>  board/freescale/ls1043ardb/ls1043ardb.c | 8 
>  drivers/qe/qe.c | 6 ++
>  include/configs/ls1043ardb.h| 7 +++
>  3 files changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/board/freescale/ls1043ardb/ls1043ardb.c
> b/board/freescale/ls1043ardb/ls1043ardb.c
> index c8f723a..834fdff 100644
> --- a/board/freescale/ls1043ardb/ls1043ardb.c
> +++ b/board/freescale/ls1043ardb/ls1043ardb.c
> @@ -21,6 +21,10 @@
>  #include 
>  #include 
>  #include "cpld.h"
> +#ifdef CONFIG_U_QE
> +#include "../../../drivers/qe/qe.h"
> +#endif
> +
> 

The patch submitted by Qianyu is trying to move qe.h to include/fsl_qe.h,
It's better to based on this patch set to avoid the long include statement.
http://patchwork.ozlabs.org/patch/572697/

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


[U-Boot] [PATCH v2] armv8/ls1043a: Implement workaround for erratum A009660

2016-01-31 Thread Mingkai Hu
From: Mingkai Hu 

Memory controller performance is not optimal with default internal
target queue register value, write required value for optimal DDR
performance.

Signed-off-by: Mingkai Hu 
---
v2: 
 - Add a check to make sure A009660 and A008514 is are not both enabled.
 - Add comment for the offset of eddrtqcr1.

 arch/arm/cpu/armv8/fsl-layerscape/soc.c   | 15 +++
 arch/arm/include/asm/arch-fsl-layerscape/config.h |  5 +
 2 files changed, 20 insertions(+)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c 
b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
index 7ff0148..8b01fd2 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
@@ -213,6 +213,20 @@ static void erratum_a009929(void)
 #endif
 }
 
+/*
+ * This erratum requires setting a value to eddrtqcr1 to optimal
+ * the DDR performance. The eddrtqcr1 register is in SCFG space
+ * of LS1043A and the offset is 0x157_020c.
+ */
+static void erratum_a009660(void)
+{
+#if defined(CONFIG_SYS_FSL_ERRATUM_A009660) \
+   && !defined(CONFIG_SYS_FSL_ERRATUM_A008514)
+   u32 *eddrtqcr1 = (void *)CONFIG_SYS_FSL_SCFG_ADDR + 0x20c;
+   out_be32(eddrtqcr1, 0x63b20042);
+#endif
+}
+
 void fsl_lsch2_early_init_f(void)
 {
struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
@@ -238,6 +252,7 @@ void fsl_lsch2_early_init_f(void)
 
/* Erratum */
erratum_a009929();
+   erratum_a009660();
 }
 #endif
 
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/config.h 
b/arch/arm/include/asm/arch-fsl-layerscape/config.h
index f1b164f..854ed0b 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/config.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/config.h
@@ -171,6 +171,11 @@
 
 #define CONFIG_SYS_FSL_ERRATUM_A009663
 #define CONFIG_SYS_FSL_ERRATUM_A009929
+#define CONFIG_SYS_FSL_ERRATUM_A009660
+#if defined(CONFIG_SYS_FSL_ERRATUM_A009660) \
+   && defined(CONFIG_SYS_FSL_ERRATUM_A008514)
+#error "A009660 and A008514 are both enabed for LS1043A, please check it."
+#endif
 #else
 #error SoC not defined
 #endif
-- 
2.1.0.27.g96db324

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


Re: [U-Boot] [PATCH v3 0/7] fdt: Replace u-boot-dtb.bin with u-boot.bin

2016-01-31 Thread Albert ARIBAUD
Hello Simon,

Nitpicking:

On Sun, 31 Jan 2016 18:10:48 -0700, Simon Glass 
wrote:

> The original decision to use a separate u-boot-dtb.bin was aimed at allowing
> any device tree file to be concatenated to the u-boot.bin image after the
> build. However this no-longer seems so important. More important is the
> convenience of using the same output file regardless of the setting for
> OF_CONTROL.

Maybe explain in a few words why concatenating the DT no long seems
important, so that readers who were intending to concatenate get a hint
on what option they should follow instead?

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


Re: [U-Boot] [PATCH v4 4/4] qe: assgin pins to qe-hdlc

2016-01-31 Thread Mingkai Hu


> -Original Message-
> From: Zhao Qiang [mailto:qiang.z...@nxp.com]
> Sent: Friday, January 29, 2016 12:28 PM
> To: Mingkai Hu
> Cc: tr...@konsulko.com; york sun; u-boot@lists.denx.de; Qiang Zhao
> Subject: [PATCH v4 4/4] qe: assgin pins to qe-hdlc
> 
> qe-hdlc and usb multi-use the pins, when set hwconfig=qe-hdlc, assign the
> pins to qe-hdlc, if not, assgin it to usb
> 
> Signed-off-by: Zhao Qiang 
> ---
>  board/freescale/ls1043ardb/ls1043ardb.c | 53 ++-
> --
>  1 file changed, 43 insertions(+), 10 deletions(-)
> 
> diff --git a/board/freescale/ls1043ardb/ls1043ardb.c
> b/board/freescale/ls1043ardb/ls1043ardb.c
> index c2d4887..7ba72f8 100644
> --- a/board/freescale/ls1043ardb/ls1043ardb.c
> +++ b/board/freescale/ls1043ardb/ls1043ardb.c
> @@ -114,18 +114,24 @@ int config_board_mux(void)
>   struct ccsr_scfg *scfg = (struct ccsr_scfg
> *)CONFIG_SYS_FSL_SCFG_ADDR;
>   u32 usb_pwrfault;
> 
> + if (hwconfig("qe-hdlc")) {
> + out_be32(>rcwpmuxcr0,
> +  (in_be32(>rcwpmuxcr0) & ~0xff00) | 0x6600);
> + printf("Assign to qe-hdlc clk, rcwpmuxcr0=%x\n",
> +in_be32(>rcwpmuxcr0));
> + } else {
>  #ifdef CONFIG_HAS_FSL_XHCI_USB
> - out_be32(>rcwpmuxcr0, 0x);
> - out_be32(>usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
> - usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
> - SCFG_USBPWRFAULT_USB3_SHIFT) |
> - (SCFG_USBPWRFAULT_DEDICATED <<
> - SCFG_USBPWRFAULT_USB2_SHIFT) |
> - (SCFG_USBPWRFAULT_SHARED <<
> -  SCFG_USBPWRFAULT_USB1_SHIFT);
> - out_be32(>usbpwrfault_selcr, usb_pwrfault);
> + out_be32(>rcwpmuxcr0, 0x);
> + out_be32(>usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
> + usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
> + SCFG_USBPWRFAULT_USB3_SHIFT) |
> + (SCFG_USBPWRFAULT_DEDICATED <<
> + SCFG_USBPWRFAULT_USB2_SHIFT) |
> + (SCFG_USBPWRFAULT_SHARED <<
> +  SCFG_USBPWRFAULT_USB1_SHIFT);
> + out_be32(>usbpwrfault_selcr, usb_pwrfault);
>  #endif
> -
> + }
>   return 0;
>  }
> 
> @@ -152,6 +158,16 @@ int misc_init_r(void)  }  #endif
> 
> +void fdt_del_qe(void *blob)
> +{
> + int nodeoff = 0;
> +
> + while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
> + "fsl,qe")) >= 0) {
> + fdt_del_node(blob, nodeoff);
> + }
> +}
> +
>  int ft_board_setup(void *blob, bd_t *bd)  {
>   u64 base[CONFIG_NR_DRAM_BANKS];
> @@ -169,6 +185,23 @@ int ft_board_setup(void *blob, bd_t *bd)  #ifdef
> CONFIG_SYS_DPAA_FMAN
>   fdt_fixup_fman_ethernet(blob);
>  #endif
> +
> + /*
> +  * qe-hdlc and usb multi-use the pins,
> +  * when set hwconfig to qe-hdlc, delete usb node.
> +  */
> + if (hwconfig("qe-hdlc"))
> +#ifdef CONFIG_HAS_FSL_XHCI_USB
> + fdt_del_node_and_alias(blob, "usb1"); #endif
> + /*
> +  * qe just support qe-uart and qe-hdlc,
> +  * if qe-uart and qe-hdlc are not set in hwconfig,
> +  * delete qe node.
> +  */
> + if (!hwconfig("qe-uart") && !hwconfig("qe-hdlc"))
> + fdt_del_qe(blob);
> +
>   return 0;
>  }
> 
> --
> 2.1.0.27.g96db324

Reviewed-by: Mingkai Hu 

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


Re: [U-Boot] [PATCH v4 3/4] ls1043rdb: move USB mux config to config_board_mux

2016-01-31 Thread Mingkai Hu


> -Original Message-
> From: Zhao Qiang [mailto:qiang.z...@nxp.com]
> Sent: Friday, January 29, 2016 12:28 PM
> To: Mingkai Hu
> Cc: tr...@konsulko.com; york sun; u-boot@lists.denx.de; Qiang Zhao
> Subject: [PATCH v4 3/4] ls1043rdb: move USB mux config to
> config_board_mux
> 
> USB pins are muxed with other feature, move USB mux config to
> config_board_mux.
> 
> Signed-off-by: Zhao Qiang 
> ---
>  board/freescale/ls1043ardb/ls1043ardb.c | 30 +++
> ---
>  1 file changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/board/freescale/ls1043ardb/ls1043ardb.c
> b/board/freescale/ls1043ardb/ls1043ardb.c
> index 834fdff..c2d4887 100644
> --- a/board/freescale/ls1043ardb/ls1043ardb.c
> +++ b/board/freescale/ls1043ardb/ls1043ardb.c
> @@ -75,23 +75,8 @@ int dram_init(void)
> 
>  int board_early_init_f(void)
>  {
> - struct ccsr_scfg *scfg = (struct ccsr_scfg
> *)CONFIG_SYS_FSL_SCFG_ADDR;
> - u32 usb_pwrfault;
> -
>   fsl_lsch2_early_init_f();
> 
> -#ifdef CONFIG_HAS_FSL_XHCI_USB
> - out_be32(>rcwpmuxcr0, 0x);
> - out_be32(>usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
> - usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
> - SCFG_USBPWRFAULT_USB3_SHIFT) |
> - (SCFG_USBPWRFAULT_DEDICATED <<
> - SCFG_USBPWRFAULT_USB2_SHIFT) |
> - (SCFG_USBPWRFAULT_SHARED <<
> -  SCFG_USBPWRFAULT_USB1_SHIFT);
> - out_be32(>usbpwrfault_selcr, usb_pwrfault);
> -#endif
> -
>   return 0;
>  }
> 
> @@ -126,6 +111,21 @@ int board_init(void)
> 
>  int config_board_mux(void)
>  {
> + struct ccsr_scfg *scfg = (struct ccsr_scfg
> *)CONFIG_SYS_FSL_SCFG_ADDR;
> + u32 usb_pwrfault;
> +
> +#ifdef CONFIG_HAS_FSL_XHCI_USB
> + out_be32(>rcwpmuxcr0, 0x);
> + out_be32(>usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1);
> + usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED <<
> + SCFG_USBPWRFAULT_USB3_SHIFT) |
> + (SCFG_USBPWRFAULT_DEDICATED <<
> + SCFG_USBPWRFAULT_USB2_SHIFT) |
> + (SCFG_USBPWRFAULT_SHARED <<
> +  SCFG_USBPWRFAULT_USB1_SHIFT);
> + out_be32(>usbpwrfault_selcr, usb_pwrfault); #endif
> +
>   return 0;
>  }
> 
> --
> 2.1.0.27.g96db324

Reviewed-by: Mingkai Hu 

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


[U-Boot] [PATCH 1/2] pinctrl: imx: Introduce pinctrl driver for i.MX6

2016-01-31 Thread Peng Fan
Introduce pinctrl for i.MX6
1. pinctrl-imx.c is for common usage. It's used by i.MX6/7.
2. Add PINCTRL_IMX PINCTRL_IMX6 Kconfig entry.
3. To the pinctrl_ops implementation, only set_state is implemented.
   To i.MX6/7, the pinctrl dts entry is as following:
 {
pinctrl-names = "default";

pinctrl_csi1: csi1grp {
fsl,pins = <
MX6UL_PAD_CSI_MCLK__CSI_MCLK0x1b088
MX6UL_PAD_CSI_PIXCLK__CSI_PIXCLK0x1b088
MX6UL_PAD_CSI_VSYNC__CSI_VSYNC  0x1b088
>;
};

[.]
};
  there is no property named function or groups. So pinctrl_generic_set_state
  can not be used here.
5. This driver is a simple implementation for i.mx iomux controller,
   only parse the fsl,pins property and write value to registers.
6. With DEBUG enabled, we can see log when "i2c bus 0":
   "
   set_state_simple op missing
   imx_pinctrl_set_state: i2c1grp
   mux_reg 0x14c, conf_reg 0x3bc, input_reg 0x5d8, mux_mode 0x0, input_val 0x1, 
config_val 0x407f
   write mux: offset 0x14c val 0x10
   select_input: offset 0x5d8 val 0x1
   write config: offset 0x3bc val 0x7f
   mux_reg 0x148, conf_reg 0x3b8, input_reg 0x5d4, mux_mode 0x0, input_val 0x1, 
config_val 0x407f
   write mux: offset 0x148 val 0x10
   select_input: offset 0x5d4 val 0x1
   write config: offset 0x3b8 val 0x7f
   "
   this means imx6 pinctrl driver works as expected.

Signed-off-by: Peng Fan 
Cc: Simon Glass 
Cc: Stefano Babic 
Cc: Fabio Estevam 
---
 drivers/pinctrl/Kconfig|   1 +
 drivers/pinctrl/Makefile   |   1 +
 drivers/pinctrl/nxp/Kconfig|  10 ++
 drivers/pinctrl/nxp/Makefile   |   2 +
 drivers/pinctrl/nxp/pinctrl-imx.c  | 224 +
 drivers/pinctrl/nxp/pinctrl-imx.h  |  59 ++
 drivers/pinctrl/nxp/pinctrl-imx6.c |  41 +++
 7 files changed, 338 insertions(+)
 create mode 100644 drivers/pinctrl/nxp/Kconfig
 create mode 100644 drivers/pinctrl/nxp/Makefile
 create mode 100644 drivers/pinctrl/nxp/pinctrl-imx.c
 create mode 100644 drivers/pinctrl/nxp/pinctrl-imx.h
 create mode 100644 drivers/pinctrl/nxp/pinctrl-imx6.c

diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index 57e6142..9fd8f62 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -133,6 +133,7 @@ config PINCTRL_SANDBOX
 
 endif
 
+source "drivers/pinctrl/nxp/Kconfig"
 source "drivers/pinctrl/uniphier/Kconfig"
 
 endmenu
diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
index 70d25dc..dcd20bf 100644
--- a/drivers/pinctrl/Makefile
+++ b/drivers/pinctrl/Makefile
@@ -5,6 +5,7 @@
 obj-y  += pinctrl-uclass.o
 obj-$(CONFIG_$(SPL_)PINCTRL_GENERIC)   += pinctrl-generic.o
 
+obj-y  += nxp/
 obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
 obj-$(CONFIG_PINCTRL_SANDBOX)  += pinctrl-sandbox.o
 
diff --git a/drivers/pinctrl/nxp/Kconfig b/drivers/pinctrl/nxp/Kconfig
new file mode 100644
index 000..2032588
--- /dev/null
+++ b/drivers/pinctrl/nxp/Kconfig
@@ -0,0 +1,10 @@
+config PINCTRL_IMX
+   bool
+
+config PINCTRL_IMX6
+   bool "IMX6 pinctrl driver"
+   depends on ARCH_MX6
+   select DEVRES
+   select PINCTRL_IMX
+   help
+ Say Y here to enable the imx6ul pinctrl driver
diff --git a/drivers/pinctrl/nxp/Makefile b/drivers/pinctrl/nxp/Makefile
new file mode 100644
index 000..7fd9850
--- /dev/null
+++ b/drivers/pinctrl/nxp/Makefile
@@ -0,0 +1,2 @@
+obj-$(CONFIG_PINCTRL_IMX)  += pinctrl-imx.o
+obj-$(CONFIG_PINCTRL_IMX6) += pinctrl-imx6.o
diff --git a/drivers/pinctrl/nxp/pinctrl-imx.c 
b/drivers/pinctrl/nxp/pinctrl-imx.c
new file mode 100644
index 000..09ffb1b
--- /dev/null
+++ b/drivers/pinctrl/nxp/pinctrl-imx.c
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2016 Peng Fan 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "pinctrl-imx.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static int imx_pinctrl_set_state(struct udevice *dev, struct udevice *config)
+{
+   struct imx_pinctrl_priv *priv = dev_get_priv(dev);
+   struct imx_pinctrl_soc_info *info = priv->info;
+   int node = config->of_offset;
+   const struct fdt_property *prop;
+   unsigned int *pin_data;
+   int npins, size, pin_size;
+   int mux_reg, conf_reg, input_reg, input_val, mux_mode, config_val;
+   int i, j = 0;
+
+   dev_dbg(dev, "%s: %s\n", __func__, config->name);
+
+   if (info->flags & SHARE_MUX_CONF_REG)
+   pin_size = SHARE_FSL_PIN_SIZE;
+   else
+   pin_size = FSL_PIN_SIZE;
+
+   prop = fdt_get_property(gd->fdt_blob, node, "fsl,pins", );
+   if (!prop) {
+   dev_err(dev, "No fsl,pins property in node %s\n", config->name);
+   

[U-Boot] [PATCH 2/2] pinctrl: imx: Support i.MX7D

2016-01-31 Thread Peng Fan
Introudce i.MX7 pinctrl driver support.
For now only i.MX7D supported.
There are two iomux controllers in i.MX7D, iomuxc and iomuxc_lpsr.
To iomuxc_lpsr, ZERO_OFFSET_VALID is set, means offset of mux_reg
and conf_reg can begin at 0.

Signed-off-by: Peng Fan 
Cc: Simon Glass 
Cc: Stefano Babic 
Cc: Fabio Estevam 
---
 drivers/pinctrl/nxp/Kconfig|  8 
 drivers/pinctrl/nxp/Makefile   |  1 +
 drivers/pinctrl/nxp/pinctrl-imx7.c | 42 ++
 3 files changed, 51 insertions(+)
 create mode 100644 drivers/pinctrl/nxp/pinctrl-imx7.c

diff --git a/drivers/pinctrl/nxp/Kconfig b/drivers/pinctrl/nxp/Kconfig
index 2032588..a251d54 100644
--- a/drivers/pinctrl/nxp/Kconfig
+++ b/drivers/pinctrl/nxp/Kconfig
@@ -8,3 +8,11 @@ config PINCTRL_IMX6
select PINCTRL_IMX
help
  Say Y here to enable the imx6ul pinctrl driver
+
+config PINCTRL_IMX7
+   bool "IMX7 pinctrl driver"
+   depends on ARCH_MX7
+   select DEVRES
+   select PINCTRL_IMX
+   help
+ Say Y here to enable the imx6ul pinctrl driver
diff --git a/drivers/pinctrl/nxp/Makefile b/drivers/pinctrl/nxp/Makefile
index 7fd9850..0ee7f2f 100644
--- a/drivers/pinctrl/nxp/Makefile
+++ b/drivers/pinctrl/nxp/Makefile
@@ -1,2 +1,3 @@
 obj-$(CONFIG_PINCTRL_IMX)  += pinctrl-imx.o
 obj-$(CONFIG_PINCTRL_IMX6) += pinctrl-imx6.o
+obj-$(CONFIG_PINCTRL_IMX7) += pinctrl-imx7.o
diff --git a/drivers/pinctrl/nxp/pinctrl-imx7.c 
b/drivers/pinctrl/nxp/pinctrl-imx7.c
new file mode 100644
index 000..150ccf9
--- /dev/null
+++ b/drivers/pinctrl/nxp/pinctrl-imx7.c
@@ -0,0 +1,42 @@
+
+/*
+ * Copyright (C) 2016 Peng Fan 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+
+#include "pinctrl-imx.h"
+
+static struct imx_pinctrl_soc_info imx7_pinctrl_soc_info;
+
+static struct imx_pinctrl_soc_info imx7_lpsr_pinctrl_soc_info = {
+   .flags = ZERO_OFFSET_VALID,
+};
+
+static int imx7_pinctrl_probe(struct udevice *dev)
+{
+   struct imx_pinctrl_soc_info *info =
+   (struct imx_pinctrl_soc_info *)dev_get_driver_data(dev);
+
+   return imx_pinctrl_probe(dev, info);
+}
+
+static const struct udevice_id imx7_pinctrl_match[] = {
+   { .compatible = "fsl,imx7d-iomuxc", .data = 
(ulong)_pinctrl_soc_info },
+   { .compatible = "fsl,imx7d-iomuxc-lpsr", .data = 
(ulong)_lpsr_pinctrl_soc_info },
+   { /* sentinel */ }
+};
+
+U_BOOT_DRIVER(imx7_pinctrl) = {
+   .name = "imx7-pinctrl",
+   .id = UCLASS_PINCTRL,
+   .of_match = of_match_ptr(imx7_pinctrl_match),
+   .probe = imx7_pinctrl_probe,
+   .remove = imx_pinctrl_remove,
+   .priv_auto_alloc_size = sizeof(struct imx_pinctrl_priv),
+   .ops = _pinctrl_ops,
+   .flags = DM_FLAG_PRE_RELOC,
+};
-- 
2.6.2

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


Re: [U-Boot] [PATCH] OMAP3: omap3_logic: Remove YAFFS support.

2016-01-31 Thread Albert ARIBAUD
Hello Adam,

On Sun, 31 Jan 2016 17:17:24 -0600, Adam Ford 
wrote:
> UBIFS is the preferred OS, and YAFFS isn't officially included in
> Linux.  Removing this feature reduces the code size.

Typo: "preferred FS", not "preferred OS".

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


[U-Boot] [PATCH] armv8/ls1043aqds: fix DSPI/QSPI node in dts file

2016-01-31 Thread Gong Qianyu
Fix the lost dts info when merging patches.

Fix DSPI node for 'commit e0579a5852b3 ("armv8/ls1043aqds: add DSPI
support")' and QSPI node for 'commit 166ef1e90ce4 ("armv8/ls1043aqds:
add QSPI support in SD boot")'.

Signed-off-by: Gong Qianyu 
---
 arch/arm/dts/fsl-ls1043a-qds.dtsi | 46 +++
 1 file changed, 46 insertions(+)

diff --git a/arch/arm/dts/fsl-ls1043a-qds.dtsi 
b/arch/arm/dts/fsl-ls1043a-qds.dtsi
index b9dad72..66efe67 100644
--- a/arch/arm/dts/fsl-ls1043a-qds.dtsi
+++ b/arch/arm/dts/fsl-ls1043a-qds.dtsi
@@ -14,6 +14,52 @@
 
 / {
model = "LS1043A QDS Board";
+   aliases {
+   spi0 = 
+   spi1 = 
+   };
+};
+
+ {
+   bus-num = <0>;
+   status = "okay";
+
+   dflash0: n25q128a {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "spi-flash";
+   reg = <0>;
+   spi-max-frequency = <100>; /* input clock */
+   };
+
+   dflash1: sst25wf040b {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "spi-flash";
+   spi-max-frequency = <350>;
+   reg = <1>;
+   };
+
+   dflash2: en25s64 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "spi-flash";
+   spi-max-frequency = <350>;
+   reg = <2>;
+   };
+};
+
+ {
+   bus-num = <0>;
+   status = "okay";
+
+   qflash0: s25fl128s@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "spi-flash";
+   spi-max-frequency = <2000>;
+   reg = <0>;
+   };
 };
 
  {
-- 
2.1.0.27.g96db324

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


[U-Boot] 64-bit x86 U-Boot?

2016-01-31 Thread Simon Glass
Hi Bin,

At present U-Boot supports booting a 64-bit kernel directly. It can
also be loaded as a 64-bit payload from EFI. But it cannot be built as
a 64-bit boot loader.

I took a bit of a look at this. It looks like we need to stay in
32-bit mode until the FSP is loaded. Also, to get to 64-bit mode I'm
pretty sure we need page tables, which means we need somewhere to put
them!

Looking at the board_f init sequence, it seems that arch_cpu_init() is
the earlist we could switch to 64-bit. We'd need to grab some memory
from somewhere to do this - I wonder if this can be CAR? There is no
SRAM on x86 chips I think.

For non-FSP devices we don't init the RAM until much later -
dram_init(). That means that a significant portion of the init
sequence would be 32-bit code. I'm not sure that will work.

I suppose one option is to only go to 64-bit mode when relocating. But
then we end up with lots of code that needs to run in 32-bit and
64-bit.

Do you have any ideas on this?

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


Re: [U-Boot] Conversion of serial_pxa.c to driver model

2016-01-31 Thread Simon Glass
Hi Marek,

On 31 January 2016 at 14:26, Marek Vasut  wrote:
> On Sunday, January 31, 2016 at 05:16:37 PM, Simon Glass wrote:
>> Hi Marek,
>
> Hi,
>
>> Are you planning to convert this to driver model?
>
> No, I don't plan to convert it any soon. CCing some more interested parties.
>
>> I see that two boards still use it.
>
> That's only because you removed the rest apparently ...

:-) That might have been generic board. In principle it's nice to keep
boards around but they do need a bit of effort every now and then...

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


[U-Boot] [PATCH v3 2/2] imx: mx6sxsabreauto: Add support for mx6sx SABREAUTO board

2016-01-31 Thread Ye Li
Initial version for mx6sx SABREAUTO board support with features:
PMIC, QSPI, NAND flash, SD/MMC, USB, Ethernet, I2C, IO Expander.

Signed-off-by: Ye Li 
---
Changes for v3:
- None
Changes for v2:
- None

 arch/arm/cpu/armv7/mx6/Kconfig  |6 +
 board/freescale/mx6sxsabreauto/Kconfig  |   12 +
 board/freescale/mx6sxsabreauto/MAINTAINERS  |6 +
 board/freescale/mx6sxsabreauto/Makefile |6 +
 board/freescale/mx6sxsabreauto/imximage.cfg |  136 ++
 board/freescale/mx6sxsabreauto/mx6sxsabreauto.c |  508 +++
 configs/mx6sxsabreauto_defconfig|   11 +
 include/configs/mx6sxsabreauto.h|  212 ++
 8 files changed, 897 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/mx6sxsabreauto/Kconfig
 create mode 100644 board/freescale/mx6sxsabreauto/MAINTAINERS
 create mode 100644 board/freescale/mx6sxsabreauto/Makefile
 create mode 100644 board/freescale/mx6sxsabreauto/imximage.cfg
 create mode 100644 board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
 create mode 100644 configs/mx6sxsabreauto_defconfig
 create mode 100644 include/configs/mx6sxsabreauto.h

diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
index 8489182..c72a150 100644
--- a/arch/arm/cpu/armv7/mx6/Kconfig
+++ b/arch/arm/cpu/armv7/mx6/Kconfig
@@ -96,6 +96,11 @@ config TARGET_MX6SXSABRESD
select DM
select DM_THERMAL
 
+config TARGET_MX6SXSABREAUTO
+bool "mx6sxsabreauto"
+select DM
+select DM_THERMAL
+
 config TARGET_MX6UL_9X9_EVK
bool "mx6ul_9x9_evk"
select MX6UL
@@ -166,6 +171,7 @@ source "board/freescale/mx6qsabreauto/Kconfig"
 source "board/freescale/mx6sabresd/Kconfig"
 source "board/freescale/mx6slevk/Kconfig"
 source "board/freescale/mx6sxsabresd/Kconfig"
+source "board/freescale/mx6sxsabreauto/Kconfig"
 source "board/freescale/mx6ul_14x14_evk/Kconfig"
 source "board/gateworks/gw_ventana/Kconfig"
 source "board/kosagi/novena/Kconfig"
diff --git a/board/freescale/mx6sxsabreauto/Kconfig 
b/board/freescale/mx6sxsabreauto/Kconfig
new file mode 100644
index 000..ae2ea02
--- /dev/null
+++ b/board/freescale/mx6sxsabreauto/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_MX6SXSABREAUTO
+
+config SYS_BOARD
+   default "mx6sxsabreauto"
+
+config SYS_VENDOR
+   default "freescale"
+
+config SYS_CONFIG_NAME
+   default "mx6sxsabreauto"
+
+endif
diff --git a/board/freescale/mx6sxsabreauto/MAINTAINERS 
b/board/freescale/mx6sxsabreauto/MAINTAINERS
new file mode 100644
index 000..6f2ff44
--- /dev/null
+++ b/board/freescale/mx6sxsabreauto/MAINTAINERS
@@ -0,0 +1,6 @@
+MX6SXSABREAUTO BOARD
+M: Fabio Estevam 
+S: Maintained
+F: board/freescale/mx6sxsabreauto/
+F: include/configs/mx6sxsabreauto.h
+F: configs/mx6sxsabreauto_defconfig
diff --git a/board/freescale/mx6sxsabreauto/Makefile 
b/board/freescale/mx6sxsabreauto/Makefile
new file mode 100644
index 000..f0cd1ce
--- /dev/null
+++ b/board/freescale/mx6sxsabreauto/Makefile
@@ -0,0 +1,6 @@
+# (C) Copyright 2014 Freescale Semiconductor, Inc.
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  := mx6sxsabreauto.o
diff --git a/board/freescale/mx6sxsabreauto/imximage.cfg 
b/board/freescale/mx6sxsabreauto/imximage.cfg
new file mode 100644
index 000..529e555
--- /dev/null
+++ b/board/freescale/mx6sxsabreauto/imximage.cfg
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#define __ASSEMBLY__
+#include 
+
+/* image version */
+
+IMAGE_VERSION 2
+
+/*
+ * Boot Device : one of
+ * spi/sd/nand/onenand, qspi/nor
+ */
+
+BOOT_FROM  sd
+
+/*
+ * Device Configuration Data (DCD)
+ *
+ * Each entry must have the format:
+ * Addr-type   AddressValue
+ *
+ * where:
+ * Addr-type register length (1,2 or 4 bytes)
+ * Address   absolute address of the register
+ * value value to be stored in the register
+ */
+
+/* Enable all clocks */
+DATA 4 0x020c4068 0x
+DATA 4 0x020c406c 0x
+DATA 4 0x020c4070 0x
+DATA 4 0x020c4074 0x
+DATA 4 0x020c4078 0x
+DATA 4 0x020c407c 0x
+DATA 4 0x020c4080 0x
+DATA 4 0x020c4084 0x
+
+/* IOMUX - DDR IO Type */
+DATA 4 0x020e0618 0x000c
+DATA 4 0x020e05fc 0x
+
+/* Clock */
+DATA 4 0x020e032c 0x0030
+
+/* Address */
+DATA 4 0x020e0300 0x0030
+DATA 4 0x020e02fc 0x0030
+DATA 4 0x020e05f4 0x0030
+
+/* Control */
+DATA 4 0x020e0340 0x0030
+
+DATA 4 0x020e0320 0x
+DATA 4 0x020e0310 0x0030
+DATA 4 0x020e0314 0x0030
+DATA 4 0x020e0614 0x0030
+
+/* Data Strobe */
+DATA 4 0x020e05f8 0x0002
+DATA 4 0x020e0330 0x0030
+DATA 4 0x020e0334 0x0030
+DATA 4 0x020e0338 0x0030
+DATA 4 0x020e033c 0x0030
+
+/* Data */
+DATA 4 0x020e0608 0x0002
+DATA 4 0x020e060c 0x0030
+DATA 4 0x020e0610 

[U-Boot] [PATCH v3 1/2] mx6: soc: Add ENET2 mac address support

2016-01-31 Thread Ye Li
The i.MX6SX and i.MX6UL has two ENET controllers, add support for reading
MAC address from fuse for ENET2.

Signed-off-by: Ye Li 
---
Changes for v3:
- Modify dev_id check expression according to Fabio's comment.
Changes for v2:
- Add second MAC address to README.imx6.
- Rename mac_addr_low and mac_addr_high fields to mac_addr0 and 
mac_addr1
  to align with the reigster names in RM.

 arch/arm/cpu/armv7/mx6/soc.c |   32 +
 arch/arm/include/asm/arch-mx6/imx-regs.h |   23 ++--
 doc/README.imx6  |5 +++-
 3 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index bf5ae8c..ebe42b8 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -364,15 +364,29 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
struct fuse_bank4_regs *fuse =
(struct fuse_bank4_regs *)bank->fuse_regs;
 
-   u32 value = readl(>mac_addr_high);
-   mac[0] = (value >> 8);
-   mac[1] = value ;
-
-   value = readl(>mac_addr_low);
-   mac[2] = value >> 24 ;
-   mac[3] = value >> 16 ;
-   mac[4] = value >> 8 ;
-   mac[5] = value ;
+   if ((is_cpu_type(MXC_CPU_MX6SX) || is_cpu_type(MXC_CPU_MX6UL)) && 
+   dev_id == 1) {
+   u32 value = readl(>mac_addr2);
+   mac[0] = value >> 24 ;
+   mac[1] = value >> 16 ;
+   mac[2] = value >> 8 ;
+   mac[3] = value ;
+
+   value = readl(>mac_addr1);
+   mac[4] = value >> 24 ;
+   mac[5] = value >> 16 ;
+   
+   } else {
+   u32 value = readl(>mac_addr1);
+   mac[0] = (value >> 8);
+   mac[1] = value ;
+
+   value = readl(>mac_addr0);
+   mac[2] = value >> 24 ;
+   mac[3] = value >> 16 ;
+   mac[4] = value >> 8 ;
+   mac[5] = value ;
+   }
 
 }
 #endif
diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h 
b/arch/arm/include/asm/arch-mx6/imx-regs.h
index f24525e..5c45bf6 100644
--- a/arch/arm/include/asm/arch-mx6/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
@@ -715,39 +715,22 @@ struct fuse_bank1_regs {
u32 rsvd7[3];
 };
 
-#if (defined(CONFIG_MX6SX) || defined(CONFIG_MX6UL))
 struct fuse_bank4_regs {
u32 sjc_resp_low;
u32 rsvd0[3];
u32 sjc_resp_high;
u32 rsvd1[3];
-   u32 mac_addr_low;
+   u32 mac_addr0;
u32 rsvd2[3];
-   u32 mac_addr_high;
+   u32 mac_addr1;
u32 rsvd3[3];
-   u32 mac_addr2;
+   u32 mac_addr2; /*For i.MX6SX and i.MX6UL*/
u32 rsvd4[7];
u32 gp1;
u32 rsvd5[3];
u32 gp2;
u32 rsvd6[3];
 };
-#else
-struct fuse_bank4_regs {
-   u32 sjc_resp_low;
-   u32 rsvd0[3];
-   u32 sjc_resp_high;
-   u32 rsvd1[3];
-   u32 mac_addr_low;
-   u32 rsvd2[3];
-   u32 mac_addr_high;
-   u32 rsvd3[0xb];
-   u32 gp1;
-   u32 rsvd4[3];
-   u32 gp2;
-   u32 rsvd5[3];
-};
-#endif
 
 struct aipstz_regs {
u32 mprot0;
diff --git a/doc/README.imx6 b/doc/README.imx6
index e26ab71..7c9a4ac 100644
--- a/doc/README.imx6
+++ b/doc/README.imx6
@@ -7,7 +7,10 @@ SoC.
 ---
 
 1.1 MAC Address: It is stored in fuse bank 4, with the 32 lsbs in word 2 and 
the
-16 msbs in word 3.
+16 msbs in word 3[15:0].
+For i.MX6SX and i.MX6UL, they have two MAC addresses. The second MAC 
address
+is stored in fuse bank 4, with the 16 lsb in word 3[31:16] and the 32 msbs 
in 
+word 4.
 
 Example:
 
-- 
1.7.4.1

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


[U-Boot] [PATCH v3 1/7] tegra: Clarify generation of -nodtb file with OF_CONTROL

2016-01-31 Thread Simon Glass
Fix the ALL-y logic in the Makefile so that is clear that we always want
the -nodtb file.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Fix build error when CONFIG_OF_EMBED is used
- Drop unnecessary ifdef around Makefile rule

Changes in v2:
- Rewrite this commit based on tegra feedback

 Makefile | 16 +---
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index 06996d4..dbb914a 100644
--- a/Makefile
+++ b/Makefile
@@ -764,14 +764,9 @@ ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
 endif
 
 # enable combined SPL/u-boot/dtb rules for tegra
-ifneq ($(CONFIG_TEGRA),)
-ifeq ($(CONFIG_SPL),y)
-ifeq ($(CONFIG_OF_SEPARATE),y)
-ALL-y += u-boot-dtb-tegra.bin
-else
+ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
 ALL-y += u-boot-nodtb-tegra.bin
-endif
-endif
+ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin
 endif
 
 # Add optional build target if defined in board/cpu/soc headers
@@ -1077,10 +1072,9 @@ OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary 
--pad-to=$(CONFIG_SYS_TEXT_BASE)
 u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
$(call if_changed,pad_cat)
 
-ifeq ($(CONFIG_OF_SEPARATE),y)
-u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE
-   $(call if_changed,cat)
-endif
+OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
+u-boot-dtb-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
+   $(call if_changed,pad_cat)
 endif
 
 OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v3 0/7] fdt: Replace u-boot-dtb.bin with u-boot.bin

2016-01-31 Thread Simon Glass
At present u-boot.bin holds the plain U-Boot binary without the device tree.
This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin
depending on whether device tree is used.

This series adjusts the build such that u-boot.bin includes a device tree if
enabled, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin
remains the same.

This should be acceptable since:

- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change

The main impact is to build systems which are set up to use u-boot.bin as
the output file and then add a device tree. These will have to change to use
u-boot-nodtb.bin instead.

The original decision to use a separate u-boot-dtb.bin was aimed at allowing
any device tree file to be concatenated to the u-boot.bin image after the
build. However this no-longer seems so important. More important is the
convenience of using the same output file regardless of the setting for
OF_CONTROL.

Changes in v3:
- Fix build error when CONFIG_OF_EMBED is used
- Drop unnecessary ifdef around Makefile rule
- Adjust rules based on Masahiro's expert comments
- Use cmd_copy instead of cmd_cat
- Drop an unnecessary rule
- Update commit message to say OF_SEPARATE instead of OF_CONTROL
- Rewrite the commit message for clarity

Changes in v2:
- Rewrite this commit based on tegra feedback
- Update based on previous changes
- Fix the update_filename in MCV
- Tweak the tegra rule slightly

Simon Glass (7):
  tegra: Clarify generation of -nodtb file with OF_CONTROL
  fdt: Build a U-Boot binary without device tree
  fdt: Build an SPL binary without device tree
  tegra: Always build a boot image with the same filename
  socfpga: Simplify Makefile filenames
  Makefile: Make u-boot.img the same as u-boot-dtb.img
  Makefile: Drop unnecessary -dtb suffixes

 Makefile | 89 +++-
 include/configs/socfpga_mcvevk.h |  2 +-
 scripts/Makefile.spl | 31 --
 3 files changed, 63 insertions(+), 59 deletions(-)

-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v3 4/7] tegra: Always build a boot image with the same filename

2016-01-31 Thread Simon Glass
Adjust the Makefile to build u-boot-tegra.bin which contains a device tree
if OF_SEPARATE is enabled, and does not if not. This mirrors U-Boot's new
approach of using u-boot.bin to handle both cases.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Update commit message to say OF_SEPARATE instead of OF_CONTROL

Changes in v2:
- Update based on previous changes

 Makefile | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 67824ac..74c13f0 100644
--- a/Makefile
+++ b/Makefile
@@ -765,7 +765,7 @@ endif
 
 # enable combined SPL/u-boot/dtb rules for tegra
 ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
-ALL-y += u-boot-nodtb-tegra.bin
+ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin
 ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin
 endif
 
@@ -1080,9 +1080,12 @@ OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary 
--pad-to=$(CONFIG_SYS_TEXT_BASE)
 u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE
$(call if_changed,pad_cat)
 
-OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
-u-boot-dtb-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
+OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
+u-boot-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
$(call if_changed,pad_cat)
+
+u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE
+   $(call if_changed,copy)
 endif
 
 OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v3 2/7] fdt: Build a U-Boot binary without device tree

2016-01-31 Thread Simon Glass
At present u-boot.bin holds the plain U-Boot binary without the device tree.
This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin
depending on whether device tree is used.

Adjust the build such that u-boot.bin includes a device tree (if enabled),
and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains
the same.

This should be acceptable since:

- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change

The main impact is build systems which are set up to use u-boot.bin as
the output file and then add a device tree. These will have to change to use
u-boot-nodtb.bin instead.

Adjust tegra rules so it continues to produce the correct files.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Adjust rules based on Masahiro's expert comments

Changes in v2: None

 Makefile | 32 
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index dbb914a..67824ac 100644
--- a/Makefile
+++ b/Makefile
@@ -747,7 +747,7 @@ endif
 ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin
 ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img
 ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
-ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb u-boot-dtb.bin
+ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb
 ifeq ($(CONFIG_SPL_FRAMEWORK),y)
 ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb.img
 endif
@@ -823,15 +823,23 @@ PHONY += dtbs
 dtbs dts/dt.dtb: checkdtc u-boot
$(Q)$(MAKE) $(build)=dts dtbs
 
-u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE
+quiet_cmd_copy = COPY$@
+  cmd_copy = cp $< $@
+
+ifeq ($(CONFIG_OF_SEPARATE),y)
+u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE
$(call if_changed,cat)
 
+u-boot.bin: u-boot-dtb.bin FORCE
+   $(call if_changed,copy)
+else
+u-boot.bin: u-boot-nodtb.bin FORCE
+   $(call if_changed,copy)
+endif
+
 %.imx: %.bin
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
 
-quiet_cmd_copy = COPY$@
-  cmd_copy = cp $< $@
-
 u-boot.dtb: dts/dt.dtb
$(call cmd,copy)
 
@@ -842,11 +850,11 @@ OBJCOPYFLAGS_u-boot.srec := -O srec
 u-boot.hex u-boot.srec: u-boot FORCE
$(call if_changed,objcopy)
 
-OBJCOPYFLAGS_u-boot.bin := -O binary \
+OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \
$(if $(CONFIG_X86_RESET_VECTOR),-R .start16 -R .resetvec)
 
-binary_size_check: u-boot.bin FORCE
-   @file_size=$(shell wc -c u-boot.bin | awk '{print $$1}') ; \
+binary_size_check: u-boot-nodtb.bin FORCE
+   @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \
map_size=$(shell cat u-boot.map | \
awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end 
= $$1} END {if (start != "" && end != "") print "ibase=16; " toupper(end) " - " 
toupper(start)}' \
| sed 's/0X//g' \
@@ -854,12 +862,12 @@ binary_size_check: u-boot.bin FORCE
if [ "" != "$$map_size" ]; then \
if test $$map_size -ne $$file_size; then \
echo "u-boot.map shows a binary size of $$map_size" >&2 
; \
-   echo "  but u-boot.bin shows $$file_size" >&2 ; \
+   echo "  but u-boot-nodtb.bin shows $$file_size" >&2 ; \
exit 1; \
fi \
fi
 
-u-boot.bin: u-boot FORCE
+u-boot-nodtb.bin: u-boot FORCE
$(call if_changed,objcopy)
$(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE))
$(BOARD_SIZE_CHECK)
@@ -1018,7 +1026,7 @@ rom: u-boot.rom FORCE
 IFDTOOL=$(objtree)/tools/ifdtool
 IFDTOOL_FLAGS  = -f 0:$(objtree)/u-boot.dtb
 IFDTOOL_FLAGS += -m 0x$(shell $(NM) u-boot |grep _dt_ucode_base_size |cut -d' 
' -f1)
-IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot.bin
+IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-nodtb.bin
 IFDTOOL_FLAGS += -w $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin
 IFDTOOL_FLAGS += -C
 
@@ -1069,7 +1077,7 @@ endif
 
 ifneq ($(CONFIG_TEGRA),)
 OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary 
--pad-to=$(CONFIG_SYS_TEXT_BASE)
-u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
+u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE
$(call if_changed,pad_cat)
 
 OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v3 3/7] fdt: Build an SPL binary without device tree

2016-01-31 Thread Simon Glass
At present u-boot-spl.bin holds the plain SPL binary without the device
tree. This is somewhat annoying since you need either u-boot-spl.bin or
u-boot-spl-dtb.bin depending on whether device tree is used.

Adjust the build such that u-boot-spl.bin includes a device tree
(if enabled), and the plain binary is in u-boot-spl-nodtb.bin. For now
u-boot-spl-dtb.bin remains the same.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Use cmd_copy instead of cmd_cat
- Drop an unnecessary rule

Changes in v2: None

 scripts/Makefile.spl | 25 -
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index dff16b9..bc6a330 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -131,16 +131,12 @@ boot.bin: $(obj)/u-boot-spl.bin
 else
 MKIMAGEFLAGS_boot.bin = -T zynqimage
 
-spl/boot.bin: $(obj)/u-boot-spl-dtb.bin
+spl/boot.bin: $(obj)/u-boot-spl.bin
$(call if_changed,mkimage)
 endif
 
 ALL-y  += $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).cfg
 
-ifdef CONFIG_SPL_OF_CONTROL
-ALL-$(CONFIG_OF_SEPARATE) += $(obj)/$(SPL_BIN)-pad.bin 
$(obj)/$(SPL_BIN)-dtb.bin
-endif
-
 ifdef CONFIG_SAMSUNG
 ALL-y  += $(obj)/$(BOARD)-spl.bin
 endif
@@ -166,11 +162,22 @@ all:  $(ALL-y)
 quiet_cmd_cat = CAT $@
 cmd_cat = cat $(filter-out $(PHONY), $^) > $@
 
-$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN)-pad.bin \
+quiet_cmd_copy = COPY$@
+  cmd_copy = cp $< $@
+
+ifeq ($(CONFIG_SPL_OF_CONTROL),y)
+$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin 
$(obj)/$(SPL_BIN)-pad.bin \
$(obj)/$(SPL_BIN).dtb FORCE
$(call if_changed,cat)
 
-# Create a file that pads from the end of u-boot-spl.bin to bss_end
+$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
+   $(call if_changed,copy)
+else
+$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE
+   $(call if_changed,copy)
+endif
+
+# Create a file that pads from the end of u-boot-spl-nodtb.bin to bss_end
 $(obj)/$(SPL_BIN)-pad.bin: $(obj)/$(SPL_BIN)
@bss_size_str=$(shell $(NM) $< | awk 'BEGIN {size = 0} /__bss_size/ 
{size = $$1} END {print "ibase=16; " toupper(size)}' | bc); \
dd if=/dev/zero of=$@ bs=1 count=$${bss_size_str} 2>/dev/null;
@@ -211,9 +218,9 @@ endif
 quiet_cmd_objcopy = OBJCOPY $@
 cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
 
-OBJCOPYFLAGS_$(SPL_BIN).bin = $(SPL_OBJCFLAGS) -O binary
+OBJCOPYFLAGS_$(SPL_BIN)-nodtb.bin = $(SPL_OBJCFLAGS) -O binary
 
-$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN) FORCE
+$(obj)/$(SPL_BIN)-nodtb.bin: $(obj)/$(SPL_BIN) FORCE
$(call if_changed,objcopy)
 
 LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL)
-- 
2.7.0.rc3.207.g0ac5344

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


Re: [U-Boot] [PATCH 00/14] EFI payload / application support v2

2016-01-31 Thread Simon Glass
Hi Alexander,

On 31 January 2016 at 14:43, Alexander Graf  wrote:
>
>
> On 01/31/2016 04:17 PM, Simon Glass wrote:
>>
>> Hi Alexander,
>>
>> On 14 January 2016 at 22:06, Alexander Graf  wrote:
>>>
>>> This is my Christmas present for my openSUSE friends :).
>>>
>>> U-Boot is a great project for embedded devices. However, convincing
>>> everyone involved that only for "a few oddball ARM devices" we need to
>>> support different configuration formats from grub2 when all other
>>> platforms
>>> (PPC, System Z, x86) are standardized on a single format is a nightmare.
>>
>> Well some might argue that grub2 and UEFI are their own nightmares :-)
>
>
> They are, but they are the same nightmare everyone else is dreaming ;).
>
>
>>
>>> So we started to explore alternatives. At first, people tried to get
>>> grub2 running using the u-boot api interface. However, FWIW that one
>>> doesn't support relocations, so you need to know where to link grub2 to
>>> at compile time. It also seems to be broken more often than not. And on
>>> top of it all, it's a one-off interface, so yet another thing to
>>> maintain.
>>
>> The API interface is mostly for closed-source work I think.
>>
>>> That led to a nifty idea. What if we can just implement the EFI
>>> application
>>> protocol on top of U-Boot? Then we could compile a single grub2 binary
>>> for
>>> uEFI based systems and U-Boot based systems and as soon as that one's
>>> loaded,
>>> everything looks and feels (almost) the same.
>>>
>>> This patch set is the result of pursuing this endeavor.
>>>
>>>- I am successfully able to run grub2 and Linux EFI binaries with this
>>> code.
>>>- When enabled, the resulting U-Boot binary only grows by ~10kb,
>>>  so it's very light weight.
>>>- It works on 32bit ARM and AArch64.
>>>- All storage devices are directly accessible
>>>- No EFI variables
>>>- Removable media booting (search for /efi/boot/boota{a64,arm}.efi)
>>>
>>> Of course, there are still a few things one could do on top:
>>>
>>>- Improve disk media detection (don't scan, use what information we
>>> have)
>>>- Add EFI variable support using NVRAM
>>>- Add GFX support
>>>- Make EFI Shell work ;)
>>>- Network device support
>>>- Support for payload exit
>>>
>>> But so far, I'm very happy with the state of the patches. They completely
>>> eliminate potential arguments against U-Boot internally and give users
>>> the
>>> chance to run with the same level of comfort on all firmware types.
>>
>> I'd suggest creating a README with the above info. The cover letter
>> will vanish pretty fast. Perhaps also update README.efi with this new
>> option.
>
>
> Good idea.
>
>>
>> Another thing you could list is efi_set_watchdog_timer().
>
>
> What about it exactly? That it's not supported atm?

Yes.

>
>>
>>> Version 2 was successfully tested to boot grub2 and Linux from there on a
>>> HiKey (AArch64, dcache disabled) and on a BeagleBone Black.
>>
>> Do you have a UEFI image for BBB that I can put on an SD card or otherwise
>> boot?
>
>
> Phew, I hand-crafted one to play around with. You can use the hip04d01 image
> from
>
> http://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/HIP04D01/images/openSUSE-Tumbleweed-ARM-JeOS-hip04d01.armv7l.install.tar.xz
>
> Just extract the tar.xz, to get to the actual image .xz file.
>
> That image obviously has an incorrect kernel for the BBB, but everything up
> to grub2 should work with it.

I'm not sure what file to use. I found a file with a .12.1 extension
which I tried to dd to a uSD card but it did not boot.

Do you have an ARM grub binary (in EFI format)? II could test with
just that piece.  tried building grub but it says cross-compiling
isn't recommended, and I got an error about a missing
../include/grub/machine/kernel.h.

>
> My plan was to slowly move all openSUSE arm targets that use our own u-boot
> binaries to EFI once this patch set goes in ;).

BTW out of interest how come SUSE doesn't use the same distro boot
thing as other distributions?

>
>> For now I've had a play with Minnowboard, which is x86. The main thing
>> I noticed is that the API function implements should have EFIAPI on
>> them also.
>
>
> Yes :). I didn't expect anyone to actually care about running this on x86
> which is the only architecture that has different calling conventions for
> EFI. I'm very pleasantly surprised that you are interested and since you
> already have a patch to add them, I guess you can as well just post that
> once the base support is in :).

OK. I suppose because EFIAPI is empty on ARM it doesn't matter. But
strictly speaking the declaration should match the implementation.

U-Boot mostly uses FIT which provides secure boot and it can boot both
32- and 64-bit kernels directly. But there is still the odd setup.bin
thing Linux uses.

Perhaps my main interest is fiddling with UEFI without having to use
its code base. :-)

>
>>   I'll make a few other 

[U-Boot] [PATCH v3 7/7] Makefile: Drop unnecessary -dtb suffixes

2016-01-31 Thread Simon Glass
When OF_CONTROL is enabled, u-boot-dtb.* files are the same as u-boot.*
files. So we can use the latter for simplicity.

Signed-off-by: Simon Glass 
---

Changes in v3: None
Changes in v2:
- Tweak the tegra rule slightly

 Makefile | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 6ddfd20..4ae6058 100644
--- a/Makefile
+++ b/Makefile
@@ -915,7 +915,7 @@ MKIMAGEFLAGS_u-boot.pbl = -n 
$(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
 u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
$(call if_changed,mkimage)
 
-u-boot-spl.kwb: u-boot-dtb.img spl/u-boot-spl.bin FORCE
+u-boot-spl.kwb: u-boot.img spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
 
 u-boot.sha1:   u-boot.bin
@@ -1056,7 +1056,7 @@ endif
 cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_FLAGS) u-boot.tmp;
 cmd_ifdtool += mv u-boot.tmp $@
 
-u-boot.rom: u-boot-x86-16bit.bin u-boot-dtb.bin
+u-boot.rom: u-boot-x86-16bit.bin u-boot.bin
$(call if_changed,ifdtool)
 
 OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
@@ -1067,8 +1067,7 @@ endif
 ifneq ($(CONFIG_SUNXI),)
 OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
   --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin \
-   u-boot$(if $(CONFIG_OF_CONTROL),-dtb,).img FORCE
+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE
$(call if_changed,pad_cat)
 endif
 
@@ -1078,7 +1077,7 @@ u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin 
FORCE
$(call if_changed,pad_cat)
 
 OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
-u-boot-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
+u-boot-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
$(call if_changed,pad_cat)
 
 u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE
@@ -1089,7 +1088,7 @@ OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
 u-boot-app.efi: u-boot FORCE
$(call if_changed,zobjcopy)
 
-u-boot-dtb.bin.o: u-boot-dtb.bin FORCE
+u-boot.bin.o: u-boot.bin FORCE
$(call if_changed,efipayload)
 
 u-boot-payload.lds: $(LDSCRIPT_EFI) FORCE
@@ -1099,10 +1098,10 @@ u-boot-payload.lds: $(LDSCRIPT_EFI) FORCE
 quiet_cmd_u-boot_payload ?= LD  $@
   cmd_u-boot_payload ?= $(LD) $(LDFLAGS_EFI_PAYLOAD) -o $@ \
   -T u-boot-payload.lds arch/x86/cpu/call32.o \
-  lib/efi/efi.o lib/efi/efi_stub.o u-boot-dtb.bin.o \
+  lib/efi/efi.o lib/efi/efi_stub.o u-boot.bin.o \
   $(addprefix arch/$(ARCH)/lib/efi/,$(EFISTUB))
 
-u-boot-payload: u-boot-dtb.bin.o u-boot-payload.lds FORCE
+u-boot-payload: u-boot.bin.o u-boot-payload.lds FORCE
$(call if_changed,u-boot_payload)
 
 OBJCOPYFLAGS_u-boot-payload.efi := $(OBJCOPYFLAGS_EFI)
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v3 6/7] Makefile: Make u-boot.img the same as u-boot-dtb.img

2016-01-31 Thread Simon Glass
Create u-boot.img even when OF_CONTROL is enabled, so that this file can be
used in both cases.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Rewrite the commit message for clarity

Changes in v2: None

 Makefile | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index b4e75a5..6ddfd20 100644
--- a/Makefile
+++ b/Makefile
@@ -901,6 +901,8 @@ MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O 
u-boot \
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
 
+MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
+
 MKIMAGEFLAGS_u-boot.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
-T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
 
@@ -910,17 +912,12 @@ MKIMAGEFLAGS_u-boot-spl.kwb = -n 
$(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
 MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
-R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage
 
-u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
+u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
$(call if_changed,mkimage)
 
 u-boot-spl.kwb: u-boot-dtb.img spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
 
-MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
-
-u-boot-dtb.img: u-boot-dtb.bin FORCE
-   $(call if_changed,mkimage)
-
 u-boot.sha1:   u-boot.bin
tools/ubsha1 u-boot.bin
 
@@ -1126,11 +1123,7 @@ spl/u-boot-spl.pbl: spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
 
 ifeq ($(ARCH),arm)
-ifdef CONFIG_OF_CONTROL
-UBOOT_BINLOAD := u-boot-dtb.img
-else
 UBOOT_BINLOAD := u-boot.img
-endif
 else
 UBOOT_BINLOAD := u-boot.bin
 endif
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH v3 5/7] socfpga: Simplify Makefile filenames

2016-01-31 Thread Simon Glass
We don't need the -dtb suffix anymore, so drop it.

Signed-off-by: Simon Glass 
---

Changes in v3: None
Changes in v2:
- Fix the update_filename in MCV

 Makefile | 10 +-
 include/configs/socfpga_mcvevk.h |  2 +-
 scripts/Makefile.spl |  6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 74c13f0..b4e75a5 100644
--- a/Makefile
+++ b/Makefile
@@ -1010,10 +1010,10 @@ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
 
 ifneq ($(CONFIG_ARCH_SOCFPGA),)
 quiet_cmd_socboot = SOCBOOT $@
-cmd_socboot = cat  spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp   \
-   spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp   \
-   u-boot-dtb.img > $@ || rm -f $@
-u-boot-with-spl-dtb.sfp: spl/u-boot-spl-dtb.sfp u-boot-dtb.img FORCE
+cmd_socboot = cat  spl/u-boot-spl.sfp spl/u-boot-spl.sfp   \
+   spl/u-boot-spl.sfp spl/u-boot-spl.sfp   \
+   u-boot.img > $@ || rm -f $@
+u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE
$(call if_changed,socboot)
 endif
 
@@ -1322,7 +1322,7 @@ spl/u-boot-spl: tools prepare $(if 
$(CONFIG_OF_SEPARATE),dts/dt.dtb)
 spl/sunxi-spl.bin: spl/u-boot-spl
@:
 
-spl/u-boot-spl-dtb.sfp: spl/u-boot-spl
+spl/u-boot-spl.sfp: spl/u-boot-spl
@:
 
 spl/boot.bin: spl/u-boot-spl
diff --git a/include/configs/socfpga_mcvevk.h b/include/configs/socfpga_mcvevk.h
index e7b5675..f260a64 100644
--- a/include/configs/socfpga_mcvevk.h
+++ b/include/configs/socfpga_mcvevk.h
@@ -56,7 +56,7 @@
"netdev=eth0\0" \
"hostname=mcvevk\0" \
"kernel_addr_r=0x1000\0"\
-   "update_filename=u-boot-with-spl-dtb.sfp\0" \
+   "update_filename=u-boot-with-spl.sfp\0" \
"update_sd_offset=0x800\0"  \
"update_sd="/* Update the SD firmware partition */  \
"if mmc rescan ; then " \
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index bc6a330..f486feb 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -142,7 +142,7 @@ ALL-y   += $(obj)/$(BOARD)-spl.bin
 endif
 
 ifdef CONFIG_ARCH_SOCFPGA
-ALL-y  += $(obj)/$(SPL_BIN)-dtb.sfp
+ALL-y  += $(obj)/$(SPL_BIN).sfp
 endif
 
 ifdef CONFIG_SUNXI
@@ -229,8 +229,8 @@ LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
 endif
 
 ifdef CONFIG_ARCH_SOCFPGA
-MKIMAGEFLAGS_$(SPL_BIN)-dtb.sfp = -T socfpgaimage
-$(obj)/$(SPL_BIN)-dtb.sfp: $(obj)/$(SPL_BIN)-dtb.bin FORCE
+MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage
+$(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE
$(call if_changed,mkimage)
 endif
 
-- 
2.7.0.rc3.207.g0ac5344

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


Re: [U-Boot] [PATCH 00/14] EFI payload / application support v2

2016-01-31 Thread Simon Glass
Hi Alexander,

On 31 January 2016 at 19:52, Simon Glass  wrote:
> Hi Alexander,
>
> On 31 January 2016 at 14:43, Alexander Graf  wrote:
>>
>>
>> On 01/31/2016 04:17 PM, Simon Glass wrote:
>>>
>>> Hi Alexander,
>>>
>>> On 14 January 2016 at 22:06, Alexander Graf  wrote:

 This is my Christmas present for my openSUSE friends :).

 U-Boot is a great project for embedded devices. However, convincing
 everyone involved that only for "a few oddball ARM devices" we need to
 support different configuration formats from grub2 when all other
 platforms
 (PPC, System Z, x86) are standardized on a single format is a nightmare.
>>>
>>> Well some might argue that grub2 and UEFI are their own nightmares :-)
>>
>>
>> They are, but they are the same nightmare everyone else is dreaming ;).
>>
>>
>>>
 So we started to explore alternatives. At first, people tried to get
 grub2 running using the u-boot api interface. However, FWIW that one
 doesn't support relocations, so you need to know where to link grub2 to
 at compile time. It also seems to be broken more often than not. And on
 top of it all, it's a one-off interface, so yet another thing to
 maintain.
>>>
>>> The API interface is mostly for closed-source work I think.
>>>
 That led to a nifty idea. What if we can just implement the EFI
 application
 protocol on top of U-Boot? Then we could compile a single grub2 binary
 for
 uEFI based systems and U-Boot based systems and as soon as that one's
 loaded,
 everything looks and feels (almost) the same.

 This patch set is the result of pursuing this endeavor.

- I am successfully able to run grub2 and Linux EFI binaries with this
 code.
- When enabled, the resulting U-Boot binary only grows by ~10kb,
  so it's very light weight.
- It works on 32bit ARM and AArch64.
- All storage devices are directly accessible
- No EFI variables
- Removable media booting (search for /efi/boot/boota{a64,arm}.efi)

 Of course, there are still a few things one could do on top:

- Improve disk media detection (don't scan, use what information we
 have)
- Add EFI variable support using NVRAM
- Add GFX support
- Make EFI Shell work ;)
- Network device support
- Support for payload exit

 But so far, I'm very happy with the state of the patches. They completely
 eliminate potential arguments against U-Boot internally and give users
 the
 chance to run with the same level of comfort on all firmware types.
>>>
>>> I'd suggest creating a README with the above info. The cover letter
>>> will vanish pretty fast. Perhaps also update README.efi with this new
>>> option.
>>
>>
>> Good idea.
>>
>>>
>>> Another thing you could list is efi_set_watchdog_timer().
>>
>>
>> What about it exactly? That it's not supported atm?
>
> Yes.
>
>>
>>>
 Version 2 was successfully tested to boot grub2 and Linux from there on a
 HiKey (AArch64, dcache disabled) and on a BeagleBone Black.
>>>
>>> Do you have a UEFI image for BBB that I can put on an SD card or otherwise
>>> boot?
>>
>>
>> Phew, I hand-crafted one to play around with. You can use the hip04d01 image
>> from
>>
>> http://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/HIP04D01/images/openSUSE-Tumbleweed-ARM-JeOS-hip04d01.armv7l.install.tar.xz
>>
>> Just extract the tar.xz, to get to the actual image .xz file.
>>
>> That image obviously has an incorrect kernel for the BBB, but everything up
>> to grub2 should work with it.
>
> I'm not sure what file to use. I found a file with a .12.1 extension
> which I tried to dd to a uSD card but it did not boot.
>
> Do you have an ARM grub binary (in EFI format)? II could test with
> just that piece.  tried building grub but it says cross-compiling
> isn't recommended, and I got an error about a missing
> ../include/grub/machine/kernel.h.

Sorry, scratch that. I moved it to a different directory which must
have made the build system unhappy. I re-ran autogen.sh and it worked.

>
>>
>> My plan was to slowly move all openSUSE arm targets that use our own u-boot
>> binaries to EFI once this patch set goes in ;).
>
> BTW out of interest how come SUSE doesn't use the same distro boot
> thing as other distributions?
>
>>
>>> For now I've had a play with Minnowboard, which is x86. The main thing
>>> I noticed is that the API function implements should have EFIAPI on
>>> them also.
>>
>>
>> Yes :). I didn't expect anyone to actually care about running this on x86
>> which is the only architecture that has different calling conventions for
>> EFI. I'm very pleasantly surprised that you are interested and since you
>> already have a patch to add them, I guess you can as well just post that
>> once the base support is in :).
>
> OK. I suppose because EFIAPI is empty on ARM it 

[U-Boot] [PATCH V2] fdt: introduce fdtdec_get_child_count

2016-01-31 Thread Peng Fan
Introduce fdtdec_get_child_count for get the number of subnodes
of one parent node.

Signed-off-by: Peng Fan 
Cc: Simon Glass 
---

V2:
 correct spell error.
 renamed to fdtdec_get_child_count, move code to lib/fdtdec.c and add
 prototype in include/fdtdec.h

 include/fdtdec.h |  9 +
 lib/fdtdec.c | 11 +++
 2 files changed, 20 insertions(+)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index dd82916..d1c29a8 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -722,6 +722,15 @@ const u32 *fdtdec_locate_array(const void *blob, int node,
  */
 int fdtdec_get_bool(const void *blob, int node, const char *prop_name);
 
+/*
+ * Count child nodes of one parent node.
+ *
+ * @param blob FDT blob
+ * @param node parent node
+ * @return number of child node; 0 if there is not child node
+ */
+int fdtdec_get_child_count(const void *blob, int node);
+
 /**
  * Look in the FDT for a config item with the given name and return its value
  * as a 32-bit integer. The property must have at least 4 bytes of data. The
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 0eb56af..1b1ca02 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -831,6 +831,17 @@ int fdtdec_parse_phandle_with_args(const void *blob, int 
src_node,
return rc;
 }
 
+int fdtdec_get_child_count(const void *blob, int node)
+{
+   int subnode;
+   int num = 0;
+
+   fdt_for_each_subnode(blob, subnode, node)
+   num++;
+
+   return num;
+}
+
 int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name,
u8 *array, int count)
 {
-- 
2.6.2

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


Re: [U-Boot] [PATCH] fdt: introudce fdt_get_child_count

2016-01-31 Thread Fabio Estevam
On Sun, Jan 31, 2016 at 4:38 AM, Peng Fan  wrote:
> Introudce fdt_get_child_count for get the number of subnodes of

s/Introudce/Introduce

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


Re: [U-Boot] Include patchwork patch ID in commit message?

2016-01-31 Thread Albert ARIBAUD
Hello Masahiro,

On Fri, 29 Jan 2016 18:57:28 +0900, Masahiro Yamada
 wrote:
> 2016-01-29 14:14 GMT+09:00 Heiko Schocher :
> > Hello Joe,
> >
> >
> > Am 28.01.2016 um 16:15 schrieb Joe Hershberger:
> >>
> >> Hi Heiko,
> >>
> >> On Thu, Jan 28, 2016 at 12:39 AM, Heiko Schocher  wrote:
> >>>
> >>> Hello Tom,
> >>>
> >>> Am 28.01.2016 um 00:45 schrieb Tom Rini:
> 
> 
>  On Wed, Jan 27, 2016 at 05:15:17PM -0600, Joe Hershberger wrote:
> >
> >
> > On Wed, Jan 27, 2016 at 4:22 PM, Tom Rini  wrote:
> >>
> >>
> >> On Wed, Jan 27, 2016 at 03:08:09PM -0600, Joe Hershberger wrote:
> >>>
> >>>
> >>> Hi Tom,
> >>>
> >>> I'm playing with the idea of including the patchwork patch ID in the
> >>> commit message of each commit that I apply to provide better
> >>> cross-reference ability.
> >>>
> >>> * Access to comments on patches
> >>> * Clarity on exactly which version of a patch was applied
> >>> * No need to search by patch subject
> >>>
> >>> Here is an example in a working branch:
> >>>
> >>>
> >>>
> >>> http://git.denx.de/?p=u-boot/u-boot-net.git;a=commit;h=48f9a0c786d0a3cbfdf45846567deaebe27a334a
> >>
> >>
> >>
> >> I'd prfer Patchwork or Patchwork-ID or something not just Patch.
> >
> >
> >
> > Would it be more or less compelling if it had a format similar this?
> >
> > Patchwork: https://patchwork.ozlabs.org/patch/571773/
> 
> 
> 
>  Yes.
> >>>
> >>>
> >>>
> >>> Sorry, for dummy question ... what should I see in the above link?
> >>
> >>
> >> The link is the think to see, not what it points to. The idea is that
> >> instead of just the patch number, include the patch number in a full
> >> URL for even easier access to the patch.
> >
> >
> > Uh, ah, got it ... I think the patchworks patchnumber would be enough.
> > I like Bins proposal, that patchwork add it automatically ...
> 
> 
> 
> X-Patchwork-Id: 561384
> 
> I assume this tag points to the last version which was actually
> applied to the git tree.

It points to the message in Patchwork -- patchwork does not apply
patches on any tree; in fact, patchwork is totally unrelated to git.

> If you want to know the whole history of each patch,
> you should see former versions as well as the last one.
> 
> The last version is often mature,
> so it may end up with just having "Applied to u-boot/master, thanks!",
> which does not carry useful information at all.

The last message in the thread started by the patch will have this. But
that last message will be unknown by patchwork, which only records
patches [apart from rare false positive cases where PW thinks a message
is a patch, because there is git diff extract pasted into it].

> Nor do I want to see something as follows.
> X-Pachwork-Id-v1: 561184
> X-Pachwork-Id-v2: 561284
> X-Pachwork-Id-v3: 561384

AFAICT, patchwork is not able tell which patch is the vN-1 of a given vN
patch, and probably never will, as there is in fact no reliable way to
reconstruct this. A vN patch does not necessarily have the same subject
line as its vN-1, and does not necessarily have its vN-1's message-Id
listed in its 'Reference:' header.

So you would never see the above anyway.

What I have personally set up recently is a Python script which
goes through my Claws Mail U-Boot mail directory and, for each mail,
queries Patchwork with the Message-ID and, failing that, with each
Reference in turn, and adds X-Patchwork-{id,delegate,state...} to the
mail. There is some ad hoc logic for things like cover letters, and of
course, a caching mechanism so that I query PW only once per message-ID
-- so for a long thread about a single patch, there will be a single
actual query.

Oh, and it adds both an X-Patchwork-Id and an W-Patchwork-URL. :)

I run this regularly on my U-Boot inbox.

(if anyone knows how to query patchwork for "details for every patch
which has changed since the date I last asked", let me know.)

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


Re: [U-Boot] [PATCH v2 1/7] tegra: Clarify generation of -nodtb file with OF_CONTROL

2016-01-31 Thread Masahiro Yamada
Hi Simon,



2016-01-29 12:24 GMT+09:00 Simon Glass :
> Fix the ALL-y logic in the Makefile so that is clear that we always want
> the -nodtb file.
>
> Signed-off-by: Simon Glass 
> ---



This commit introduces a build error
for the combination of CONFIG_TEGRA=y and CONFIG_EMBED=y.
(and fixed by 4/7)


$ make beaver_defconfig
$ make menuconfig   [ --> choose  CONFIG_OF_EMBED]
$ make CROSS_COMPILE=arm-linux-gnueabi-
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK include/config.h
 [ snip ]
  CAT u-boot-nodtb-tegra.bin
make: *** No rule to make target `u-boot-dtb-tegra.bin', needed by `all'.  Stop.






> Changes in v2:
> - Rewrite this commit based on tegra feedback
>
>  Makefile | 15 +--
>  1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 06996d4..6b95e79 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -764,14 +764,8 @@ ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
>  endif
>
>  # enable combined SPL/u-boot/dtb rules for tegra
> -ifneq ($(CONFIG_TEGRA),)
> -ifeq ($(CONFIG_SPL),y)
> -ifeq ($(CONFIG_OF_SEPARATE),y)
> -ALL-y += u-boot-dtb-tegra.bin
> -else
> -ALL-y += u-boot-nodtb-tegra.bin
> -endif
> -endif
> +ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
> +ALL-y += u-boot-nodtb-tegra.bin u-boot-dtb-tegra.bin
>  endif


Judging from the discussion in v1,


ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
ALL-y += u-boot-nodtb-tegra.bin
ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin
endif

would be better, I think.




>  # Add optional build target if defined in board/cpu/soc headers
> @@ -1078,8 +1072,9 @@ u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
> $(call if_changed,pad_cat)
>
>  ifeq ($(CONFIG_OF_SEPARATE),y)
> -u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE
> -   $(call if_changed,cat)
> +OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary 
> --pad-to=$(CONFIG_SYS_TEXT_BASE)
> +u-boot-dtb-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
> +   $(call if_changed,pad_cat)
>  endif
>  endif
>

ifdefs around build rules are unnecessary.






-- 
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 2/7] fdt: Build a U-Boot binary without device tree

2016-01-31 Thread Masahiro Yamada
Hi Simon,

2016-01-29 12:24 GMT+09:00 Simon Glass :
> At present u-boot.bin holds the plain U-Boot binary without the device tree.
> This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin
> depending on whether device tree is used.
>
> Adjust the build such that u-boot.bin includes a device tree (if enabled),
> and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains
> the same.
>
> This should be acceptable since:
>
> - without OF_CONTROL, u-boot.bin still does not include a device tree
> - with OF_CONTROL, u-boot-dtb.bin does not change
>
> The main impact is build systems which are set up to use u-boot.bin as
> the output file and then add a device tree. These will have to change to use
> u-boot-nodtb.bin instead.
>
> Adjust tegra rules so it continues to produce the correct files.
>
> Signed-off-by: Simon Glass 
> ---




With this patch, u-boot-dtb.bin will be an intermediate file.
(u-boot.bin depends on u-boot-dtb.bin if CONFIG_OF_SEPARATE=y)


You can change

ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb u-boot-dtb.bin

to

ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb




> Changes in v2: None
>
>  Makefile | 24 
>  1 file changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 6b95e79..aebc43b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -822,9 +822,17 @@ PHONY += dtbs
>  dtbs dts/dt.dtb: checkdtc u-boot
> $(Q)$(MAKE) $(build)=dts dtbs
>
> -u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE
> +ifeq ($(CONFIG_OF_CONTROL),y)

I think this should be  ifeq ($(CONFIG_OF_CONTROL_SEPARATE),y)

Otherwise, this  patch  embeds the DTB into the U-Boot image and
also adds it to the tail of the image.



> +u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE
> $(call if_changed,cat)
>
> +u-boot.bin: u-boot-dtb.bin FORCE
> +   $(call if_changed,cat)
> +else
> +u-boot.bin: u-boot-nodtb.bin FORCE
> +   $(call if_changed,cat)
> +endif
>

Or, in stead, you can use $(call if_changed,copy) for clarification.
(you need to move the "cmd_copy" define a bit above, though.)

This might be a matter of preference, so I will leave this to you.






-- 
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 3/7] fdt: Build an SPL binary without device tree

2016-01-31 Thread Masahiro Yamada
Hi Simon,


2016-01-29 12:24 GMT+09:00 Simon Glass :
> At present u-boot-spl.bin holds the plain SPL binary without the device
> tree. This is somewhat annoying since you need either u-boot-spl.bin or
> u-boot-spl-dtb.bin depending on whether device tree is used.
>
> Adjust the build such that u-boot-spl.bin includes a device tree
> (if enabled), and the plain binary is in u-boot-spl-nodtb.bin. For now
> u-boot-spl-dtb.bin remains the same.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None
>
>  scripts/Makefile.spl | 20 ++--
>  1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
> index dff16b9..2b4890f 100644
> --- a/scripts/Makefile.spl
> +++ b/scripts/Makefile.spl
> @@ -131,14 +131,14 @@ boot.bin: $(obj)/u-boot-spl.bin
>  else
>  MKIMAGEFLAGS_boot.bin = -T zynqimage
>
> -spl/boot.bin: $(obj)/u-boot-spl-dtb.bin
> +spl/boot.bin: $(obj)/u-boot-spl.bin
> $(call if_changed,mkimage)
>  endif
>
>  ALL-y  += $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).cfg
>
>  ifdef CONFIG_SPL_OF_CONTROL
> -ALL-$(CONFIG_OF_SEPARATE) += $(obj)/$(SPL_BIN)-pad.bin 
> $(obj)/$(SPL_BIN)-dtb.bin
> +ALL-$(CONFIG_OF_SEPARATE) += $(obj)/$(SPL_BIN)-pad.bin 
> $(obj)/$(SPL_BIN)-nodtb.bin
>  endif


I think this line can be completely omitted.

If CONFIG_SPL_OF_CONTROL=y, these two are generated by the following
dependency chain:

$(SPL_BIN).bin  ->  $(SPL_BIN)-dtb.bin  -> $(SPL_BIN)-nodtb.bin,
$(SPL_BIN)-pad.bin





>  ifdef CONFIG_SAMSUNG
> @@ -166,11 +166,19 @@ all:  $(ALL-y)
>  quiet_cmd_cat = CAT $@
>  cmd_cat = cat $(filter-out $(PHONY), $^) > $@
>
> -$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN)-pad.bin \
> +ifeq ($(CONFIG_SPL_OF_CONTROL),y)
> +$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin 
> $(obj)/$(SPL_BIN)-pad.bin \
> $(obj)/$(SPL_BIN).dtb FORCE
> $(call if_changed,cat)
>
> -# Create a file that pads from the end of u-boot-spl.bin to bss_end
> +$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
> +   $(call if_changed,cat)
> +else
> +$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE
> +   $(call if_changed,cat)
> +endif

You can use if_changed,copy  if you like.







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


[U-Boot] [PATCH 0/6] dm: serial: Remove serial drivers not yet converted to driver model

2016-01-31 Thread Simon Glass
The deadline was yesterday, so lets remove all the drivers that are not
converted and don't appear to be used.

There are still five that do seem to be in use but are not converted:

   arm_dcc.c
   mcfuart.c
   serial_bfin.c
   serial_pxa.c
   serial_s3c24x0.c

I will send emails to the maintainers to get these completed.


Simon Glass (6):
  dm: freescale: Drop mxs_auart serial driver
  dm: opencores: Drop opencores_yanu serial driver
  dm: freescale: serial: Drop serial_imx serial driver
  dm: serial: Drop serial_max3100 serial driver
  dm: pxa: serial: Drop serial_sa1100 serial driver
  dm: Update on current serial driver status

 doc/driver-model/serial-howto.txt |  14 +-
 drivers/serial/Makefile   |   5 -
 drivers/serial/mxs_auart.c| 151 
 drivers/serial/opencores_yanu.c   | 242 ---
 drivers/serial/serial_imx.c   | 223 -
 drivers/serial/serial_max3100.c   | 294 --
 drivers/serial/serial_sa1100.c| 162 -
 include/configs/mxs.h |   2 -
 8 files changed, 4 insertions(+), 1089 deletions(-)
 delete mode 100644 drivers/serial/mxs_auart.c
 delete mode 100644 drivers/serial/opencores_yanu.c
 delete mode 100644 drivers/serial/serial_imx.c
 delete mode 100644 drivers/serial/serial_max3100.c
 delete mode 100644 drivers/serial/serial_sa1100.c

-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH 1/6] dm: freescale: Drop mxs_auart serial driver

2016-01-31 Thread Simon Glass
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).

Signed-off-by: Simon Glass 
---

 drivers/serial/Makefile|   1 -
 drivers/serial/mxs_auart.c | 151 -
 include/configs/mxs.h  |   2 -
 3 files changed, 154 deletions(-)
 delete mode 100644 drivers/serial/mxs_auart.c

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index dd87147..3ce3ab6 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -37,7 +37,6 @@ obj-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 obj-$(CONFIG_ZYNQ_SERIAL) += serial_zynq.o
 obj-$(CONFIG_BFIN_SERIAL) += serial_bfin.o
 obj-$(CONFIG_FSL_LPUART) += serial_lpuart.o
-obj-$(CONFIG_MXS_AUART) += mxs_auart.o
 obj-$(CONFIG_ARC_SERIAL) += serial_arc.o
 obj-$(CONFIG_UNIPHIER_SERIAL) += serial_uniphier.o
 obj-$(CONFIG_STM32_SERIAL) += serial_stm32.o
diff --git a/drivers/serial/mxs_auart.c b/drivers/serial/mxs_auart.c
deleted file mode 100644
index fc0fa96..000
--- a/drivers/serial/mxs_auart.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Freescale i.MX23/i.MX28 AUART driver
- *
- * Copyright (C) 2013 Andreas Wass 
- *
- * Based on the MXC serial driver:
- *
- * (c) 2007 Sascha Hauer 
- *
- * Further based on the Linux mxs-auart.c driver:
- *
- * Freescale STMP37XX/STMP38X Application UART drkiver
- * Copyright 2008-2010 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#ifndef CONFIG_MXS_AUART_BASE
-#error "CONFIG_MXS_AUART_BASE must be set to the base UART to use"
-#endif
-
-/* AUART clock always supplied by XTAL and always 24MHz */
-#define MXS_AUART_CLK 2400
-
-static struct mxs_uartapp_regs *get_uartapp_registers(void)
-{
-   return (struct mxs_uartapp_regs *)CONFIG_MXS_AUART_BASE;
-}
-
-/**
- * Sets the baud rate and settings.
- * The settings are: 8 data bits, no parit and 1 stop bit.
- */
-static void mxs_auart_setbrg(void)
-{
-   u32 div;
-   u32 linectrl = 0;
-   struct mxs_uartapp_regs *regs = get_uartapp_registers();
-
-   if (!gd->baudrate)
-   gd->baudrate = CONFIG_BAUDRATE;
-
-   /*
-* From i.MX28 datasheet:
-* div is calculated by calculating UARTCLK*32/baudrate, rounded to int
-* div must be between 0xEC and 0x003FFFC0 inclusive
-* Lowest 6 bits of div goes in BAUD_DIVFRAC part of LINECTRL register
-* Next 16 bits goes in BAUD_DIVINT part of LINECTRL register
-*/
-   div = (MXS_AUART_CLK * 32) / gd->baudrate;
-   if (div < 0xEC || div > 0x003FFFC0)
-   return;
-
-   linectrl |= ((div & UARTAPP_LINECTRL_EXTRACT_BAUD_DIVFRAC_MASK) <<
-   UARTAPP_LINECTRL_BAUD_DIVFRAC_OFFSET) &
-   UARTAPP_LINECTRL_BAUD_DIVFRAC_MASK;
-   linectrl |= ((div >> UARTAPP_LINECTRL_EXTRACT_BAUD_DIVINT_OFFSET) <<
-   UARTAPP_LINECTRL_BAUD_DIVINT_OFFSET) &
-   UARTAPP_LINECTRL_BAUD_DIVINT_MASK;
-
-   /* Word length: 8 bits */
-   linectrl |= UARTAPP_LINECTRL_WLEN_8BITS;
-
-   /* Enable FIFOs. */
-   linectrl |= UARTAPP_LINECTRL_FEN_MASK;
-
-   /* Write above settings, no parity, 1 stop bit */
-   writel(linectrl, >hw_uartapp_linectrl);
-}
-
-static int mxs_auart_init(void)
-{
-   struct mxs_uartapp_regs *regs = get_uartapp_registers();
-   /* Reset everything */
-   mxs_reset_block(>hw_uartapp_ctrl0_reg);
-   /* Disable interrupts */
-   writel(0, >hw_uartapp_intr);
-   /* Set baud rate and settings */
-   serial_setbrg();
-   /* Disable RTS and CTS, ignore LINECTRL2 register */
-   writel(UARTAPP_CTRL2_RTSEN_MASK |
-   UARTAPP_CTRL2_CTSEN_MASK |
-   UARTAPP_CTRL2_USE_LCR2_MASK,
-   >hw_uartapp_ctrl2_clr);
-   /* Enable receiver, transmitter and UART */
-   writel(UARTAPP_CTRL2_RXE_MASK |
-   UARTAPP_CTRL2_TXE_MASK |
-   UARTAPP_CTRL2_UARTEN_MASK,
-   >hw_uartapp_ctrl2_set);
-   return 0;
-}
-
-static void mxs_auart_putc(const char c)
-{
-   struct mxs_uartapp_regs *regs = get_uartapp_registers();
-   /* Wait in loop while the transmit FIFO is full */
-   while (readl(>hw_uartapp_stat) & UARTAPP_STAT_TXFF_MASK)
-   ;
-
-   writel(c, >hw_uartapp_data);
-
-   if (c == '\n')
-   mxs_auart_putc('\r');
-}
-
-static int mxs_auart_tstc(void)
-{
-   struct mxs_uartapp_regs *regs = get_uartapp_registers();
-   /* Checks if receive FIFO is empty */
-   return !(readl(>hw_uartapp_stat) & UARTAPP_STAT_RXFE_MASK);
-}
-
-static int mxs_auart_getc(void)
-{
-   struct mxs_uartapp_regs *regs = get_uartapp_registers();
-   /* Wait until a character is available 

[U-Boot] [PATCH 2/6] dm: opencores: Drop opencores_yanu serial driver

2016-01-31 Thread Simon Glass
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).

Signed-off-by: Simon Glass 
---

 drivers/serial/Makefile |   1 -
 drivers/serial/opencores_yanu.c | 242 
 2 files changed, 243 deletions(-)
 delete mode 100644 drivers/serial/opencores_yanu.c

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 3ce3ab6..ba11dd6 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -22,7 +22,6 @@ obj-$(CONFIG_ATMEL_USART) += atmel_usart.o
 obj-$(CONFIG_EFI_APP) += serial_efi.o
 obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o
 obj-$(CONFIG_MCFUART) += mcfuart.o
-obj-$(CONFIG_OPENCORES_YANU) += opencores_yanu.o
 obj-$(CONFIG_SYS_NS16550) += ns16550.o
 obj-$(CONFIG_S5P) += serial_s5p.o
 obj-$(CONFIG_IMX_SERIAL) += serial_imx.o
diff --git a/drivers/serial/opencores_yanu.c b/drivers/serial/opencores_yanu.c
deleted file mode 100644
index f68c8d0..000
--- a/drivers/serial/opencores_yanu.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Altera NiosII YANU serial interface by Imagos
- * please see  http://www.opencores.org/project,yanu for
- * information/downloads
- *
- * Copyright 2010, Renato Andreola 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/*-*/
-/* YANU Imagos serial port */
-/*-*/
-
-#define YANU_MAX_PRESCALER_N   ((1 << 4) - 1)  /* 15 */
-#define YANU_MAX_PRESCALER_M   ((1 << 11) -1)  /* 2047 */
-#define YANU_FIFO_SIZE (16)
-#define YANU_RXFIFO_SIZE   (YANU_FIFO_SIZE)
-#define YANU_TXFIFO_SIZE   (YANU_FIFO_SIZE)
-
-#define YANU_RXFIFO_DLY(10*11)
-#define YANU_TXFIFO_THR(10)
-#define YANU_DATA_CHAR_MASK(0xFF)
-
-/* data register */
-#define YANU_DATA_OFFSET   (0) /* data register offset */
-
-#define YANU_CONTROL_OFFSET(4) /* control register offset */
-/* interrupt enable */
-#define YANU_CONTROL_IE_RRDY   (1<<0)  /* ie on received character ready */
-#define YANU_CONTROL_IE_OE (1<<1)  /* ie on rx overrun*/
-#define YANU_CONTROL_IE_BRK(1<<2)  /* ie on break detect  */
-#define YANU_CONTROL_IE_FE (1<<3)  /* ie on framing error */
-#define YANU_CONTROL_IE_PE (1<<4)  /* ie on parity error  */
-#define YANU_CONTROL_IE_TRDY   (1<<5)  /* ie interrupt on tranmitter ready */
-/* control bits */
-#define YANU_CONTROL_BITS_POS  (6) /* bits number pos */
-#define YANU_CONTROL_BITS  (1<

[U-Boot] Conversion of serial_pxa.c to driver model

2016-01-31 Thread Simon Glass
Hi Marek,

Are you planning to convert this to driver model? I see that two
boards still use it.

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


Re: [U-Boot] [PATCH v2 4/7] tegra: Always build a boot image with the same filename

2016-01-31 Thread Masahiro Yamada
2016-01-29 12:24 GMT+09:00 Simon Glass :
> Adjust the Makefile to build u-boot-tegra.bin which contains a device tree
> if OF_CONTROL is enabled, and does not if not. This mirrors U-Boot's new
> approach of using u-boot.bin to handle both cases.


CONFIG_TEGRA_COMMON selects OF_CONTROL, so
the condition "if OF_CONTROL is enabled" is always true.


I assume  "if OF_CONTROL_SEPARATE is enabled"








> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2:
> - Update based on previous changes
>
>  Makefile | 11 ++-
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index aebc43b..f9096c5 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -765,7 +765,7 @@ endif
>
>  # enable combined SPL/u-boot/dtb rules for tegra
>  ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
> -ALL-y += u-boot-nodtb-tegra.bin u-boot-dtb-tegra.bin
> +ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin u-boot-dtb-tegra.bin
>  endif
>
>  # Add optional build target if defined in board/cpu/soc headers
> @@ -1079,11 +1079,12 @@ OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary 
> --pad-to=$(CONFIG_SYS_TEXT_BASE)
>  u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE
> $(call if_changed,pad_cat)
>
> -ifeq ($(CONFIG_OF_SEPARATE),y)
> -OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary 
> --pad-to=$(CONFIG_SYS_TEXT_BASE)
> -u-boot-dtb-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
> +OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
> +u-boot-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
> $(call if_changed,pad_cat)
> -endif
> +
> +u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE
> +   $(call if_changed,cat)
>  endif


I do not understand this logic.

>From your description, I guess

u-boot-spl + u-boot-nodtb.bin   -> u-boot-nodtb-tegra.bin

u-boot-spl + u-boot-dtb.bin -> u-boot-dtb-tegra.bin

u-boot-spl + u-boot.bin -> u-boot-tegra.bin






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


[U-Boot] Converting serial_s3c24x0.c to driver model

2016-01-31 Thread Simon Glass
Hi David,

I'm sorry if you have not heard about this before. I sent out an email
to all maintainers some months ago.

You are listed as the maintainer of a few boards which use the
serial_s3c24x0.c serial driver. We are trying to convert all of these
drivers to driver model. Please see doc/driver-model/serial-howto.txt.

Do you have an update please?

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


[U-Boot] Conversion of serial_bfin to driver model

2016-01-31 Thread Simon Glass
Hi Sonic,

I'm sorry if you have not heard about this before. I sent out an email
to all maintainers some months ago.

You are listed as the maintainer of a few boards which use the
serial_bfin.c serial driver. We are trying to convert all of these
drivers to driver model. Please see doc/driver-model/serial-howto.txt.

Do you have an update please?

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


[U-Boot] Converting arm_dcc to driver model

2016-01-31 Thread Simon Glass
Hi Michal,

I notice that the only user of this driver appears to be a board you
maintain. Do you think you could convert this to driver model? Please
see doc/driver-model/serial-howto.txt.

I'm hoping you might have hardware to test with.

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


[U-Boot] Converting mcfuart.c to driver model

2016-01-31 Thread Simon Glass
Hi TsiChung,

I'm sorry if you have not heard about this before. I sent out an email
to all maintainers some months ago.

You are listed as the maintainer of a few boards which use the
mcfuart.c serial driver. We are trying to convert all of these drivers
to driver model. Please see doc/driver-model/serial-howto.txt.

Do you have an update please?

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


[U-Boot] [PATCH 5/6] dm: pxa: serial: Drop serial_sa1100 serial driver

2016-01-31 Thread Simon Glass
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).

Signed-off-by: Simon Glass 
---

 drivers/serial/Makefile|   1 -
 drivers/serial/serial_sa1100.c | 162 -
 2 files changed, 163 deletions(-)
 delete mode 100644 drivers/serial/serial_sa1100.c

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index a1711c6..435fce3 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -26,7 +26,6 @@ obj-$(CONFIG_SYS_NS16550) += ns16550.o
 obj-$(CONFIG_S5P) += serial_s5p.o
 obj-$(CONFIG_MXC_UART) += serial_mxc.o
 obj-$(CONFIG_PXA_SERIAL) += serial_pxa.o
-obj-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o
 obj-$(CONFIG_S3C24X0_SERIAL) += serial_s3c24x0.o
 obj-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 obj-$(CONFIG_SANDBOX_SERIAL) += sandbox.o
diff --git a/drivers/serial/serial_sa1100.c b/drivers/serial/serial_sa1100.c
deleted file mode 100644
index 78f241d..000
--- a/drivers/serial/serial_sa1100.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * (C) Copyright 2002
- * Wolfgang Denk, DENX Software Engineering, 
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH 
- * Marius Groeger 
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH 
- * Alex Zuepke 
- *
- * Copyright (C) 1999 2000 2001 Erik Mouw (j.a.k.m...@its.tudelft.nl)
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static void sa1100_serial_setbrg(void)
-{
-   unsigned int reg = 0;
-
-   if (gd->baudrate == 1200)
-   reg = 191;
-   else if (gd->baudrate == 9600)
-   reg = 23;
-   else if (gd->baudrate == 19200)
-   reg = 11;
-   else if (gd->baudrate == 38400)
-   reg = 5;
-   else if (gd->baudrate == 57600)
-   reg = 3;
-   else if (gd->baudrate == 115200)
-   reg = 1;
-   else
-   hang ();
-
-#ifdef CONFIG_SERIAL1
-   /* SA1110 uart function */
-   Ser1SDCR0 |= SDCR0_SUS;
-
-   /* Wait until port is ready ... */
-   while(Ser1UTSR1 & UTSR1_TBY) {}
-
-   /* init serial serial 1 */
-   Ser1UTCR3 = 0x00;
-   Ser1UTSR0 = 0xff;
-   Ser1UTCR0 = ( UTCR0_1StpBit | UTCR0_8BitData );
-   Ser1UTCR1 = 0;
-   Ser1UTCR2 = (u32)reg;
-   Ser1UTCR3 = ( UTCR3_RXE | UTCR3_TXE );
-#elif defined(CONFIG_SERIAL3)
-   /* Wait until port is ready ... */
-   while (Ser3UTSR1 & UTSR1_TBY) {
-   }
-
-   /* init serial serial 3 */
-   Ser3UTCR3 = 0x00;
-   Ser3UTSR0 = 0xff;
-   Ser3UTCR0 = (UTCR0_1StpBit | UTCR0_8BitData);
-   Ser3UTCR1 = 0;
-   Ser3UTCR2 = (u32) reg;
-   Ser3UTCR3 = (UTCR3_RXE | UTCR3_TXE);
-#else
-#error "Bad: you didn't configured serial ..."
-#endif
-}
-
-
-/*
- * Initialise the serial port with the given baudrate. The settings
- * are always 8 data bits, no parity, 1 stop bit, no start bits.
- *
- */
-static int sa1100_serial_init(void)
-{
-   serial_setbrg ();
-
-   return (0);
-}
-
-
-/*
- * Output a single byte to the serial port.
- */
-static void sa1100_serial_putc(const char c)
-{
-#ifdef CONFIG_SERIAL1
-   /* wait for room in the tx FIFO on SERIAL1 */
-   while ((Ser1UTSR0 & UTSR0_TFS) == 0);
-
-   Ser1UTDR = c;
-#elif defined(CONFIG_SERIAL3)
-   /* wait for room in the tx FIFO on SERIAL3 */
-   while ((Ser3UTSR0 & UTSR0_TFS) == 0);
-
-   Ser3UTDR = c;
-#endif
-
-   /* If \n, also do \r */
-   if (c == '\n')
-   serial_putc ('\r');
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-static int sa1100_serial_tstc(void)
-{
-#ifdef CONFIG_SERIAL1
-   return Ser1UTSR1 & UTSR1_RNE;
-#elif defined(CONFIG_SERIAL3)
-   return Ser3UTSR1 & UTSR1_RNE;
-#endif
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-static int sa1100_serial_getc(void)
-{
-#ifdef CONFIG_SERIAL1
-   while (!(Ser1UTSR1 & UTSR1_RNE));
-
-   return (char) Ser1UTDR & 0xff;
-#elif defined(CONFIG_SERIAL3)
-   while (!(Ser3UTSR1 & UTSR1_RNE));
-
-   return (char) Ser3UTDR & 0xff;
-#endif
-}
-
-static struct serial_device sa1100_serial_drv = {
-   .name   = "sa1100_serial",
-   .start  = sa1100_serial_init,
-   .stop   = NULL,
-   .setbrg = sa1100_serial_setbrg,
-   .putc   = sa1100_serial_putc,
-   .puts   = default_serial_puts,
-   .getc   = sa1100_serial_getc,
-   .tstc   = sa1100_serial_tstc,
-};
-
-void sa1100_serial_initialize(void)
-{
-   serial_register(_serial_drv);
-}
-
-__weak struct serial_device 

Re: [U-Boot] [PATCH v2 6/7] Makefile: Make u-boot.img the same as u-boot-dtb.img

2016-01-31 Thread Masahiro Yamada
Hi Simon,


2016-01-29 12:24 GMT+09:00 Simon Glass :
> When OF_CONTROL is enabled, u-boot.img has no purpose since it does not
> include the required device tree binary.

Why?

u-boot.img is created on u-boot.bin
and, since 2/7, u-boot.bin includes DTB as needed.





> The correct image to use is
> u-boot-dtb.img with OF_CONTROL but u-boot.img without OF_CONTROL.
>
> Create u-boot.img even when OF_CONTROL is enabled, so that this file can be
> used in both cases.
>
> Signed-off-by: Simon Glass 



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


[U-Boot] [PATCH 3/6] dm: freescale: serial: Drop serial_imx serial driver

2016-01-31 Thread Simon Glass
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).

Signed-off-by: Simon Glass 
---

 drivers/serial/Makefile |   1 -
 drivers/serial/serial_imx.c | 223 
 2 files changed, 224 deletions(-)
 delete mode 100644 drivers/serial/serial_imx.c

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index ba11dd6..6d79e46 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -24,7 +24,6 @@ obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o
 obj-$(CONFIG_MCFUART) += mcfuart.o
 obj-$(CONFIG_SYS_NS16550) += ns16550.o
 obj-$(CONFIG_S5P) += serial_s5p.o
-obj-$(CONFIG_IMX_SERIAL) += serial_imx.o
 obj-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 obj-$(CONFIG_MXC_UART) += serial_mxc.o
 obj-$(CONFIG_PXA_SERIAL) += serial_pxa.o
diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c
deleted file mode 100644
index d43a5fe..000
--- a/drivers/serial/serial_imx.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * (c) 2004 Sascha Hauer 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-
-#if defined CONFIG_IMX_SERIAL1
-#define UART_BASE IMX_UART1_BASE
-#elif defined CONFIG_IMX_SERIAL2
-#define UART_BASE IMX_UART2_BASE
-#else
-#error "define CONFIG_IMX_SERIAL1, CONFIG_IMX_SERIAL2 or 
CONFIG_IMX_SERIAL_NONE"
-#endif
-
-struct imx_serial {
-   volatile uint32_t urxd[16];
-   volatile uint32_t utxd[16];
-   volatile uint32_t ucr1;
-   volatile uint32_t ucr2;
-   volatile uint32_t ucr3;
-   volatile uint32_t ucr4;
-   volatile uint32_t ufcr;
-   volatile uint32_t usr1;
-   volatile uint32_t usr2;
-   volatile uint32_t uesc;
-   volatile uint32_t utim;
-   volatile uint32_t ubir;
-   volatile uint32_t ubmr;
-   volatile uint32_t ubrc;
-   volatile uint32_t bipr[4];
-   volatile uint32_t bmpr[4];
-   volatile uint32_t uts;
-};
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static void imx_serial_setbrg(void)
-{
-   serial_init();
-}
-
-extern void imx_gpio_mode(int gpio_mode);
-
-/*
- * Initialise the serial port with the given baudrate. The settings
- * are always 8 data bits, no parity, 1 stop bit, no start bits.
- *
- */
-static int imx_serial_init(void)
-{
-   volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
-   unsigned int ufcr_rfdiv;
-   unsigned int refclk;
-
-#ifdef CONFIG_IMX_SERIAL1
-   imx_gpio_mode(PC11_PF_UART1_TXD);
-   imx_gpio_mode(PC12_PF_UART1_RXD);
-#else
-   imx_gpio_mode(PB30_PF_UART2_TXD);
-   imx_gpio_mode(PB31_PF_UART2_RXD);
-#endif
-
-   /* Disable UART */
-   base->ucr1 &= ~UCR1_UARTEN;
-
-   /* Set to default POR state */
-
-   base->ucr1 = 0x0004;
-   base->ucr2 = 0x;
-   base->ucr3 = 0x;
-   base->ucr4 = 0x8040;
-   base->uesc = 0x002B;
-   base->utim = 0x;
-   base->ubir = 0x;
-   base->ubmr = 0x;
-   base->uts  = 0x;
-   /* Set clocks */
-   base->ucr4 |= UCR4_REF16;
-
-   /* Configure FIFOs */
-   base->ufcr = 0xa81;
-
-   /* set the baud rate.
-*
-* baud * 16   x
-* - = -
-*  refclk y
-*
-* x - 1 = UBIR
-* y - 1 = UBMR
-*
-* each register is 16 bits wide. refclk max is 96 MHz
-*
-*/
-
-   ufcr_rfdiv = ((base->ufcr) & UFCR_RFDIV) >> 7;
-   if (ufcr_rfdiv == 6)
-   ufcr_rfdiv = 7;
-   else
-   ufcr_rfdiv = 6 - ufcr_rfdiv;
-
-   refclk = get_PERCLK1();
-   refclk /= ufcr_rfdiv;
-
-   /* Set the numerator value minus one of the BRM ratio */
-   base->ubir = (gd->baudrate / 100) - 1;
-
-   /* Set the denominator value minus one of the BRM ratio */
-   base->ubmr = (refclk/(16 * 100)) - 1;
-
-   /* Set to 8N1 */
-   base->ucr2 &= ~UCR2_PREN;
-   base->ucr2 |= UCR2_WS;
-   base->ucr2 &= ~UCR2_STPB;
-
-   /* Ignore RTS */
-   base->ucr2 |= UCR2_IRTS;
-
-   /* Enable UART */
-   base->ucr1 |= UCR1_UARTEN | UCR1_UARTCLKEN;
-
-   /* Enable FIFOs */
-   base->ucr2 |= UCR2_SRST | UCR2_RXEN | UCR2_TXEN;
-
-   /* Clear status flags */
-   base->usr2 |= USR2_ADET  |
- USR2_DTRF  |
- USR2_IDLE  |
- USR2_IRINT |
- USR2_WAKE  |
- USR2_RTSF  |
- USR2_BRCD  |
- USR2_ORE;
-
-   /* Clear status flags */
-   base->usr1 |= USR1_PARITYERR |
- USR1_RTSD  |
- USR1_ESCF  |
- USR1_FRAMERR   |
- USR1_AIRINT|
- USR1_AWAKE;
-   return (0);
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 

[U-Boot] [PATCH 4/6] dm: serial: Drop serial_max3100 serial driver

2016-01-31 Thread Simon Glass
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).

Signed-off-by: Simon Glass 
---

 drivers/serial/Makefile |   1 -
 drivers/serial/serial_max3100.c | 294 
 2 files changed, 295 deletions(-)
 delete mode 100644 drivers/serial/serial_max3100.c

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 6d79e46..a1711c6 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -24,7 +24,6 @@ obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o
 obj-$(CONFIG_MCFUART) += mcfuart.o
 obj-$(CONFIG_SYS_NS16550) += ns16550.o
 obj-$(CONFIG_S5P) += serial_s5p.o
-obj-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 obj-$(CONFIG_MXC_UART) += serial_mxc.o
 obj-$(CONFIG_PXA_SERIAL) += serial_pxa.o
 obj-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o
diff --git a/drivers/serial/serial_max3100.c b/drivers/serial/serial_max3100.c
deleted file mode 100644
index 027d919..000
--- a/drivers/serial/serial_max3100.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * (C) Copyright 2003
- *
- * Pantelis Antoniou 
- * Intracom S.A.
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/**/
-
-/* convienient macros */
-#define MAX3100_SPI_RXD() (MAX3100_SPI_RXD_PORT & MAX3100_SPI_RXD_BIT)
-
-#define MAX3100_SPI_TXD(x) \
-   do { \
-   if (x) \
-   MAX3100_SPI_TXD_PORT |=  MAX3100_SPI_TXD_BIT; \
-   else \
-   MAX3100_SPI_TXD_PORT &= ~MAX3100_SPI_TXD_BIT; \
-   } while(0)
-
-#define MAX3100_SPI_CLK(x) \
-   do { \
-   if (x) \
-   MAX3100_SPI_CLK_PORT |=  MAX3100_SPI_CLK_BIT; \
-   else \
-   MAX3100_SPI_CLK_PORT &= ~MAX3100_SPI_CLK_BIT; \
-   } while(0)
-
-#define MAX3100_SPI_CLK_TOGGLE() (MAX3100_SPI_CLK_PORT ^= MAX3100_SPI_CLK_BIT)
-
-#define MAX3100_CS(x) \
-   do { \
-   if (x) \
-   MAX3100_CS_PORT |=  MAX3100_CS_BIT; \
-   else \
-   MAX3100_CS_PORT &= ~MAX3100_CS_BIT; \
-   } while(0)
-
-/**/
-
-/* MAX3100 definitions */
-
-#define MAX3100_WC (3 << 14)   /* write configuration */
-#define MAX3100_RC (1 << 14)   /* read  configuration */
-#define MAX3100_WD (2 << 14)   /* write data  */
-#define MAX3100_RD (0 << 14)   /* read  data  */
-
-/* configuration register bits */
-#define MAX3100_FEN(1 << 13)   /* FIFO enable   */
-#define MAX3100_SHDN(1 << 12)  /* shutdown bit  */
-#define MAX3100_TM (1 << 11)   /* T bit irq mask*/
-#define MAX3100_RM (1 << 10)   /* R bit irq mask*/
-#define MAX3100_PM (1 <<  9)   /* P bit irq mask*/
-#define MAX3100_RAM(1 <<  8)   /* mask for RA/FE bit*/
-#define MAX3100_IR (1 <<  7)   /* IRDA timing mode  */
-#define MAX3100_ST (1 <<  6)   /* transmit stop bit */
-#define MAX3100_PE (1 <<  5)   /* parity enable bit */
-#define MAX3100_L  (1 <<  4)   /* Length bit*/
-#define MAX3100_B_MASK (0x000F)/* baud rate bits mask   */
-#define MAX3100_B(x)   ((x) & 0x000F)  /* baud rate select bits */
-
-/* data register bits (write) */
-#define MAX3100_TE (1 << 10)   /* transmit enable bit (active 
low)*/
-#define MAX3100_RTS(1 <<  9)   /* request-to-send bit 
(inverted ~RTS pin) */
-
-/* data register bits (read) */
-#define MAX3100_RA (1 << 10)   /* receiver activity when in 
shutdown mode */
-#define MAX3100_FE (1 << 10)   /* framing error when in normal 
mode   */
-#define MAX3100_CTS(1 <<  9)   /* clear-to-send bit (inverted 
~CTS pin)   */
-
-/* data register bits (both directions) */
-#define MAX3100_R  (1 << 15)   /* receive bit*/
-#define MAX3100_T  (1 << 14)   /* transmit bit   */
-#define MAX3100_P  (1 <<  8)   /* parity bit */
-#define MAX3100_D_MASK 0x00FF  /* data bits mask */
-#define MAX3100_D(x)   ((x) & 0x00FF)  /* data bits  */
-
-/* these definitions are valid only for fOSC = 3.6864MHz */
-#define MAX3100_B_230400MAX3100_B(0)
-#define MAX3100_B_115200MAX3100_B(1)
-#define MAX3100_B_57600 MAX3100_B(2)
-#define MAX3100_B_38400 MAX3100_B(9)
-#define MAX3100_B_19200 MAX3100_B(10)
-#define MAX3100_B_9600  MAX3100_B(11)
-#define MAX3100_B_4800  MAX3100_B(12)
-#define MAX3100_B_2400  

[U-Boot] [PATCH 6/6] dm: Update on current serial driver status

2016-01-31 Thread Simon Glass
Update the README to reflect the current status.

Signed-off-by: Simon Glass 
---

 doc/driver-model/serial-howto.txt | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/doc/driver-model/serial-howto.txt 
b/doc/driver-model/serial-howto.txt
index e5e482e..61f2da3 100644
--- a/doc/driver-model/serial-howto.txt
+++ b/doc/driver-model/serial-howto.txt
@@ -1,23 +1,17 @@
 How to port a serial driver to driver model
 ===
 
-About 16 of 33 serial drivers have been converted as at September 2015. It
-is time for maintainers to start converting over the remaining serial drivers:
+Almost all of the serial drivers have been converted as at January 2016. These
+ones remain:
 
arm_dcc.c
-   lpc32xx_hsuart.c
mcfuart.c
-   mxs_auart.c
-   opencores_yanu.c
serial_bfin.c
-   serial_imx.c
-   serial_max3100.c
serial_pxa.c
serial_s3c24x0.c
-   serial_sa1100.c
-   usbtty.c
 
-You should complete this by the end of January 2016.
+The deadline for this work was the end of January 2016. If no one steps
+forward to convert these, at some point there may come a patch to remove them!
 
 Here is a suggested approach for converting your serial driver over to driver
 model. Please feel free to update this file with your ideas and suggestions.
-- 
2.7.0.rc3.207.g0ac5344

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


Re: [U-Boot] [PATCH v2 0/7] fdt: Replace u-boot-dtb.bin with u-boot.bin

2016-01-31 Thread Masahiro Yamada
2016-01-29 12:24 GMT+09:00 Simon Glass :
> At present u-boot.bin holds the plain U-Boot binary without the device tree.
> This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin
> depending on whether device tree is used.
>
> This series adjusts the build such that u-boot.bin includes a device tree if
> enabled, and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin
> remains the same.
>
> This should be acceptable since:
>
> - without OF_CONTROL, u-boot.bin still does not include a device tree
> - with OF_CONTROL, u-boot-dtb.bin does not change
>
> The main impact is to build systems which are set up to use u-boot.bin as
> the output file and then add a device tree. These will have to change to use
> u-boot-nodtb.bin instead.
>
> The original decision to use a separate u-boot-dtb.bin was aimed at allowing
> any device tree file to be concatenated to the u-boot.bin image after the
> build. However this no-longer seems so important. More important is the
> convenience of using the same output file regardless of the setting for
> OF_CONTROL.
>
> Changes in v2:
> - Rewrite this commit based on tegra feedback
> - Update based on previous changes
> - Fix the update_filename in MCV
> - Tweak the tegra rule slightly
>
> Simon Glass (7):
>   tegra: Clarify generation of -nodtb file with OF_CONTROL
>   fdt: Build a U-Boot binary without device tree
>   fdt: Build an SPL binary without device tree
>   tegra: Always build a boot image with the same filename
>   socfpga: Simplify Makefile filenames
>   Makefile: Make u-boot.img the same as u-boot-dtb.img
>   Makefile: Drop unnecessary -dtb suffixes
>


The basic concept is OK with me.

I left some comments in each patch.



-- 
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 v1 1/2] Revert "powerpc: mpc85xx: remove P2020DS board support"

2016-01-31 Thread Bin Meng
Hi York,

On Sun, Jan 31, 2016 at 6:03 AM, York Sun  wrote:
> This reverts commit 168dcc6cef7a0e13bc52fc8fa8de2866cf4033dc.
> Align with changes since P2020DS was removed, including adding
> these macros to defconfig
>
> CONFIG_SYS_NS16550
> CONFIG_CMD_NET
> CONFIG_NETDEVICES
> CONFIG_E1000
> CONFIG_CMD_DHCP
>
> Remove macros and include from board header file, including
> CONFIG_E1000
> CONFIG_MTD_NAND_VERIFY_WRITE
> CONFIG_SYS_NS16550
> config_cmd_default.h
> CONFIG_CMD_ELF
> CONFIG_CMD_SETEXPR
> CONFIG_CMD_NET
>

While we bring this board back, I believe we should add driver model
support this this board as well, at least NS16550.

> Fixed checkpatch errors of exceedding 80 characters, etc.
>
> Signed-off-by: York Sun 
>
> ---
>
> Changes in v1:
> Add back P2020DS, using generic board structure.
>
>  arch/powerpc/cpu/mpc85xx/Kconfig|4 +
>  board/freescale/p2020ds/Kconfig |   12 +
>  board/freescale/p2020ds/MAINTAINERS |   10 +
>  board/freescale/p2020ds/Makefile|   12 +
>  board/freescale/p2020ds/ddr.c   |  128 ++
>  board/freescale/p2020ds/law.c   |   20 +
>  board/freescale/p2020ds/p2020ds.c   |  261 
>  board/freescale/p2020ds/tlb.c   |   91 +
>  configs/P2020DS_36BIT_defconfig |9 +
>  configs/P2020DS_DDR2_defconfig  |9 +
>  configs/P2020DS_SDCARD_defconfig|9 +
>  configs/P2020DS_SPIFLASH_defconfig  |9 +
>  configs/P2020DS_defconfig   |8 +
>  doc/README.scrapyard|1 -
>  include/configs/P2020DS.h   |  755 
> +++
>  15 files changed, 1337 insertions(+), 1 deletion(-)
>  create mode 100644 board/freescale/p2020ds/Kconfig
>  create mode 100644 board/freescale/p2020ds/MAINTAINERS
>  create mode 100644 board/freescale/p2020ds/Makefile
>  create mode 100644 board/freescale/p2020ds/ddr.c
>  create mode 100644 board/freescale/p2020ds/law.c
>  create mode 100644 board/freescale/p2020ds/p2020ds.c
>  create mode 100644 board/freescale/p2020ds/tlb.c
>  create mode 100644 configs/P2020DS_36BIT_defconfig
>  create mode 100644 configs/P2020DS_DDR2_defconfig
>  create mode 100644 configs/P2020DS_SDCARD_defconfig
>  create mode 100644 configs/P2020DS_SPIFLASH_defconfig
>  create mode 100644 configs/P2020DS_defconfig
>  create mode 100644 include/configs/P2020DS.h
>
> diff --git a/arch/powerpc/cpu/mpc85xx/Kconfig 
> b/arch/powerpc/cpu/mpc85xx/Kconfig
> index 0b89157..b35edfb 100644
> --- a/arch/powerpc/cpu/mpc85xx/Kconfig
> +++ b/arch/powerpc/cpu/mpc85xx/Kconfig
> @@ -94,6 +94,9 @@ config TARGET_P1_P2_RDB_PC
>  config TARGET_P1_TWR
> bool "Support p1_twr"
>
> +config TARGET_P2020DS
> +   bool "Support P2020DS"
> +
>  config TARGET_P2041RDB
> bool "Support P2041RDB"
>
> @@ -174,6 +177,7 @@ source "board/freescale/p1022ds/Kconfig"
>  source "board/freescale/p1023rdb/Kconfig"
>  source "board/freescale/p1_p2_rdb_pc/Kconfig"
>  source "board/freescale/p1_twr/Kconfig"
> +source "board/freescale/p2020ds/Kconfig"
>  source "board/freescale/p2041rdb/Kconfig"
>  source "board/freescale/qemu-ppce500/Kconfig"
>  source "board/freescale/t102xqds/Kconfig"
> diff --git a/board/freescale/p2020ds/Kconfig b/board/freescale/p2020ds/Kconfig
> new file mode 100644
> index 000..e527ec9
> --- /dev/null
> +++ b/board/freescale/p2020ds/Kconfig
> @@ -0,0 +1,12 @@
> +if TARGET_P2020DS
> +
> +config SYS_BOARD
> +   default "p2020ds"
> +
> +config SYS_VENDOR
> +   default "freescale"
> +
> +config SYS_CONFIG_NAME
> +   default "P2020DS"
> +
> +endif
> diff --git a/board/freescale/p2020ds/MAINTAINERS 
> b/board/freescale/p2020ds/MAINTAINERS
> new file mode 100644
> index 000..1af28b9
> --- /dev/null
> +++ b/board/freescale/p2020ds/MAINTAINERS
> @@ -0,0 +1,10 @@
> +P2020DS BOARD
> +M: York Sun 
> +S: Maintained
> +F: board/freescale/p2020ds/
> +F: include/configs/P2020DS.h
> +F: configs/P2020DS_defconfig
> +F: configs/P2020DS_36BIT_defconfig
> +F: configs/P2020DS_DDR2_defconfig
> +F: configs/P2020DS_SDCARD_defconfig
> +F: configs/P2020DS_SPIFLASH_defconfig
> diff --git a/board/freescale/p2020ds/Makefile 
> b/board/freescale/p2020ds/Makefile
> new file mode 100644
> index 000..ee00806
> --- /dev/null
> +++ b/board/freescale/p2020ds/Makefile
> @@ -0,0 +1,12 @@
> +#
> +# Copyright 2007-2009 Freescale Semiconductor, Inc.
> +# (C) Copyright 2001-2006
> +# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
> +#
> +# SPDX-License-Identifier: GPL-2.0+
> +#
> +
> +obj-y  += p2020ds.o
> +obj-y  += ddr.o
> +obj-y  += law.o
> +obj-y  += tlb.o
> diff --git a/board/freescale/p2020ds/ddr.c b/board/freescale/p2020ds/ddr.c
> new file mode 100644
> index 000..22aff48
> --- /dev/null
> +++ b/board/freescale/p2020ds/ddr.c
> @@ -0,0 +1,128 @@
> +/*
> + * Copyright 2008-2009 Freescale Semiconductor, Inc.
> + *
> + * This program is free software; you can redistribute it and/or
> 

Re: [U-Boot] [PATCH v2 06/18] Migrate CONFIG_ULPI* to Kconfig

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:52, Mateusz Kulikowski
 wrote:
> Move CONFIG_USB_ULPI* from headers to defconfigs for boards that use it.
> Also - add CONFIG_USB where necesarry - all boards use it,
> but some are not defining it explicitly.
>
> Affected boards:
> colibri_t20, harmony, mcx, mt_ventoux, twister,
> zynq_(picozed, zc702, zc706, zed, zybo)
>
> Signed-off-by: Mateusz Kulikowski 
> ---
>
> Changes in v2:
> - New patch, independent of the rest
> - Should compile cleanly on all affected platforms
> - Is orthogonal to series (i.e. if get's NAK will not break rest of series)
>
> Changes in v1: None
>
>  configs/colibri_t20_defconfig| 2 ++
>  configs/harmony_defconfig| 2 ++
>  configs/mcx_defconfig| 3 +++
>  configs/mt_ventoux_defconfig | 3 +++
>  configs/twister_defconfig| 3 +++
>  configs/zynq_picozed_defconfig   | 3 +++
>  configs/zynq_zc702_defconfig | 3 +++
>  configs/zynq_zc706_defconfig | 3 +++
>  configs/zynq_zed_defconfig   | 3 +++
>  configs/zynq_zybo_defconfig  | 3 +++
>  include/configs/colibri_t20.h| 2 --
>  include/configs/harmony.h| 2 --
>  include/configs/mcx.h| 2 --
>  include/configs/tam3517-common.h | 2 --
>  include/configs/zynq-common.h| 2 --
>  15 files changed, 28 insertions(+), 10 deletions(-)

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


Re: [U-Boot] [PATCH v2 02/18] gpio: Add support for Qualcomm gpio controller

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:52, Mateusz Kulikowski
 wrote:
> Add support for gpio controllers on Qualcomm Snapdragon devices.
> This devices are usually called Top Level Mode Multiplexing in
> Qualcomm documentation.
>
> Signed-off-by: Mateusz Kulikowski 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2:
> - Reordered includes (again)
> - Added newlines between returns
> - Fixed error handling in msm_gpio_probe
> - Added reviewed-by
>
> Changes in v1:
> - Added dt binding documentation
> - Added help to KConfig
> - Use clrsetbits() to switch direction
> - Fixed include order
> - Added #defines for registers/register fields
> - Added secondary compatible string
>
>  doc/device-tree-bindings/gpio/gpio-msm.txt |  22 +
>  drivers/gpio/Kconfig   |  14 +++
>  drivers/gpio/Makefile  |   2 +-
>  drivers/gpio/msm_gpio.c| 135 
> +
>  4 files changed, 172 insertions(+), 1 deletion(-)
>  create mode 100644 doc/device-tree-bindings/gpio/gpio-msm.txt
>  create mode 100644 drivers/gpio/msm_gpio.c

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


Re: [U-Boot] [PATCH v2 05/18] usb: ulpi: Add Kconfig options for ULPI

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:52, Mateusz Kulikowski
 wrote:
> The following options can be now enabled via defconfig:
> - CONFIG_USB_ULPI
> - CONFIG_USB_ULPI_VIEWPORT
> - CONFIG_USB_ULPI_VIEWPORT_OMAP
>
> Signed-off-by: Mateusz Kulikowski 
> ---
>
> Changes in v2:
> - Add better (any) descriptions for Kconfig items.
>
> Changes in v1: None
>
>  drivers/usb/Kconfig  |  2 ++
>  drivers/usb/ulpi/Kconfig | 33 +
>  2 files changed, 35 insertions(+)
>  create mode 100644 drivers/usb/ulpi/Kconfig

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


Re: [U-Boot] [PATCH v2 01/18] serial: Add support for Qualcomm serial port

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:52, Mateusz Kulikowski
 wrote:
> This driver works in "new" Data Mover UART mode, so
> will be compatible with modern Qualcomm chips only.
>
> Signed-off-by: Mateusz Kulikowski 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2:
> - Added newline before return... (globally)
> - Renamed p to priv (priv data) - it required some rewrapping
> - Added Reviewed-by
>
> Changes in v1:
> - Added (better) help to KConfig
> - Added dt binding documentation
> - Fixed include ordering
> - Reworked msm_serial_getc
> - Added error handling to msm_uart_clk_init (that is ignored later for now)
> - Dropped unneeded DM_FLAG_PRE_RELOC
>
>  doc/device-tree-bindings/serial/msm-serial.txt |   6 +
>  drivers/serial/Kconfig |   8 +
>  drivers/serial/Makefile|   1 +
>  drivers/serial/serial_msm.c| 212 
> +
>  4 files changed, 227 insertions(+)
>  create mode 100644 doc/device-tree-bindings/serial/msm-serial.txt
>  create mode 100644 drivers/serial/serial_msm.c

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


Re: [U-Boot] [PATCH v2 03/18] mmc: Add support for Qualcomm SDHCI controller

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:52, Mateusz Kulikowski
 wrote:
> Add support for SD/eMMC controller present on some Qualcomm Snapdragon
> devices. This controller implements SDHCI 2.0 interface but requires
> vendor-specific initialization.
> Driver works in PIO mode as ADMA is not supported by U-Boot (yet).
>
> Signed-off-by: Mateusz Kulikowski 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2:
> - Add reviewed-by
>
> Changes in v1:
> - Added commit message
> - Added DT binding documentation
> - Added Kconfig help
> - Reordered includes
> - Dropped redundant fields from msm_sdhc
> - Cleaned up clock init code (+ added error handling)
> - Dropped mdelay - use wait_for_bit instead in reset code
> - Added missing newline after declarations
> - Added error handling if "reg" is missing
> - Converted base address to pointer
>
>  doc/device-tree-bindings/mmc/msm_sdhci.txt |  25 
>  drivers/mmc/Kconfig|   9 ++
>  drivers/mmc/Makefile   |   1 +
>  drivers/mmc/msm_sdhci.c| 180 
> +
>  4 files changed, 215 insertions(+)
>  create mode 100644 doc/device-tree-bindings/mmc/msm_sdhci.txt
>  create mode 100644 drivers/mmc/msm_sdhci.c

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


Re: [U-Boot] [PATCH v2 04/18] ehci-hcd: Add init_after_reset

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:52, Mateusz Kulikowski
 wrote:
> Some host controllers need addidional initialization after ehci_reset()
> In non-dm implementation it is possible to use 
> CONFIG_EHCI_HCD_INIT_AFTER_RESET.
> This patch adds similar option to ehci drivers using dm.
>
> Signed-off-by: Mateusz Kulikowski 
> Acked-by: Marek Vasut 
> Reviewed-by: Tom Rini 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2:
> - Add Reviewed-by (sjg)
>
> Changes in v1:
> - No changes, just added Acked-by, Reviewed-by
>
>  drivers/usb/host/ehci-hcd.c | 6 ++
>  drivers/usb/host/ehci.h | 1 +
>  2 files changed, 7 insertions(+)

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


Re: [U-Boot] [PATCH v2 07/18] usb: Rename ehci-fsl.h to ehci-ci.h

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:52, Mateusz Kulikowski
 wrote:
> Most of ehci-fsl header describe USB controller
> designed by Chipidea and used by various SoC vendors.
>
> This patch renames it to a generic header: ehci-ci.h
> Contents of file are not changed (so it contains several
> references to freescale SoCs).
>
> Signed-off-by: Mateusz Kulikowski 
> Acked-by: Marek Vasut 
> ---
>
> Changes in v2:
> - Add acked-by
>
> Changes in v1: None
>
>  drivers/usb/host/ehci-fsl.c   | 2 +-
>  drivers/usb/host/ehci-mpc512x.c   | 2 +-
>  drivers/usb/host/ehci-mx5.c   | 2 +-
>  drivers/usb/host/ehci-mx6.c   | 2 +-
>  drivers/usb/host/ehci-mxc.c   | 2 +-
>  drivers/usb/host/ehci-vf.c| 2 +-
>  drivers/usb/host/ehci-zynq.c  | 2 +-
>  include/usb/{ehci-fsl.h => ehci-ci.h} | 6 +++---
>  8 files changed, 10 insertions(+), 10 deletions(-)
>  rename include/usb/{ehci-fsl.h => ehci-ci.h} (99%)

Tested on Dragonboard 410c
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 12/18] spmi: Add sandbox test driver

2016-01-31 Thread Simon Glass
Hi Mateusz,

On 24 January 2016 at 13:53, Mateusz Kulikowski
 wrote:
> This patch adds emulated spmi bus controller with part of
> pm8916 pmic on it to sandbox and tests validating SPMI uclass.
>
> Signed-off-by: Mateusz Kulikowski 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2:
> - Rename CONFIG_DM_SPMI -> CONFIG_SPMI
> - Rename r -> regs, p -> priv
> - Add reviewed-by
> - Update binding doc (drop unused bindig)
>
> Changes in v1: None
>
>  arch/sandbox/dts/sandbox.dts   |  20 

You should add these changes to test.dts also - try running
test/dm/test-dm.sh to see the failures.

>  configs/sandbox_defconfig  |   4 +
>  doc/device-tree-bindings/spmi/spmi-sandbox.txt |  31 +
>  drivers/spmi/Kconfig   |   8 ++
>  drivers/spmi/Makefile  |   1 +
>  drivers/spmi/spmi-sandbox.c| 157 
> +
>  test/dm/Makefile   |   1 +
>  test/dm/spmi.c | 115 ++
>  8 files changed, 337 insertions(+)
>  create mode 100644 doc/device-tree-bindings/spmi/spmi-sandbox.txt
>  create mode 100644 drivers/spmi/spmi-sandbox.c
>  create mode 100644 test/dm/spmi.c
>

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


Re: [U-Boot] [PATCH v2 13/18] drivers: spmi: Add support for Qualcomm SPMI bus driver

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:53, Mateusz Kulikowski
 wrote:
> Support SPMI arbiter on Qualcomm Snapdragon devices.
>
> Signed-off-by: Mateusz Kulikowski 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2:
> - Rename DM_SPMI -> SPMI
> - Rename p -> priv (in write/read)
> - Fix header ordering (again)
> - Add reviewed-by
>
> Changes in v1:
> - add binding documentation and better Kconfig help
> - Changed a bit mapping
> - Change include order
> - Use clrsetbits* where possible
> - Add one more supported dts id
> - Handle missing fields in dt properly
>
>  doc/device-tree-bindings/spmi/spmi-msm.txt |  26 
>  drivers/spmi/Kconfig   |   7 +-
>  drivers/spmi/Makefile  |   1 +
>  drivers/spmi/spmi-msm.c| 189 
> +
>  4 files changed, 222 insertions(+), 1 deletion(-)
>  create mode 100644 doc/device-tree-bindings/spmi/spmi-msm.txt
>  create mode 100644 drivers/spmi/spmi-msm.c

Tested on Dragonboard 410c
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 14/18] pmic: Add support for Qualcomm PM8916 PMIC

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:53, Mateusz Kulikowski
 wrote:
> This PMIC is connected on SPMI bus so needs SPMI support enabled.
>
> Signed-off-by: Mateusz Kulikowski 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2:
> - Add reviewed-by
> - Reordered Kconfig & Makefile (to keep alphabetical ordering)
> - Added link to dt binding @ help
>
> Changes in v1:
> - Added dt bindings
> - Reoder includes
> - Replaced extract_* macros with ordinary shift/mask
> - Added error checking and whitespaces in probe
>
>  doc/device-tree-bindings/pmic/pm8916.txt | 18 ++
>  drivers/power/pmic/Kconfig   | 16 ++
>  drivers/power/pmic/Makefile  |  1 +
>  drivers/power/pmic/pm8916.c  | 96 
> 
>  4 files changed, 131 insertions(+)
>  create mode 100644 doc/device-tree-bindings/pmic/pm8916.txt
>  create mode 100644 drivers/power/pmic/pm8916.c

Tested on Dragonboard 410c
Tested-by: Simon Glass 

Note there is a 'pmic' command that you ca enable.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 11/18] drivers: Add SPMI bus uclass

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:53, Mateusz Kulikowski
 wrote:
> Qualcom processors use proprietary bus to talk with PMIC devices -
> SPMI (System Power Management Interface).
> On wiring level it is similar to I2C, but on protocol level, it's
> multi-master and has simple autodetection capabilities.
> This commit adds simple uclass that provides bus read/write interface.
>
> Signed-off-by: Mateusz Kulikowski 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2:
> - Use proper  entry order in Kconfig
> - Rename CONFIG_DM_SPMI -> CONFIG_SPMI
> - Fix header ordering
> - Add reviewed-by
>
> Changes in v1:
> - Reorder includes
> - Add read/write arguments documentation
>
>  drivers/Kconfig|  2 ++
>  drivers/Makefile   |  1 +
>  drivers/spmi/Kconfig   | 10 ++
>  drivers/spmi/Makefile  |  7 +++
>  drivers/spmi/spmi-uclass.c | 48 
> ++
>  include/dm/uclass-id.h |  1 +
>  include/spmi/spmi.h| 47 +
>  7 files changed, 116 insertions(+)
>  create mode 100644 drivers/spmi/Kconfig
>  create mode 100644 drivers/spmi/Makefile
>  create mode 100644 drivers/spmi/spmi-uclass.c
>  create mode 100644 include/spmi/spmi.h

Tested on Dragonboard 410c
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 17/18] board: Add Qualcomm Dragonboard 410C support

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:53, Mateusz Kulikowski
 wrote:
> This commit add support for 96Boards Dragonboard410C.
> It is board based on APQ8016 Qualcomm SoC, complying with
> 96boards specification.
> Features (present out of the box):
> - 4x Cortex A53 (ARMv8)
> - 2x USB Host port
> - 1x USB Device port
> - 4x LEDs
> - 1x HDMI connector
> - 1x uSD connector
> - 3x buttons (Power, Vol+, Vol-/Reset)
> - WIFI, Bluetooth with integrated antenna
> - 8GiB eMMC
>
> U-Boot boots chained with fastboot in 64-bit mode.
> For detailed build instructions see readme.txt in board directory.
>
> Signed-off-by: Mateusz Kulikowski 
> ---
>
> Changes in v2:
> - Renamed CONFIG_DM_SPMI -> CONFIG_SPMI
> - Removed extra enter in dragonboard file
> - Added ULPI* to defconfig
> - Added MAINTAINERS to board
> - Cleaned up config file - use distro defaults/environment:
>   - Dropped multiple CONFIG_CMD* and other CONFIG_*
>   - Added distro env/config
>   - Dropped old boot commands
> - Split dts - pm8916_gpio entries are taken directly from
>   Linux Dragonboard dts; Add handles for u-boot in -uboot.dtsi;
>   They will be removed once gpio drivers are converted to pinctrl.
> - Renamed some pmic nodes, fixed dragonboard.c to find them properly.
> - Added header and converted comments to c98-style in head.S
> - Print error if pmic gpio node is not found.
>
> Changes in v1:
> - Add better help for dragonboard
> - Move static structures to board_prepare_usb
> - Add DM_SPMI to defconfig
>
>  arch/arm/dts/Makefile|   2 +
>  arch/arm/dts/dragonboard410c-uboot.dtsi  |  28 +
>  arch/arm/dts/dragonboard410c.dts | 148 ++
>  arch/arm/mach-snapdragon/Kconfig |  20 +++
>  board/qualcomm/dragonboard410c/Kconfig   |  15 +++
>  board/qualcomm/dragonboard410c/MAINTAINERS   |   6 +
>  board/qualcomm/dragonboard410c/Makefile  |   8 ++
>  board/qualcomm/dragonboard410c/dragonboard410c.c | 131 +++
>  board/qualcomm/dragonboard410c/head.S|  28 +
>  board/qualcomm/dragonboard410c/readme.txt|  40 ++
>  board/qualcomm/dragonboard410c/u-boot.lds|  90 +
>  configs/dragonboard410c_defconfig|  31 +
>  include/configs/dragonboard410c.h| 153 
> +++
>  13 files changed, 700 insertions(+)
>  create mode 100644 arch/arm/dts/dragonboard410c-uboot.dtsi
>  create mode 100644 arch/arm/dts/dragonboard410c.dts
>  create mode 100644 board/qualcomm/dragonboard410c/Kconfig
>  create mode 100644 board/qualcomm/dragonboard410c/MAINTAINERS
>  create mode 100644 board/qualcomm/dragonboard410c/Makefile
>  create mode 100644 board/qualcomm/dragonboard410c/dragonboard410c.c
>  create mode 100644 board/qualcomm/dragonboard410c/head.S
>  create mode 100644 board/qualcomm/dragonboard410c/readme.txt
>  create mode 100644 board/qualcomm/dragonboard410c/u-boot.lds
>  create mode 100644 configs/dragonboard410c_defconfig
>  create mode 100644 include/configs/dragonboard410c.h

Tested on Dragonboard 410c
Tested-by: Simon Glass 

For the readme, can you please do a patch to add a few more things?

- How to enter fastboot mode
- How pressing power on reset works - it didn't do anything for me
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 18/18] Add myself as Snapdragon and SPMI maintainer

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:53, Mateusz Kulikowski
 wrote:
> - Update MAINTAINERS
> - Update git-mailrc
>
> Signed-off-by: Mateusz Kulikowski 
> ---
>
> Changes in v2:
> - New patch
>
> Changes in v1: None
>
>  MAINTAINERS| 11 +++
>  doc/git-mailrc |  3 +++
>  2 files changed, 14 insertions(+)

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


Re: [U-Boot] [PATCH v2 10/18] ehci: Add support for Qualcomm EHCI

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:53, Mateusz Kulikowski
 wrote:
> This driver is able to reconfigure OTG controller into HOST mode.
> Board can add board-specific initialization as board_prepare_usb().
> It requires USB_ULPI_VIEWPORT enabled in board configuration.
>
> Signed-off-by: Mateusz Kulikowski 
> Acked-by: Marek Vasut 
> ---
>
> Changes in v2:
> - Use PORT_... macro to write to portsc
> - Remove extra whitespace in probe()
> - Add acked-by
>
> Changes in v1:
> - Reordered header files
> - Removed braces around constant
> - Added more verbose help to KConfig
> - Added ULPI dependency to Kconfig
> - Drop register #defines - use ehci-ci.h instead
> - Create fixed ulpi viewport for device
> - Use setbits/clearbits where possible
> - Use wait_for_bit to reset controller
> - Add dt binding documents
>
>  doc/device-tree-bindings/usb/ehci-msm.txt |  10 ++
>  drivers/usb/host/Kconfig  |  11 ++
>  drivers/usb/host/Makefile |   1 +
>  drivers/usb/host/ehci-msm.c   | 178 
> ++
>  4 files changed, 200 insertions(+)
>  create mode 100644 doc/device-tree-bindings/usb/ehci-msm.txt
>  create mode 100644 drivers/usb/host/ehci-msm.c

Tested on Dragonboard 410c
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 09/18] ehci-ci.h: drop generic USBCMD fields

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:53, Mateusz Kulikowski
 wrote:
> Use definitions from ehci.h instead.
>
> Signed-off-by: Mateusz Kulikowski 
> Acked-by: Marek Vasut 
> ---
>
> Changes in v2:
> - Add Acked-by
>
> Changes in v1: None
>
>  drivers/usb/host/ehci-mpc512x.c | 4 ++--
>  include/usb/ehci-ci.h   | 4 
>  2 files changed, 2 insertions(+), 6 deletions(-)

Tested on Dragonboard 410c
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 08/18] usb: ehci-ci: Add missing registers.

2016-01-31 Thread Simon Glass
On 24 January 2016 at 13:53, Mateusz Kulikowski
 wrote:
> Some registers of usb_ehci were marked as reserved.
> This may be true for some variants of Chipidea USB core, but they have
> meaning on other devices.
>
> The following registers were added:
> sbusstatus/sbusmode: AHB-related registers
> genconfig*: Auxiluary IP core configuration registers.
>
> Signed-off-by: Mateusz Kulikowski 
> Reviewed-by: Marek Vasut 
>
> ---
>
> Changes in v2:
> - Add reviewed-by
>
> Changes in v1: None
>
>  include/usb/ehci-ci.h | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Tested on Dragonboard 410c
Tested-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 13/14] efi_loader: hook up in build environment

2016-01-31 Thread Simon Glass
On 14 January 2016 at 22:06, Alexander Graf  wrote:
> Now that we have all the bits and pieces ready for EFI payload loading
> support, hook them up in Makefiles and KConfigs so that we can build.
>
> Signed-off-by: Alexander Graf 
>
> ---
>
> v1 -> v2:
>
>   - Move to GPLv2+
>   - Default to y
> ---
>  lib/Kconfig |  1 +
>  lib/Makefile|  1 +
>  lib/efi_loader/Kconfig  |  9 +
>  lib/efi_loader/Makefile | 11 +++
>  4 files changed, 22 insertions(+)
>  create mode 100644 lib/efi_loader/Kconfig
>  create mode 100644 lib/efi_loader/Makefile

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


Re: [U-Boot] [PATCH 09/14] efi_loader: Implement memory allocation and map

2016-01-31 Thread Simon Glass
Hi Alexander,

On 14 January 2016 at 22:06, Alexander Graf  wrote:
> Due to popular request, this is a separate patch implementing all of the 
> memory
> allocation and memory mapping bits.
>
> We assume we always have a linear RAM map. At TOM U-Boot resides. Inside of
> U-Boot there is the runtime region that we need to explicitly expose via the
> EFI memory map. Below U-Boot, we reserve 128MB of RAM for LOADER_DATA.
>
> Signed-off-by: Alexander Graf 
> ---
>  lib/efi_loader/efi_boottime.c | 99 
> ++-
>  lib/efi_loader/efi_image_loader.c | 28 ++-
>  2 files changed, 123 insertions(+), 4 deletions(-)
>
> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
> index 45217ef..ff3f969 100644
> --- a/lib/efi_loader/efi_boottime.c
> +++ b/lib/efi_loader/efi_boottime.c
> @@ -98,6 +98,8 @@ static void efi_restore_tpl(unsigned long old_tpl)
>  static void *efi_alloc(uint64_t len, int memory_type)
>  {
> switch (memory_type) {
> +   case EFI_LOADER_DATA:
> +   return efi_loader_alloc(len);
> default:
> return malloc(len);
> }
> @@ -143,16 +145,109 @@ static efi_status_t efi_free_pages(uint64_t memory, 
> unsigned long pages)
> return EFI_EXIT(EFI_SUCCESS);
>  }
>
> -/* Will be implemented in a later patch */
> +/*
> + * Returns the EFI memory map. In our case, this looks pretty simple:
> + *
> + *  TOM
> + * ||
> + * |Second half of U-Boot   |

What does 'second half' mean?

> + * ||   &__efi_runtime_stop
> + * ||
> + * |EFI Runtime Services|
> + * ||   &__efi_runtime_start
> + * ||
> + * |First half of U-Boot|
> + * ||   start of EFI loader allocation space
> + * ||
> + * |  Free RAM  |
> + * ||   CONFIG_SYS_SDRAM_BASE
> + *
> + * All pointers are extended to live on a 4k boundary. After exiting the boot
> + * services, only the EFI Runtime Services chunk of memory stays alive.
> + */
>  static efi_status_t efi_get_memory_map(unsigned long *memory_map_size,
>struct efi_mem_desc *memory_map,
>unsigned long *map_key,
>unsigned long *descriptor_size,
>uint32_t *descriptor_version)
>  {
> +   struct efi_mem_desc efi_memory_map[] = {
> +   {
> +   /* RAM before U-Boot */
> +   .type = EFI_CONVENTIONAL_MEMORY,
> +   .attribute = 1 << EFI_MEMORY_WB_SHIFT,
> +   },
> +   {
> +   /* First half of U-Boot */
> +   .type = EFI_LOADER_DATA,
> +   .attribute = 1 << EFI_MEMORY_WB_SHIFT,
> +   },
> +   {
> +   /* EFI Runtime Services */
> +   .type = EFI_RUNTIME_SERVICES_CODE,
> +   .attribute = (1 << EFI_MEMORY_WB_SHIFT) |
> +(1ULL << EFI_MEMORY_RUNTIME_SHIFT),
> +   },
> +   {
> +   /* Second half of U-Boot */
> +   .type = EFI_LOADER_DATA,
> +   .attribute = 1 << EFI_MEMORY_WB_SHIFT,
> +   },
> +   };
> +   ulong runtime_start, runtime_end, runtime_len_pages, runtime_len;
> +
> EFI_ENTRY("%p, %p, %p, %p, %p", memory_map_size, memory_map, map_key,
>   descriptor_size, descriptor_version);
> -   return EFI_EXIT(EFI_UNSUPPORTED);
> +
> +   runtime_start = (ulong)&__efi_runtime_start & ~0xfffULL;
> +   runtime_end = ((ulong)&__efi_runtime_stop + 0xfff) & ~0xfffULL;
> +   runtime_len_pages = (runtime_end - runtime_start) >> 12;
> +   runtime_len = runtime_len_pages << 12;
> +
> +   /* Fill in where normal RAM is (up to U-Boot's top of stack) */
> +   efi_memory_map[0].num_pages = gd->start_addr_sp >> 12;
> +#ifdef CONFIG_SYS_SDRAM_BASE

If not defined, what happens?

> +   efi_memory_map[0].physical_start = CONFIG_SYS_SDRAM_BASE;
> +   efi_memory_map[0].virtual_start = CONFIG_SYS_SDRAM_BASE;
> +   efi_memory_map[0].num_pages -= CONFIG_SYS_SDRAM_BASE >> 12;
> +#endif
> +
> +   /* Give us some space for the stack */
> +   efi_memory_map[0].num_pages -= (16 * 1024 * 1024) >> 12;
> +
> +   /* Reserve the EFI loader pool */
> +   efi_memory_map[0].num_pages -= EFI_LOADER_POOL_SIZE >> 12;
> +
> +   /* Cut out the runtime services */
> +   efi_memory_map[2].physical_start = runtime_start;
> +   efi_memory_map[2].virtual_start = efi_memory_map[2].physical_start;
> +   efi_memory_map[2].num_pages 

Re: [U-Boot] [PATCH 07/14] efi_loader: Add disk interfaces

2016-01-31 Thread Simon Glass
On 14 January 2016 at 22:06, Alexander Graf  wrote:
> A EFI applications usually want to access storage devices to load data from.
>
> This patch adds support for EFI disk interfaces. It loops through all block
> storage interfaces known to U-Boot and creates an EFI object for each existing
> one. EFI applications can then through these objects call U-Boot's read and
> write functions.
>
> Signed-off-by: Alexander Graf 
> Reviewed-by: Simon Glass 
>
> ---
>
> v1 -> v2:
>
>   - Move to block_drvr array
>   - Move to GPLv2+
>   - Fix header order
>   - Document efi block object struct
>   - Use calloc rather than malloc & memset
> ---
>  include/efi_loader.h  |   1 +
>  lib/efi_loader/efi_disk.c | 218 
> ++
>  2 files changed, 219 insertions(+)
>  create mode 100644 lib/efi_loader/efi_disk.c
>
> diff --git a/include/efi_loader.h b/include/efi_loader.h
> index 0f821ff..9d6c322 100644
> --- a/include/efi_loader.h
> +++ b/include/efi_loader.h
> @@ -63,6 +63,7 @@ struct efi_object {
>  };
>  extern struct list_head efi_obj_list;
>
> +int efi_disk_register(void);
>  efi_status_t efi_return_handle(void *handle,
> efi_guid_t *protocol, void **protocol_interface,
> void *agent_handle, void *controller_handle,
> diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
> new file mode 100644
> index 000..c589604
> --- /dev/null
> +++ b/lib/efi_loader/efi_disk.c
> @@ -0,0 +1,218 @@
> +/*
> + *  EFI application disk support
> + *
> + *  Copyright (c) 2016 Alexander Graf
> + *
> + *  SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +static const efi_guid_t efi_block_io_guid = BLOCK_IO_GUID;
> +
> +struct efi_disk_obj {
> +   /* Generic EFI object parent class data */
> +   struct efi_object parent;
> +   /* EFI Interface callback struct for block I/O */
> +   struct efi_block_io ops;
> +   /* U-Boot ifname for block device */
> +   const char *ifname;
> +   /* U-Boot dev_index for block device */
> +   int dev_index;
> +   /* EFI Interface Media descriptor struct, referenced by ops */
> +   struct efi_block_io_media media;
> +   /* EFI device path to this block device */
> +   struct efi_device_path_file_path *dp;
> +};
> +
> +static void ascii2unicode(u16 *unicode, char *ascii)
> +{
> +   while (*ascii)
> +   *(unicode++) = *(ascii++);
> +}
> +
> +static efi_status_t efi_disk_open_block(void *handle, efi_guid_t *protocol,
> +   void **protocol_interface, void *agent_handle,
> +   void *controller_handle, uint32_t attributes)
> +{
> +   struct efi_disk_obj *diskobj = handle;
> +
> +   *protocol_interface = >ops;
> +
> +   return EFI_SUCCESS;
> +}
> +
> +static efi_status_t efi_disk_open_dp(void *handle, efi_guid_t *protocol,
> +   void **protocol_interface, void *agent_handle,
> +   void *controller_handle, uint32_t attributes)
> +{
> +   struct efi_disk_obj *diskobj = handle;
> +
> +   *protocol_interface = diskobj->dp;
> +
> +   return EFI_SUCCESS;
> +}
> +
> +static efi_status_t efi_disk_reset(struct efi_block_io *this,
> +   char extended_verification)
> +{
> +   EFI_ENTRY("%p, %x", this, extended_verification);
> +   return EFI_EXIT(EFI_DEVICE_ERROR);
> +}
> +
> +enum efi_disk_direction {
> +   EFI_DISK_READ,
> +   EFI_DISK_WRITE,
> +};
> +
> +static efi_status_t efi_disk_rw_blocks(struct efi_block_io *this,
> +   u32 media_id, u64 lba, unsigned long buffer_size,
> +   void *buffer, enum efi_disk_direction direction)
> +{
> +   struct efi_disk_obj *diskobj;
> +   struct block_dev_desc *desc;
> +   int blksz;
> +   int blocks;
> +   unsigned long n;
> +
> +   EFI_ENTRY("%p, %x, %"PRIx64", %lx, %p", this, media_id, lba,
> + buffer_size, buffer);
> +
> +   diskobj = container_of(this, struct efi_disk_obj, ops);
> +   if (!(desc = get_dev(diskobj->ifname, diskobj->dev_index)))
> +   return EFI_EXIT(EFI_DEVICE_ERROR);
> +   blksz = desc->blksz;
> +   blocks = buffer_size / blksz;
> +
> +#ifdef DEBUG_EFI
> +   printf("EFI: %s:%d blocks=%x lba=%"PRIx64" blksz=%x dir=%d\n", 
> __func__,
> +  __LINE__, blocks, lba, blksz, direction);
> +#endif
> +
> +   /* We only support full block access */
> +   if (buffer_size & (blksz - 1))
> +   return EFI_EXIT(EFI_DEVICE_ERROR);
> +
> +   if (direction == EFI_DISK_READ)
> +   n = desc->block_read(desc->dev, lba, blocks, buffer);

Shouldn't this be s/desc->dev/desc/?

> +   else
> +   n = desc->block_write(desc->dev, lba, blocks, buffer);

Same here.

> +
> +   /* We don't do interrupts, so check 

Re: [U-Boot] [PATCH 08/14] efi_loader: Add "bootefi" command

2016-01-31 Thread Simon Glass
Hi Alexander,

On 14 January 2016 at 22:06, Alexander Graf  wrote:
> In order to execute an EFI application, we need to bridge the gap between
> U-Boot's notion of executing images and EFI's notion of doing the same.
>
> The best path forward IMHO here is to stick completely to the way U-Boot
> deals with payloads. You manually load them using whatever method to RAM
> and then have a simple boot command to execute them. So in our case, you
> would do
>
>   # load mmc 0:1 $loadaddr grub.efi
>   # bootefi $loadaddr
>
> which then gets you into a grub shell. Fdt information known to U-boot
> via the fdt addr command is also passed to the EFI payload.
>
> Signed-off-by: Alexander Graf 
>
> ---
>
> v1 -> v2:
>
>   - Move to GPLv2+
> ---
>  common/Makefile  |   1 +
>  common/cmd_bootefi.c | 154 
> +++
>  2 files changed, 155 insertions(+)
>  create mode 100644 common/cmd_bootefi.c

Reviewed-by: Simon Glass 

>
> diff --git a/common/Makefile b/common/Makefile
> index 2a1d9f8..a7a728a 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -67,6 +67,7 @@ obj-$(CONFIG_CMD_SOURCE) += cmd_source.o
>  obj-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
>  obj-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
>  obj-$(CONFIG_CMD_BMP) += cmd_bmp.o
> +obj-$(CONFIG_EFI_LOADER) += cmd_bootefi.o

For mainline this should move to cmd/bootefi.o. Also please add a
Kconfig item for it.

>  obj-$(CONFIG_CMD_BOOTMENU) += cmd_bootmenu.o
>  obj-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
>  obj-$(CONFIG_CMD_BOOTSTAGE) += cmd_bootstage.o
> diff --git a/common/cmd_bootefi.c b/common/cmd_bootefi.c
> new file mode 100644
> index 000..fde1942
> --- /dev/null
> +++ b/common/cmd_bootefi.c
> @@ -0,0 +1,154 @@
> +/*
> + *  EFI application loader
> + *
> + *  Copyright (c) 2016 Alexander Graf
> + *
> + *  SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/* This list contains all the EFI objects our payload has access to */
> +LIST_HEAD(efi_obj_list);
> +
> +/*
> + * When booting using the "bootefi" command, we don't know which
> + * physical device the file came from. So we create a pseudo-device
> + * called "bootefi" with the device path /bootefi.
> + *
> + * In addition to the originating device we also declare the file path
> + * of "bootefi" based loads to be /bootefi.
> + */
> +static struct efi_device_path_file_path bootefi_dummy_path[] = {
> +   {
> +   .dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE,
> +   .dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH,
> +   .dp.length = sizeof(bootefi_dummy_path[0]),
> +   .str = { 'b','o','o','t','e','f','i' },
> +   }, {
> +   .dp.type = DEVICE_PATH_TYPE_END,
> +   .dp.sub_type = DEVICE_PATH_SUB_TYPE_END,
> +   .dp.length = sizeof(bootefi_dummy_path[0]),
> +   }
> +};
> +
> +static efi_status_t bootefi_open_dp(void *handle, efi_guid_t *protocol,
> +   void **protocol_interface, void *agent_handle,
> +   void *controller_handle, uint32_t attributes)
> +{
> +   *protocol_interface = bootefi_dummy_path;
> +   return EFI_SUCCESS;
> +}
> +
> +/* The EFI loaded_image interface for the image executed via "bootefi" */
> +static struct efi_loaded_image loaded_image_info = {
> +   .device_handle = bootefi_dummy_path,
> +   .file_path = bootefi_dummy_path,
> +};
> +
> +/* The EFI object struct for the image executed via "bootefi" */
> +static struct efi_object loaded_image_info_obj = {
> +   .handle = _image_info,
> +   .protocols = {
> +   {
> +   /* When asking for the loaded_image interface, just
> +* return handle which points to loaded_image_info */

nit: comment style

> +   .guid = _guid_loaded_image,
> +   .open = _return_handle,
> +   },
> +   {
> +   /* When asking for the device path interface, return
> +* bootefi_dummy_path */
> +   .guid = _guid_device_path,
> +   .open = _open_dp,
> +   },
> +   },
> +};
> +
> +/* The EFI object struct for the device the "bootefi" image was loaded from 
> */
> +static struct efi_object bootefi_device_obj = {
> +   .handle = bootefi_dummy_path,
> +   .protocols = {
> +   {
> +   /* When asking for the device path interface, return
> +* bootefi_dummy_path */
> +   .guid = _guid_device_path,
> +   .open = _open_dp,
> +   }
> +   },
> +};
> +
> +/*
> + * Load an EFI payload into a newly allocated piece of memory, register all
> + * EFI objects it would want to access and jump to it.
> + */
> +static unsigned long do_bootefi_exec(void 

Re: [U-Boot] [PATCH V2] arm: config: enforce -fno-pic for gcc

2016-01-31 Thread Albert ARIBAUD
Hello Peng,

On Sat, 30 Jan 2016 12:10:49 +0800, Peng Fan  wrote:
> Android's tool chain enable the -mandroid at default.
> This option will enable the -fpic, which cause uboot compilation
> failure:
> "
>  LD  u-boot
>  u-boot contains unexpected relocations: R_ARM_ABS32
>  R_ARM_RELATIVE
> "
> 
> In my testcase, arm-linux-androideabi-gcc-4.9 internally
> enables '-fpic', so when compiling code, there will be
> relocation entries using type R_ARM_GOT_BREL and .got
> section. When linking all the built-in.o using ld, there
> will be R_ARM_ABS32 relocation entry and .got section
> in the final u-boot elf image. This can not be handled
> by u-boot, since u-boot only expects R_ARM_RELATIVE
> relocation entry.
> arm-poky-linux-gnueabi-gcc-4.9 default does not enable '-fpic',
> so there is not .got section and R_ARM_GOT_BREL in built-in.o.
> And in the final u-boot elf image, all relocation entries are
> R_ARM_RELATIVE.
> 
> we can pass '-fno-pic' to xxx-gcc to disable pic. whether
> the toolchain internally enables or disables pic, '-fno-pic'
> can work well.
> 
> Signed-off-by: Peng Fan 
> Cc: Albert Aribaud 
> ---
> 
> V2:
>  Drop RFC.
> 
>  arch/arm/config.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/config.mk b/arch/arm/config.mk
> index a3e14a8..8fa57ec 100644
> --- a/arch/arm/config.mk
> +++ b/arch/arm/config.mk
> @@ -107,6 +107,7 @@ ALL-y += checkarmreloc
>  # instruction. Relocation is not supported for that case, so disable
>  # such usage by requiring word relocations.
>  PLATFORM_CPPFLAGS += $(call cc-option, -mword-relocations)
> +PLATFORM_CPPFLAGS += $(call cc-option, -fno-pic)
>  endif
>  
>  # limit ourselves to the sections we want in the .bin.
> -- 
> 2.6.2
> 

Applied to u-boot-arm/master, thanks!

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


Re: [U-Boot] [PATCH] fdt: introudce fdt_get_child_count

2016-01-31 Thread Simon Glass
Hi Peng,

On 30 January 2016 at 23:38, Peng Fan  wrote:
> Introudce fdt_get_child_count for get the number of subnodes of
> one parent node.
>
> Signed-off-by: Peng Fan 
> Cc: Simon Glass 
> ---
>  include/libfdt.h | 18 ++
>  1 file changed, 18 insertions(+)
>
> diff --git a/include/libfdt.h b/include/libfdt.h
> index e48c21a..94d29e6 100644
> --- a/include/libfdt.h
> +++ b/include/libfdt.h
> @@ -193,6 +193,24 @@ int fdt_next_subnode(const void *fdt, int offset);
>  node >= 0; \
>  node = fdt_next_subnode(fdt, node))
>
> +/**
> + * fdt_get_child_count() - get the number of subnodes of one node
> + *
> + * @fdt:   FDT blob
> + * @node:  Offset of node
> + * @return number of child nodes of node, or 0 if there is no subnode.
> + */
> +static inline int fdt_get_child_count(void *fdt, int node)

Does this need to be inline. It doesn't seem important to me.

> +{
> +   int subnode;
> +   int num = 0;
> +
> +   fdt_for_each_subnode(fdt, subnode, node)
> +   num++;
> +
> +   return num;
> +}
> +
>  /**/
>  /* General functions  */
>  /**/
> --
> 2.6.2
>

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


Re: [U-Boot] [PATCH 07/26] libfdt: Add a function to write a property placeholder

2016-01-31 Thread David Gibson
On Thu, Jan 28, 2016 at 09:39:27AM -0700, Simon Glass wrote:
> The existing function to add a new property to a tree being built requires
> that the entire contents of the new property be passed in. For some
> applications it is more convenient to be able to add the property contents
> later, perhaps by reading from a file. This avoids double-buffering of the
> contents.
> 
> Add a new function to support this and adust the existing fdt_property() to
> use it.
> 
> Signed-off-by: Simon Glass 

So, obviously such a patch should really go towards upstream libfdt.

I'm happy enough with the concept, but I don't like the name.

I'd prefer fdt_property_reserve() - the idea being that it reserves
space for the property but doesn't fill it in.

> ---
> 
>  include/libfdt.h| 16 
>  lib/libfdt/fdt_sw.c | 16 ++--
>  2 files changed, 30 insertions(+), 2 deletions(-)
> 
> diff --git a/include/libfdt.h b/include/libfdt.h
> index e48c21a..c3f37ee 100644
> --- a/include/libfdt.h
> +++ b/include/libfdt.h
> @@ -1181,6 +1181,22 @@ static inline int fdt_property_cell(void *fdt, const 
> char *name, uint32_t val)
>  {
>   return fdt_property_u32(fdt, name, val);
>  }
> +
> +/**
> + * fdt_property_val - add a new property and return a pointer to its value
> + *
> + * @fdt: pointer to the device tree blob
> + * @name: name of property to add
> + * @len: length of property value in bytes
> + * @valp: returns a pointer to where where the value should be placed
> + *
> + * returns:
> + *   0, on success
> + *   -FDT_ERR_BADMAGIC,
> + *   -FDT_ERR_NOSPACE, standard meanings
> + */
> +int fdt_property_val(void *fdt, const char *name, int len, void **valp);
> +
>  #define fdt_property_string(fdt, name, str) \
>   fdt_property(fdt, name, str, strlen(str)+1)
>  int fdt_end_node(void *fdt);
> diff --git a/lib/libfdt/fdt_sw.c b/lib/libfdt/fdt_sw.c
> index 320a914..9c1df3d 100644
> --- a/lib/libfdt/fdt_sw.c
> +++ b/lib/libfdt/fdt_sw.c
> @@ -175,7 +175,7 @@ static int _fdt_find_add_string(void *fdt, const char *s)
>   return offset;
>  }
>  
> -int fdt_property(void *fdt, const char *name, const void *val, int len)
> +int fdt_property_val(void *fdt, const char *name, int len, void **valp)
>  {
>   struct fdt_property *prop;
>   int nameoff;
> @@ -193,7 +193,19 @@ int fdt_property(void *fdt, const char *name, const void 
> *val, int len)
>   prop->tag = cpu_to_fdt32(FDT_PROP);
>   prop->nameoff = cpu_to_fdt32(nameoff);
>   prop->len = cpu_to_fdt32(len);
> - memcpy(prop->data, val, len);
> + *valp = prop->data;
> + return 0;
> +}
> +
> +int fdt_property(void *fdt, const char *name, const void *val, int len)
> +{
> + void *ptr;
> + int ret;
> +
> + ret = fdt_property_val(fdt, name, len, );
> + if (ret)
> + return ret;
> + memcpy(ptr, val, len);
>   return 0;
>  }
>  

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


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


[U-Boot] [PATCHv7 2/2] sf: Turn SPI flash chip into 3-Byte address mode

2016-01-31 Thread Zhiqiang Hou
From: Hou Zhiqiang 

For more than 16MiB SPI flash chips, there are 3-Byte and 4-Byte address
mode, and only the 3-Byte address mode is supported in U-Boot so far.
So, reset the SPI flash to 3-Byte address mode in probe to ensure the SPI
flash work correctly, because it may has been set to 4-Byte address mode
after warm boot.

Signed-off-by: Hou Zhiqiang 
---
Tested on T1023RDB.

V7:
 - Generate this patch base on the latest code.
 - Correct the condition for SF_DUAL_STACKED_FLASH to switch the addressing 
mode.
V6:
 - Add the spi_release_bus.
V5:
 - 1. Removed #ifdef for STMICRO.
 - 2. Add support for Spansion chips (>16MiB) switch to 3-Byte address mode.
V4:
 - Split the the patch to 2 patches for clear FSR and SPI flash address mode.
V3:
 - Generate the patch based on the latest tree git://git.denx.de/u-boot.git.
V2:
 - Add the operation of enter 3 Byte address mode in probe.
V1:
 - Based on git://git.denx.de/u-boot.git.

 drivers/mtd/spi/sf_internal.h |  7 ++
 drivers/mtd/spi/spi_flash.c   | 52 +++
 2 files changed, 59 insertions(+)

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 56936e5..d2b2251 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -93,6 +93,10 @@ enum spi_nor_option_flags {
 #define CMD_FLAG_STATUS0x70
 #define CMD_READ_EVCR  0x65
 
+/* Used for Micron, Macronix and Winbond flashes */
+#defineCMD_ENTER_4B_ADDR   0xB7
+#defineCMD_EXIT_4B_ADDR0xE9
+
 /* Bank addr access commands */
 # define CMD_BANKADDR_BRWR 0x17
 # define CMD_BANKADDR_BRRD 0x16
@@ -223,6 +227,9 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 
*cmd,
 int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
size_t len, void *data);
 
+int spi_flash_cmd_4B_addr_switch(struct spi_flash *flash,
+   int enable, u8 idcode0);
+
 #ifdef CONFIG_SPI_FLASH_MTD
 int spi_flash_mtd_register(struct spi_flash *flash);
 void spi_flash_mtd_unregister(void);
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 8a60c72..719dcde 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -527,6 +527,47 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 
offset,
return ret;
 }
 
+int spi_flash_cmd_4B_addr_switch(struct spi_flash *flash,
+   int enable, u8 idcode0)
+{
+   int ret;
+   u8 cmd, bar;
+   bool need_wren = false;
+
+   ret = spi_claim_bus(flash->spi);
+   if (ret) {
+   debug("SF: unable to claim SPI bus\n");
+   return ret;
+   }
+
+   switch (idcode0) {
+   case SPI_FLASH_CFI_MFR_STMICRO:
+   /* Some Micron need WREN command; all will accept it */
+   need_wren = true;
+   case SPI_FLASH_CFI_MFR_MACRONIX:
+   case SPI_FLASH_CFI_MFR_WINBOND:
+   if (need_wren)
+   spi_flash_cmd_write_enable(flash);
+
+   cmd = enable ? CMD_ENTER_4B_ADDR : CMD_EXIT_4B_ADDR;
+   ret = spi_flash_cmd(flash->spi, cmd, NULL, 0);
+   if (need_wren)
+   spi_flash_cmd_write_disable(flash);
+
+   break;
+   default:
+   /* Spansion style */
+   bar = enable << 7;
+   cmd = CMD_BANKADDR_BRWR;
+   ret = spi_flash_cmd_write(flash->spi, , 1, , 1);
+   break;
+   }
+
+   spi_release_bus(flash->spi);
+
+   return ret;
+}
+
 #ifdef CONFIG_SPI_FLASH_SST
 static int sst_byte_write(struct spi_flash *flash, u32 offset, const void *buf)
 {
@@ -1079,6 +1120,17 @@ int spi_flash_scan(struct spi_flash *flash)
flash->size <<= 1;
 #endif
 
+   /*
+* So far, the 4-byte address mode haven't been supported in U-Boot,
+* and make sure the chip (> 16MiB) in default 3-byte address mode,
+* in case of warm bootup, the chip was set to 4-byte mode in kernel.
+*/
+   if (flash->size >> (flash->dual_flash & SF_DUAL_STACKED_FLASH ? 1 : 0)
+   > SPI_FLASH_16MB_BOUN) {
+   if (spi_flash_cmd_4B_addr_switch(flash, false, idcode[0]) < 0)
+   debug("SF: enter 3B address mode failed\n");
+   }
+
/* Compute erase sector and command */
if (params->flags & SECT_4K) {
flash->erase_cmd = CMD_ERASE_4K;
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCHv7 1/2] sf: remove conditional compilation for BAR wr/rd command

2016-01-31 Thread Zhiqiang Hou
From: Hou Zhiqiang 

For the Spansion style SPI flashs, the Extended address control
bit (EXTADD) that control the switching between 3-Byte and 4-Byte
addressing mode is also in BAR[7]. Even if without the macro
CONFIG_SPI_FLASH_BAR, the BAR[7] should be abled to access.

Signed-off-by: Hou Zhiqiang 
---
 V7:
 - New patch.

 drivers/mtd/spi/sf_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 007a5a0..56936e5 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -94,9 +94,9 @@ enum spi_nor_option_flags {
 #define CMD_READ_EVCR  0x65
 
 /* Bank addr access commands */
-#ifdef CONFIG_SPI_FLASH_BAR
 # define CMD_BANKADDR_BRWR 0x17
 # define CMD_BANKADDR_BRRD 0x16
+#ifdef CONFIG_SPI_FLASH_BAR
 # define CMD_EXTNADDR_WREAR0xC5
 # define CMD_EXTNADDR_RDEAR0xC8
 #endif
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCH] armv8/ls1043a: enable workaround for errarum A009942

2016-01-31 Thread Shengzhou Liu
DDR erratum A-009942 is also applicable to LS1043A.

Signed-off-by: Shengzhou Liu 
---
 arch/arm/include/asm/arch-fsl-layerscape/config.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/arch-fsl-layerscape/config.h 
b/arch/arm/include/asm/arch-fsl-layerscape/config.h
index f1b164f..c5b9832 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/config.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/config.h
@@ -171,6 +171,7 @@
 
 #define CONFIG_SYS_FSL_ERRATUM_A009663
 #define CONFIG_SYS_FSL_ERRATUM_A009929
+#define CONFIG_SYS_FSL_ERRATUM_A009942
 #else
 #error SoC not defined
 #endif
-- 
2.1.0.27.g96db324

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


Re: [U-Boot] How to access GP partitions from uboot (2015.04)

2016-01-31 Thread saikiran.jayanthi
HI HARSHA,
I need Your help.In our project we are using internel emmc of 32Gb.
Can u please provide how u created the GP partitions...when we are reading 
or writing commands in mmc we are getting partitions are not created and
unsupported format..kindly let us know how you fornmatted for ext4 file
sysytem...

 Waiting for your reply as early as possible..
Thanks



--
View this message in context: 
http://u-boot.10912.n7.nabble.com/How-to-access-GP-partitions-from-uboot-2015-04-tp212394p244363.html
Sent from the U-Boot mailing list archive at Nabble.com.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] jboot to uboot

2016-01-31 Thread chronek

Hello,

I have old Airlive Air3gii router, what comes with JBoot bootloader. I 
want change to U-Boot bootloader. If anyone know this Jboot bootloader 
and could help me, please share some knowledge. I am connected to router 
via serial and ethernet, JRecovery have small options:


|# help command list... reboot info load  go  dm  wm  
 rm  copyip [ip] mac [mac] ping  areacode|


It react to erase too, tftp working but router not accept any 3rd party 
image files.


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


Re: [U-Boot] [PATCH 07/26] libfdt: Add a function to write a property placeholder

2016-01-31 Thread David Gibson
On Fri, Jan 29, 2016 at 11:23:31AM -0700, Simon Glass wrote:
> Hi David,
> 
> On 28 January 2016 at 22:29, David Gibson  wrote:
> > On Thu, Jan 28, 2016 at 09:39:27AM -0700, Simon Glass wrote:
> >> The existing function to add a new property to a tree being built requires
> >> that the entire contents of the new property be passed in. For some
> >> applications it is more convenient to be able to add the property contents
> >> later, perhaps by reading from a file. This avoids double-buffering of the
> >> contents.
> >>
> >> Add a new function to support this and adust the existing fdt_property() to
> >> use it.
> >>
> >> Signed-off-by: Simon Glass 
> >
> > So, obviously such a patch should really go towards upstream libfdt.
> >
> > I'm happy enough with the concept, but I don't like the name.
> >
> > I'd prefer fdt_property_reserve() - the idea being that it reserves
> > space for the property but doesn't fill it in.
> 
> Sounds good. I'll work up a patch. I tend to sync with upstream one a
> quarter or so.

Ok.

Actually, on further consideration, fdt_property_placeholder() is a
better name again.

> 
> >
> >> ---
> >>
> >>  include/libfdt.h| 16 
> >>  lib/libfdt/fdt_sw.c | 16 ++--
> >>  2 files changed, 30 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/include/libfdt.h b/include/libfdt.h
> >> index e48c21a..c3f37ee 100644
> >> --- a/include/libfdt.h
> >> +++ b/include/libfdt.h
> >> @@ -1181,6 +1181,22 @@ static inline int fdt_property_cell(void *fdt, 
> >> const char *name, uint32_t val)
> >>  {
> >>   return fdt_property_u32(fdt, name, val);
> >>  }
> >> +
> >> +/**
> >> + * fdt_property_val - add a new property and return a pointer to its value
> >> + *
> >> + * @fdt: pointer to the device tree blob
> >> + * @name: name of property to add
> >> + * @len: length of property value in bytes
> >> + * @valp: returns a pointer to where where the value should be placed
> >> + *
> >> + * returns:
> >> + *   0, on success
> >> + *   -FDT_ERR_BADMAGIC,
> >> + *   -FDT_ERR_NOSPACE, standard meanings
> >> + */
> >> +int fdt_property_val(void *fdt, const char *name, int len, void **valp);
> >> +
> >>  #define fdt_property_string(fdt, name, str) \
> >>   fdt_property(fdt, name, str, strlen(str)+1)
> >>  int fdt_end_node(void *fdt);
> >> diff --git a/lib/libfdt/fdt_sw.c b/lib/libfdt/fdt_sw.c
> >> index 320a914..9c1df3d 100644
> >> --- a/lib/libfdt/fdt_sw.c
> >> +++ b/lib/libfdt/fdt_sw.c
> >> @@ -175,7 +175,7 @@ static int _fdt_find_add_string(void *fdt, const char 
> >> *s)
> >>   return offset;
> >>  }
> >>
> >> -int fdt_property(void *fdt, const char *name, const void *val, int len)
> >> +int fdt_property_val(void *fdt, const char *name, int len, void **valp)
> >>  {
> >>   struct fdt_property *prop;
> >>   int nameoff;
> >> @@ -193,7 +193,19 @@ int fdt_property(void *fdt, const char *name, const 
> >> void *val, int len)
> >>   prop->tag = cpu_to_fdt32(FDT_PROP);
> >>   prop->nameoff = cpu_to_fdt32(nameoff);
> >>   prop->len = cpu_to_fdt32(len);
> >> - memcpy(prop->data, val, len);
> >> + *valp = prop->data;
> >> + return 0;
> >> +}
> >> +
> >> +int fdt_property(void *fdt, const char *name, const void *val, int len)
> >> +{
> >> + void *ptr;
> >> + int ret;
> >> +
> >> + ret = fdt_property_val(fdt, name, len, );
> >> + if (ret)
> >> + return ret;
> >> + memcpy(ptr, val, len);
> >>   return 0;
> >>  }
> >>
> 
> Regards,
> Simon

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


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


Re: [U-Boot] [PATCH] arm: use common instructions applicable to armv7m & other arm archs

2016-01-31 Thread Albert ARIBAUD
Hello Vikas,

On Sat, 30 Jan 2016 00:36:55 +0100, Vikas MANOCHA
 wrote:
> Hi Albert,
> 
> > -Original Message-
> > From: Albert ARIBAUD [mailto:albert.u.b...@aribaud.net]
> > Sent: Friday, January 29, 2016 9:16 AM
> > To: Vikas MANOCHA
> > Cc: u-boot@lists.denx.de; Simon Glass; re...@wp.pl; Bo Shen; Przemyslaw
> > Marczak
> > Subject: Re: [PATCH] arm: use common instructions applicable to armv7m &
> > other arm archs
> > 
> > Hello Vikas,
> > 
> > On Mon, 18 Jan 2016 18:52:57 -0800, Vikas Manocha
> >  wrote:
> > > BIC instruction to clear the SP is not allowed in armv7m & is
> > > deprecated in ARMv6T2 & above. This patch cleans the code by using
> > > instructions allowed for armv7m as well as other Arm archs.
> > 
> > I am not against this patch, which has merits on its own; but the commit
> > message above raises a couple of questions.
> > 
> > 1. It seems to imply that in the current arch/arm/lib/crt0.S, BIC is
> >incorrectly being used on sp. However, it is *not*; it is used on r3,
> >precisely because it cannot be used directly on sp, as the comment
> >before the bic instruction clearly states. Why does the commit
> >message raise this non-issue?
> 
> For sure, BIC is used correctly. Currently BIC instruction is being used on 
> r3 for armv7m & on SP for others.
> The patch is to use same instruction for all ISAs & to make code cleaner.
> The intention of message " BIC instruction to clear the SP is not allowed in 
> armv7m" is to justify the usage of register (r0) instead of SP for BIC.
> Sorry if it created some confusion, how about following commit message for v2:
> 
> "This patch cleans the code by using instructions allowed for armv7m as well 
> as other Arm archs.
> Just for information, BIC instruction to clear the SP is not allowed in 
> armv7m & is deprecated in ARMv6T2 & above"

Almost good, but... the current code /already/ uses instructions
allowed for ARMv7-M. It even has a conditional on CONFIG_CPU_V7M under
which all instructions are ARMv7-compatible. Proof is, ARMv7 actually
builds (and runs fine).

Granted, if someone built for ARMv7-M but with CONFIG_CPU_V7M unset,
then the assembler would fail on the "BIC sp" instruction, which is
indeed forbidden in ARMv7-M; but such a build cannot happen unless
that same someone actively *circumvented* the U-Boot build process. 

What your patch does is therefore definitely not "Fix bad use of
BIC which breaks ARMv7", and not even "fix use of BIC that might cause
ARMv7 to break". Your patch is, however, "Streamline code and remove
ARMv7-M conditional by using only ARMv7-M-allowed instructions" -- and
this it does pretty well.

I would therefore completely drop the part about BIC from the commit
message as it is not actually a problem in the current code -- or more
to the point, as its limitations were already acknowledged and accounted
for in the current code.

However, if the bit about BIC really had to stay (with will require a
very strong reason), it should be corrected, because of the following:

> > 
> > 2. I could not find any information on BIC being deprecated in
> >Architecture Reference Manuals of either ArmV7 (section "Deprecated
> >Features in ARMv7-M", or ARMv6-M (section "Deprecated and Obsolete
> >Features"). Where does this information come from?
> 
> I got it from some of the web locations, one of them is:
> http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473j/dom1361289864906.html

Firstly, the link above is *not* to the ARMv6-M Architecture Reference
Manual, but from the documentation of an ARM tool, namely the ARM DS-5
compiler (version 5.04). The only authoritative source to determine if
a feature is deprecated in a given ARM architecture is its Architecture
Reference Manual.

But even of the sentence above was authoritative, what it purports as
deprecated is the use of PC and SP in BIC, not the use of BIC itself,
whereas the proposed commit message might be read by a casual (or
non-casual but not quite attentive enough) reader might as "the BIC
instruction to clear the SP is not allowed in armv7m & the BIC
instruction is deprecated in ARMv6T2 & above".

At the very least, that part of the commit message should be reworded
as "Using BIC on SP (as well as PC) is deprecated in ARMv6T2 and above,
and forbidden in ARMv7-M".

However, my opinion is that the commit is not about fixing how BIC is
used but about getting rid of the ARMv7-M conditional, and therefore,
I think that its message should not mention BIC at all.

I would therefore limit the commit message to just this:

This patch cleans the code by using instructions allowed for
ARMv7-M as well as other Arm architectures.

> Cheers,
> Vikas

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


  1   2   >