[U-Boot] [PATCH][v2] powerpc/b4860: Updated default hwconfig so as to enable only

2014-09-03 Thread Shaveta Leekha
CPC1 is not being enabled by default as powerpc is supposed to
use only CPC2.
Though by editing hwconfig en_cpc option,
CPC1 can also be enabled

Signed-off-by: Shaveta Leekha 
Signed-off-by: Sandeep Singh 
---
Tested on B4860QDS

Changes in V2:
Inserted "en_cpc:cpc2" at right place,
not to broke into the settings for DDR


 include/configs/B4860QDS.h |   11 +--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
index 953d06b..6deb784 100644
--- a/include/configs/B4860QDS.h
+++ b/include/configs/B4860QDS.h
@@ -819,9 +819,16 @@ unsigned long get_board_ddr_clk(void);
 
 #define __USB_PHY_TYPE ulpi
 
+#ifdef CONFIG_PPC_B4860
+#define HWCONFIG   "hwconfig=fsl_ddr:ctlr_intlv=null," \
+   "bank_intlv=cs0_cs1;"   \
+   "en_cpc:cpc2;"
+#else
+#defineHWCONFIG
"hwconfig=fsl_ddr:ctlr_intlv=null,bank_intlv=cs0_cs1;"
+#endif
+
 #defineCONFIG_EXTRA_ENV_SETTINGS   \
-   "hwconfig=fsl_ddr:ctlr_intlv=null," \
-   "bank_intlv=cs0_cs1;"   \
+   HWCONFIG\
"usb1:dr_mode=host,phy_type=" __stringify(__USB_PHY_TYPE) "\0"\
"netdev=eth0\0" \
"uboot=" __stringify(CONFIG_UBOOTPATH) "\0" \
-- 
1.7.6.GIT

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


Re: [U-Boot] [PATCH v3 0/4] introduce get_maintainer.pl

2014-09-03 Thread Stefan Roese

Hi Daniel,

On 04.09.2014 01:34, Simon Glass wrote:

This series imports get_maintainer.pl from kernel and reintroduce
the MAINTAINERS file in the according format. Currently one have to
manually grep all infos about board maintainers or custodians from
various sources like git log, wiki or boards.cfg. get_maintainer.pl
makes this task much easier. Also patman is already able to use it
for cc-cmd.

The MAINTAINERS file contains all custodians and is hand-written based
on infos from wiki [1] and u-boot git forks [2]. Thus the source files
infos (F:) are not complete yet. Furthermore status (S:) and
maintainership (M:) for some custodian trees are probably wrong.
Any help in completing and fixing that is appreciated.

The get_maintainers.pl script is modified to scan multiple
MAINTAINERS files in the board directory. This is required
with the switch to Kconfig which adds a MAINTAINERS file per board.

Examples:

  $ ./scripts/get_maintainer.pl --nogit-fallback -f board/sandbox/
Simon Glass  (maintainer:SANDBOX BOARD)
u-boot@lists.denx.de (open list)

  $ ./scripts/get_maintainer.pl --nogit-fallback -f arch/sandbox/
Simon Glass  (maintainer:SANDBOX)
u-boot@lists.denx.de (open list)

  $ ./scripts/get_maintainer.pl --nogit-fallback -f board/sandburst/metrobox/
Travis Sawyer  (orphan (since 
2014-03):METROBOX BOARD)
u-boot@lists.denx.de (open list)

This series is also available at 
git://git.denx.de/u-boot-mips.git/maintainers_v3.


Patman now picks this up which is great. But it does sometimes produce
a long list of maintainers. I wonder if we could have an option to
turn it off (perhaps -m)?


Yes, that would be good. I just recently got a very long Cc list in my 
quite bit patchset. This definitely was too much and I had to send those 
patches manually instead of using patman. We need an option to disable this.


Thanks,
Stefan

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


Re: [U-Boot] [PATCH v3 3/4] cleanup code which handles the Android sparse image format

2014-09-03 Thread Wolfgang Denk
Dear Steve Rae,

In message <1409763954-5494-4-git-send-email-s...@broadcom.com> you wrote:
> - port dprintf() to debug()
> - update formatting
> 
> Signed-off-by: Steve Rae 
> ---
> 
> Changes in v3:
> - use original license text
> 
> Changes in v2:
> - use BSD-3-Clause
> 
>  common/aboot.c | 97 
> +-
>  1 file changed, 56 insertions(+), 41 deletions(-)
> 
> diff --git a/common/aboot.c b/common/aboot.c
> index a302c92..3611feb 100644
> --- a/common/aboot.c
> +++ b/common/aboot.c
> @@ -28,6 +28,9 @@
>   * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
>   * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   *
> + * NOTE:
> + *   Although it is very similar, this license text is not identical
> + *   to the "BSD-3-Clause", therefore, DO NOT MODIFY THIS LICENSE TEXT!
>   */

I understand your intention of starting with the pristine file, and
then adaptng it to U-Boot, but I don't like adding a broken file in
patch 1/4 only to fix it later in patch 3/4. I think it would be
better to squash these patches.

Second, as already mentioned, we need to assign a SPDX ID for this.

Did you check with SPDX if there a matching ID?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
EMACS belongs in : Editor too big!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/4] add code to handle Android sparse image format

2014-09-03 Thread Wolfgang Denk
Dear Steve Rae,

In message <1409763954-5494-2-git-send-email-s...@broadcom.com> you wrote:
> Add original file (pristine) from :
>   
> https://www.codeaurora.org/cgit/quic/la/kernel/lk/plain/app/aboot/aboot.c?h=master
> [3b5092d20bd15a7a2879c13e9f64acc48d04af2d]
...
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions are 
> met:
> + * * Redistributions of source code must retain the above copyright
> + *   notice, this list of conditions and the following disclaimer.
> + * * Redistributions in binary form must reproduce the above copyright
> + *   notice, this list of conditions and the following disclaimer in the
> + *   documentation and/or other materials provided with the distribution.
> + * * Neither the name of The Linux Foundation nor
> + *   the names of its contributors may be used to endorse or promote
> + *   products derived from this software without specific prior written
> + *   permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 
> IS"
> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 
> AND
> + * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
> + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
> PROFITS;
> + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
> + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
> + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
> + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Please make sure to replace this with a SPDX license ID.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
After a heated argument on some trivial matter Nancy [Astor]  .  .  .
shouted,  ``If  I were your wife I would put poison in your coffee!''
Whereupon Winston Churchill with equal heat and  sincerity  answered,
``And if I were your husband I would drink it.''
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] patman: make run results better visible

2014-09-03 Thread Doug Anderson
Vadim,

On Wed, Sep 3, 2014 at 4:00 PM, Vadim Bendebury  wrote:
> On Wed, Sep 3, 2014 at 3:14 PM, Doug Anderson  wrote:
>> Vadim,
>>
>> On Wed, Sep 3, 2014 at 12:16 PM, Vadim Bendebury  
>> wrote:
>>> For an occasional user of patman some failures are not obvious: for
>>> instance when checkpatch reports warnings, the dry run still reports
>>> that the email would be sent. If it is not dry run, the warnings are
>>> shown on the screen, but it is not clear that the email was not sent.
>>>
>>> Add some code to report failure to send email explicitly.
>>>
>>> Tested by running the script on a patch with style violations,
>>> observed error messages in the script output.
>>>
>>> Signed-off-by: Vadim Bendebury 
>>> ---
>>>
>>>  tools/patman/patman.py | 8 +++-
>>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/tools/patman/patman.py b/tools/patman/patman.py
>>> index c60aa5a..0163ccd 100755
>>> --- a/tools/patman/patman.py
>>> +++ b/tools/patman/patman.py
>>> @@ -154,13 +154,19 @@ else:
>>>
>>>  # Email the patches out (giving the user time to check / cancel)
>>>  cmd = ''
>>> -if ok or options.ignore_errors:
>>> +its_a_go = ok or options.ignore_errors
>>> +if its_a_go:
>>>  cmd = gitutil.EmailPatches(series, cover_fname, args,
>>>  options.dry_run, not options.ignore_bad_tags, cc_file,
>>>  in_reply_to=options.in_reply_to)
>>> +else:
>>> +print col.Color(col.RED,
>>> +"Not sending emails due to checkpatch 
>>> errors/warnings")
>>
>> Technically it could be due to other problems, too (like errors applying).
>
> good point, what wording would you suggest?

You don't think that just removing the word "checkpatch" is enough.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] iMX6Q/DL:arm2: Add support for i.MX6Q/DL arm2 LPDDR2 boards

2014-09-03 Thread Nitin Garg
Hi Ye,

On 09/03/2014 03:34 AM, Ye.Li wrote:
> diff --git a/board/freescale/mx6qarm2/mx6qarm2.c 
> b/board/freescale/mx6qarm2/mx6qarm2.c
> index f2e577d..090f3a8 100644
> --- a/board/freescale/mx6qarm2/mx6qarm2.c
> +++ b/board/freescale/mx6qarm2/mx6qarm2.c
> @@ -32,7 +32,11 @@ DECLARE_GLOBAL_DATA_PTR;
>  
>  int dram_init(void)
>  {
> - gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
> +#ifdef CONFIG_DDR_32BIT
> + gd->ram_size = (phys_size_t)CONFIG_DDR_MB * 512 * 1024;
> +#else
> + gd->ram_size = (phys_size_t)CONFIG_DDR_MB * 1024 * 1024;
> +#endif
>  
>   return 0;
>  }

I thought this (CONFIG_DDR_32BIT) is true only for mx6dlarm2
DDR3 board.

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


[U-Boot] [PATCH v3] imx: Support i.MX6 High Assurance Boot authentication

2014-09-03 Thread Nitin Garg
When CONFIG_SECURE_BOOT is enabled, the signed images
like kernel and dtb can be authenticated using iMX6 CAAM.
The added command hab_auth_img can be used for HAB
authentication of images. The command takes the image
DDR location, IVT (Image Vector Table) offset inside
image as parameters. Detailed info about signing images
can be found in Freescale AppNote AN4581.

Signed-off-by: Nitin Garg 

---

Changes in v3:
- Remove typecast of get_cpu_rev since its not required

Changes in v2:
- Cleaned up clock code as per review comments
- Removed dead code as per review comments
- Re-written commit log as per review comments

 arch/arm/cpu/armv7/mx6/clock.c|   32 ++-
 arch/arm/cpu/armv7/mx6/hab.c  |  165 -
 arch/arm/cpu/armv7/mx6/soc.c  |   15 +++
 arch/arm/include/asm/arch-mx6/clock.h |4 +
 4 files changed, 214 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index 820b8d5..db6a8fc 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
+ * Copyright (C) 2010-2014 Freescale Semiconductor, Inc.
  *
  * SPDX-License-Identifier:GPL-2.0+
  */
@@ -543,6 +543,36 @@ int enable_pcie_clock(void)
   BM_ANADIG_PLL_ENET_ENABLE_PCIE);
 }
 
+#ifdef CONFIG_SECURE_BOOT
+void hab_caam_clock_enable(void)
+{
+   struct mxc_ccm_reg *const imx_ccm =
+   (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+
+   /*CG4 ~ CG6, enable CAAM clocks*/
+   setbits_le32(&imx_ccm->CCGR0, MXC_CCM_CCGR0_CAAM_WRAPPER_IPG_MASK |
+MXC_CCM_CCGR0_CAAM_WRAPPER_ACLK_MASK |
+MXC_CCM_CCGR0_CAAM_SECURE_MEM_MASK);
+
+   /* Enable EMI slow clk */
+   setbits_le32(&imx_ccm->CCGR6, MXC_CCM_CCGR6_EMI_SLOW_MASK);
+}
+
+void hab_caam_clock_disable(void)
+{
+   struct mxc_ccm_reg *const imx_ccm =
+   (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+
+   /*CG4 ~ CG6, disable CAAM clocks*/
+   clrbits_le32(&imx_ccm->CCGR0, MXC_CCM_CCGR0_CAAM_WRAPPER_IPG_MASK |
+MXC_CCM_CCGR0_CAAM_WRAPPER_ACLK_MASK |
+MXC_CCM_CCGR0_CAAM_SECURE_MEM_MASK);
+
+   /* Disable EMI slow clk */
+   clrbits_le32(&imx_ccm->CCGR6, MXC_CCM_CCGR6_EMI_SLOW_MASK);
+}
+#endif
+
 unsigned int mxc_get_clock(enum mxc_clock clk)
 {
switch (clk) {
diff --git a/arch/arm/cpu/armv7/mx6/hab.c b/arch/arm/cpu/armv7/mx6/hab.c
index f6810a6..61a94a1 100644
--- a/arch/arm/cpu/armv7/mx6/hab.c
+++ b/arch/arm/cpu/armv7/mx6/hab.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2013 Freescale Semiconductor, Inc.
+ * Copyright (C) 2010-2014 Freescale Semiconductor, Inc.
  *
  * SPDX-License-Identifier:GPL-2.0+
  */
@@ -7,8 +7,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
+/* HAB (High Assurance Boot) debug */
+#undef DEBUG_AUTHENTICATE_IMAGE
+
 /*  start of HAB API updates */
 
 #define hab_rvt_report_event_p \
@@ -71,6 +75,41 @@
((hab_rvt_exit_t *)HAB_RVT_EXIT)\
 )
 
+#define IVT_SIZE   0x20
+#define ALIGN_SIZE 0x1000
+#define CSF_PAD_SIZE   0x2000
+
+/*
+ * ++  0x0 (DDR_UIMAGE_START) -
+ * |   Header   |  |
+ * ++  0x40|
+ * ||  |
+ * ||  |
+ * ||  |
+ * ||  |
+ * | Image Data |  |
+ * .|  |
+ * .|   > Stuff to be authenticated +
+ * .|  ||
+ * ||  ||
+ * ||  ||
+ * ++  ||
+ * ||  ||
+ * | Fill Data  |  ||
+ * ||  ||
+ * ++ Align to ALIGN_SIZE  ||
+ * |IVT |  ||
+ * ++ + IVT_SIZE  - |
+ * ||   |
+ * |  CSF DATA  | <-+
+ * ||
+ * ++
+ * ||
+ * | Fill Data  |
+ * ||
+ * ++ + CSF_PAD_SIZE
+ */
+
 bool is_hab_enabled(void)
 {
struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
@@ -144,6 

Re: [U-Boot] [PATCH] Support i.MX6 High Assurance Boot (HAB) authentication of images

2014-09-03 Thread Nitin Garg
On 09/03/2014 07:10 PM, Fabio Estevam wrote:
> On Tue, Sep 2, 2014 at 10:55 PM, Nitin Garg  wrote:
> 
>> In the macros of HAB, like:
>> hab_rvt_report_event_p
>>
>> The compiler generates bhi instead of bgt.
> 
> hab_rvt_report_event_p exists prior to this patch. Is the issue
> present in current code then?
> 
> If so, it should be handled on a separate patch.
> 
I will remove the typecast as its not essential (I stepped
through the code today and its fine).
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] buildman fails if branch specifier contains a'/'

2014-09-03 Thread Steve Rae

example:

$ tools/buildman/buildman -b dev/to_denx broadcom
No section: 'make-flags'
boards.cfg is up to date. Nothing to do.
Building 1 commit for 4 boards (4 threads, 2 jobs per thread)
Traceback (most recent call last):
  File "tools/buildman/buildman", line 139, in 
control.DoBuildman(options, args)
  File "/home/srae/work/to_denx/tools/buildman/control.py", line 221, 
in DoBuildman

options.keep_outputs, options.verbose)
  File "/home/srae/work/to_denx/tools/buildman/builder.py", line 1040, 
in BuildBoards

builderthread.Mkdir(self.base_dir)
  File "/home/srae/work/to_denx/tools/buildman/builderthread.py", line 
22, in Mkdir

os.mkdir(dirname)
OSError: [Errno 2] No such file or directory: '../dev/to_denx'
$
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Support i.MX6 High Assurance Boot (HAB) authentication of images

2014-09-03 Thread Fabio Estevam
On Tue, Sep 2, 2014 at 10:55 PM, Nitin Garg  wrote:

> In the macros of HAB, like:
> hab_rvt_report_event_p
>
> The compiler generates bhi instead of bgt.

hab_rvt_report_event_p exists prior to this patch. Is the issue
present in current code then?

If so, it should be handled on a separate patch.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 5/6] arm: debug: add Kconfig entries for lowlevel debug

2014-09-03 Thread Simon Glass
Hi Masahiro,

On 31 August 2014 20:06, Masahiro Yamada  wrote:
> We have not had a good method to debug the early boot stage such as
> lowlevel_init function.  I guess developers generally use dedicated
> debuggers for that, but it is difficult in some cases.
> (For example, my debugger cannot connect to the ARM processor when
> it is in the secure state.  It sometimes happens when I need to
> debug the early boot stage on ARM SoCs with secure extension.)
>
> The low level debug feature in Linux would be also helpful for U-boot
> when we are stucking in nasty problems where the console is not
> available yet.
>
> You have to enable CONFIG_DEBUG_LL to use this feature.
> For now, only 8250-compatible UART devices are supported.
> You can add a header file under arch/arm/include/debug/ directory
> to support your UART device if necessary.
>
> Signed-off-by: Masahiro Yamada 

Is it possible to use the existing drivers for this? It seems
unfortunate to duplicate the ns16550 driver (if that is what has
happened).

E.g. I have had good luck just calling that driver code directly. I'm
not sure of an overall framework but it must be possible...

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


Re: [U-Boot] [PATCH v2 3/4] kconfig: fix savedefconfig to handle TPL correctly

2014-09-03 Thread Simon Glass
On 3 September 2014 17:51, Simon Glass  wrote:
> On 3 September 2014 14:41, Masahiro Yamada  wrote:
>> Since 3ff291f371fa9858426774f3732924bacb61ed1c
>> (kconfig: convert Kconfig helper script into a shell script),
>> "make savedefconfig" of TPL boards has not been working.
>>
>> Signed-off-by: Masahiro Yamada 

I mean:

Acked-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 4/4] kconfig: fix a bug of "make config"

2014-09-03 Thread Simon Glass
On 3 September 2014 14:41, Masahiro Yamada  wrote:
> Since 3ff291f371fa9858426774f3732924bacb61ed1c
> (kconfig: convert Kconfig helper script into a shell script),
> "make config" is not working because of a missing '$' before '(Q)'.
>
> Besides, "make config" should be invoked via scripts/multiconfig.sh
> to avoid a warning message:
> Kconfig:11:warning: environment variable KCONFIG_OBJDIR undefined
>
> Signed-off-by: Masahiro Yamada 

Acked-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 3/4] kconfig: fix savedefconfig to handle TPL correctly

2014-09-03 Thread Simon Glass
On 3 September 2014 14:41, Masahiro Yamada  wrote:
> Since 3ff291f371fa9858426774f3732924bacb61ed1c
> (kconfig: convert Kconfig helper script into a shell script),
> "make savedefconfig" of TPL boards has not been working.
>
> Signed-off-by: Masahiro Yamada 

Acked-by: Simon Glass http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/4] kconfig: fix whitespace handling bug of savedefconfig

2014-09-03 Thread Simon Glass
Hi Masahiro,

On 3 September 2014 14:41, Masahiro Yamada  wrote:
> Commit 3ff291f371fa9858426774f3732924bacb61ed1c
> (kconfig: convert Kconfig helper script into a shell script)
> introduced another regression.
>
> Shell usually handles whitespaces as separators,
> so "make saveconfig" outputs
>
>   # CONFIG_FOO is not set
>
> into:
>
>   #
>   CONFIG_FOO
>   is
>   not
>   set
>
> Whitespaces should not be treated as separators here.

Oh dear...python is so much better at dealing with parameters and strings.

>
> Signed-off-by: Masahiro Yamada 

Acked-by: Simon Glass 

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


[U-Boot] [PATCH v7 04/13] dm: tegra: Set up a pre-reloc malloc()

2014-09-03 Thread Simon Glass
Allocate 1KB so that driver model can operate before relocation.

Signed-off-by: Simon Glass 
---

Changes in v7:
- Add new patch to enable pre-reloc malloc() for tegra

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/configs/tegra-common.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
index d27fceb..7852f9a 100644
--- a/include/configs/tegra-common.h
+++ b/include/configs/tegra-common.h
@@ -40,6 +40,7 @@
  * Size of malloc() pool
  */
 #define CONFIG_SYS_MALLOC_LEN  (4 << 20)   /* 4MB  */
+#define CONFIG_SYS_MALLOC_F_LEN(1 << 10)
 
 /*
  * NS16550 Configuration
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v7 03/13] dm: Make driver model available before board_init()

2014-09-03 Thread Simon Glass
For some boards board_init() will change GPIOs, so we need to have driver
model available before then. Adjust the board init to arrange this, but
enable it for driver model only, just to be safe.

This does create additional #ifdef logic, but it is safer than trying to
make a pervasive change which may cause some boards to break.

Signed-off-by: Simon Glass 
---

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
- Remove RFC status
- Add exynos serial support
- Split out core driver model patches into a separate set

 common/board_r.c| 24 +++-
 common/stdio.c  | 18 --
 include/stdio_dev.h | 24 +++-
 3 files changed, 50 insertions(+), 16 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 64beae5..6ac2b7e 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -715,6 +715,15 @@ init_fnc_t init_sequence_r[] = {
/* TODO: could x86/PPC have this also perhaps? */
 #ifdef CONFIG_ARM
initr_caches,
+#endif
+   initr_reloc_global_data,
+   initr_barrier,
+   initr_malloc,
+   bootstage_relocate,
+#ifdef CONFIG_DM
+   initr_dm,
+#endif
+#ifdef CONFIG_ARM
board_init, /* Setup chipselects */
 #endif
/*
@@ -726,16 +735,7 @@ init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_CLOCKS
set_cpu_clk_info, /* Setup clock information */
 #endif
-   initr_reloc_global_data,
-   initr_barrier,
-   initr_malloc,
-   bootstage_relocate,
-#ifdef CONFIG_DM_SERIAL
-   stdio_init,
-#endif
-#ifdef CONFIG_DM
-   initr_dm,
-#endif
+   stdio_init_tables,
initr_serial,
initr_announce,
INIT_FUNC_WATCHDOG_RESET
@@ -821,9 +821,7 @@ init_fnc_t init_sequence_r[] = {
 */
initr_pci,
 #endif
-#ifndef CONFIG_DM_SERIAL
-   stdio_init,
-#endif
+   stdio_add_devices,
initr_jumptable,
 #ifdef CONFIG_API
initr_api,
diff --git a/common/stdio.c b/common/stdio.c
index 692ca7f..c878103 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -215,7 +215,7 @@ int stdio_deregister(const char *devname)
 }
 #endif /* CONFIG_SYS_STDIO_DEREGISTER */
 
-int stdio_init (void)
+int stdio_init_tables(void)
 {
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
/* already relocated for current ARM implementation */
@@ -232,6 +232,11 @@ int stdio_init (void)
/* Initialize the list */
INIT_LIST_HEAD(&(devs.list));
 
+   return 0;
+}
+
+int stdio_add_devices(void)
+{
 #ifdef CONFIG_SYS_I2C
i2c_init_all();
 #else
@@ -265,5 +270,14 @@ int stdio_init (void)
 #ifdef CONFIG_CBMEM_CONSOLE
cbmemc_init();
 #endif
-   return (0);
+
+   return 0;
+}
+
+int stdio_init(void)
+{
+   stdio_init_tables();
+   stdio_add_devices();
+
+   return 0;
 }
diff --git a/include/stdio_dev.h b/include/stdio_dev.h
index a7d0825..268de8e 100644
--- a/include/stdio_dev.h
+++ b/include/stdio_dev.h
@@ -78,7 +78,29 @@ extern char *stdio_names[MAX_FILES];
  */
 intstdio_register (struct stdio_dev * dev);
 int stdio_register_dev(struct stdio_dev *dev, struct stdio_dev **devp);
-intstdio_init (void);
+
+/**
+ * stdio_init_tables() - set up stdio tables ready for devices
+ *
+ * This does not add any devices, but just prepares stdio for use.
+ */
+int stdio_init_tables(void);
+
+/**
+ * stdio_add_devices() - Add stdio devices to the table
+ *
+ * This makes calls to all the various subsystems that use stdio, to make
+ * them register with stdio.
+ */
+int stdio_add_devices(void);
+
+/**
+ * stdio_init() - Sets up stdio ready for use
+ *
+ * This calls stdio_init_tables() and stdio_add_devices()
+ */
+int stdio_init(void);
+
 void   stdio_print_current_devices(void);
 #ifdef CONFIG_SYS_STDIO_DEREGISTER
 intstdio_deregister(const char *devname);
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v7 07/13] exynos: Bring in pinctrl dts files from Linux kernel

2014-09-03 Thread Simon Glass
Bring in required device tree files for pinctrl from Linux v3.14. These
are initially unchanged and have a number of pieces not needed by U-Boot.

Note that exynos5420 is renamed to exynos54xx here since we want to
support exynos5422 also.

Signed-off-by: Simon Glass 
---

Changes in v7: None
Changes in v6:
- Fix typo in compatible string
- Remove exynos5420.dtsi which is not used in U-Boot

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/dts/exynos4.dtsi  |   7 +
 arch/arm/dts/exynos4210-origen.dts |   2 +-
 arch/arm/dts/exynos4210-pinctrl.dtsi   | 847 +
 arch/arm/dts/exynos4210-trats.dts  |   2 +-
 arch/arm/dts/exynos4210-universal_c210.dts |   2 +-
 arch/arm/dts/exynos4210.dtsi   | 155 +
 arch/arm/dts/exynos4412-trats2.dts |   2 +-
 arch/arm/dts/exynos4412.dtsi   |  38 ++
 arch/arm/dts/exynos4x12-pinctrl.dtsi   | 956 +
 arch/arm/dts/exynos4x12.dtsi   | 214 +++
 arch/arm/dts/exynos5.dtsi  |  54 ++
 arch/arm/dts/exynos5250-pinctrl.dtsi   | 790 
 arch/arm/dts/exynos5250.dtsi   |  38 ++
 arch/arm/dts/exynos54xx-pinctrl.dtsi   | 687 +
 arch/arm/dts/exynos54xx.dtsi   |  44 ++
 15 files changed, 3834 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-pinctrl.dtsi
 create mode 100644 arch/arm/dts/exynos4210.dtsi
 create mode 100644 arch/arm/dts/exynos4412.dtsi
 create mode 100644 arch/arm/dts/exynos4x12-pinctrl.dtsi
 create mode 100644 arch/arm/dts/exynos4x12.dtsi
 create mode 100644 arch/arm/dts/exynos5250-pinctrl.dtsi
 create mode 100644 arch/arm/dts/exynos54xx-pinctrl.dtsi

diff --git a/arch/arm/dts/exynos4.dtsi b/arch/arm/dts/exynos4.dtsi
index 6b83516..77fad48 100644
--- a/arch/arm/dts/exynos4.dtsi
+++ b/arch/arm/dts/exynos4.dtsi
@@ -10,6 +10,13 @@
 #include "skeleton.dtsi"
 
 / {
+   combiner: interrupt-controller@1044 {
+   compatible = "samsung,exynos4210-combiner";
+   #interrupt-cells = <2>;
+   interrupt-controller;
+   reg = <0x1044 0x1000>;
+   };
+
serial@1380 {
compatible = "samsung,exynos4210-uart";
reg = <0x1380 0x3c>;
diff --git a/arch/arm/dts/exynos4210-origen.dts 
b/arch/arm/dts/exynos4210-origen.dts
index 556a3a2..dd2476c 100644
--- a/arch/arm/dts/exynos4210-origen.dts
+++ b/arch/arm/dts/exynos4210-origen.dts
@@ -9,7 +9,7 @@
 
 /dts-v1/;
 #include "skeleton.dtsi"
-#include "exynos4.dtsi"
+#include "exynos4210.dtsi"
 
 / {
model = "Insignal Origen evaluation board based on Exynos4210";
diff --git a/arch/arm/dts/exynos4210-pinctrl.dtsi 
b/arch/arm/dts/exynos4210-pinctrl.dtsi
new file mode 100644
index 000..a7c2128
--- /dev/null
+++ b/arch/arm/dts/exynos4210-pinctrl.dtsi
@@ -0,0 +1,847 @@
+/*
+ * Samsung's Exynos4210 SoC pin-mux and pin-config device tree source
+ *
+ * Copyright (c) 2011-2012 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ * Copyright (c) 2011-2012 Linaro Ltd.
+ * www.linaro.org
+ *
+ * Samsung's Exynos4210 SoC pin-mux and pin-config optiosn are listed as device
+ * tree nodes are listed in this file.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+/ {
+   pinctrl@1140 {
+   gpa0: gpa0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   };
+
+   gpa1: gpa1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   };
+
+   gpb: gpb {
+   gpio-controller;
+   #gpio-cells = <2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   };
+
+   gpc0: gpc0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   };
+
+   gpc1: gpc1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   };
+
+   gpd0: gpd0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   };
+
+   gpd1: gpd1 {
+  

[U-Boot] [PATCH v7 11/13] exynos: Tidy up GPIO defines

2014-09-03 Thread Simon Glass
The defines at the top of the GPIO driver use single-character names for
parameters which are not very descriptive.

Improve these to use descriptive parameter names.

Signed-off-by: Simon Glass 
---

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/gpio/s5p_gpio.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index aa60188..99f2dd8 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -11,19 +11,20 @@
 
 #define S5P_GPIO_GET_PIN(x)(x % GPIO_PER_BANK)
 
-#define CON_MASK(x)(0xf << ((x) << 2))
-#define CON_SFR(x, v)  ((v) << ((x) << 2))
+#define CON_MASK(val)  (0xf << ((val) << 2))
+#define CON_SFR(gpio, cfg) ((cfg) << ((gpio) << 2))
+#define CON_SFR_UNSHIFT(val, gpio) ((val) >> ((gpio) << 2))
 
-#define DAT_MASK(x)(0x1 << (x))
-#define DAT_SET(x) (0x1 << (x))
+#define DAT_MASK(gpio) (0x1 << (gpio))
+#define DAT_SET(gpio)  (0x1 << (gpio))
 
-#define PULL_MASK(x)   (0x3 << ((x) << 1))
-#define PULL_MODE(x, v)((v) << ((x) << 1))
+#define PULL_MASK(gpio)(0x3 << ((gpio) << 1))
+#define PULL_MODE(gpio, pull)  ((pull) << ((gpio) << 1))
 
-#define DRV_MASK(x)(0x3 << ((x) << 1))
-#define DRV_SET(x, m)  ((m) << ((x) << 1))
-#define RATE_MASK(x)   (0x1 << (x + 16))
-#define RATE_SET(x)(0x1 << (x + 16))
+#define DRV_MASK(gpio) (0x3 << ((gpio) << 1))
+#define DRV_SET(gpio, mode)((mode) << ((gpio) << 1))
+#define RATE_MASK(gpio)(0x1 << (gpio + 16))
+#define RATE_SET(gpio) (0x1 << (gpio + 16))
 
 #define name_to_gpio(n) s5p_name_to_gpio(n)
 static inline int s5p_name_to_gpio(const char *name)
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v7 05/13] tegra: Convert tegra GPIO driver to use driver model

2014-09-03 Thread Simon Glass
This is an implementation of GPIOs for Tegra that uses driver model. It has
been tested on trimslice and also using the new iotrace feature.

The implementation uses a top-level GPIO device (which has no actual GPIOS).
Under this all the banks are created as separate GPIO devices.

The GPIOs are named as per the Tegra datasheet/header files: A0..A7, B0..B7,
..., Z0..Z7, AA0..AA7, etc.

Since driver model is not yet available before relocation, or in SPL, a
special function is provided for seaboard's SPL code.

Signed-off-by: Simon Glass 
---

Changes in v7:
- Set up pin config in tegra_spl_gpio_direction_output()

Changes in v6:
- Use base_gpio instead of base_port for simplicity
- Add an implementation of the get_function() method

Changes in v5: None
Changes in v4:
- Rename struct device to struct udevice

Changes in v3:
- Move dm command enable to previous patch
- Use gpio number for the internal helper functions

Changes in v2:
- Split out driver model changes into separate patches
- Correct bugs found during testing

 arch/arm/include/asm/arch-tegra/gpio.h |  15 +-
 board/nvidia/seaboard/seaboard.c   |   2 +-
 drivers/gpio/tegra_gpio.c  | 327 +++--
 include/configs/tegra-common.h |   1 +
 4 files changed, 283 insertions(+), 62 deletions(-)

diff --git a/arch/arm/include/asm/arch-tegra/gpio.h 
b/arch/arm/include/asm/arch-tegra/gpio.h
index 44cd455..7334e0c 100644
--- a/arch/arm/include/asm/arch-tegra/gpio.h
+++ b/arch/arm/include/asm/arch-tegra/gpio.h
@@ -6,6 +6,8 @@
 #ifndef _TEGRA_GPIO_H_
 #define _TEGRA_GPIO_H_
 
+#define TEGRA_GPIOS_PER_PORT   8
+#define TEGRA_PORTS_PER_BANK   4
 #define MAX_NUM_GPIOS   (TEGRA_GPIO_PORTS * TEGRA_GPIO_BANKS * 8)
 #define GPIO_NAME_SIZE 20  /* gpio_request max label len */
 
@@ -25,9 +27,14 @@ struct tegra_gpio_config {
u32 init:2;
 };
 
-/*
- * Tegra-specific GPIO API
+/**
+ * tegra_spl_gpio_direction_output() - set the output value of a GPIO
+ *
+ * This function is only used from SPL on seaboard, which needs to enable a
+ * GPIO to get the UART running. It could be done in U-Boot rather than SPL,
+ * but for now, this gets it working
  */
+int tegra_spl_gpio_direction_output(int gpio, int value);
 
 /**
  * Configure a list of GPIOs
@@ -37,8 +44,4 @@ struct tegra_gpio_config {
  */
 void gpio_config_table(const struct tegra_gpio_config *config, int len);
 
-void gpio_info(void);
-
-#define gpio_status()  gpio_info()
-
 #endif /* TEGRA_GPIO_H_ */
diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index ce2db40..6a243f0 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -22,7 +22,7 @@ void gpio_early_init_uart(void)
 #ifndef CONFIG_SPL_BUILD
gpio_request(GPIO_PI3, NULL);
 #endif
-   gpio_direction_output(GPIO_PI3, 0);
+   tegra_spl_gpio_direction_output(GPIO_PI3, 0);
 }
 #endif
 
diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c
index fea9d17..1cc4abb 100644
--- a/drivers/gpio/tegra_gpio.c
+++ b/drivers/gpio/tegra_gpio.c
@@ -12,10 +12,17 @@
  */
 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
 
 enum {
TEGRA_CMD_INFO,
@@ -24,14 +31,18 @@ enum {
TEGRA_CMD_INPUT,
 };
 
-static struct gpio_names {
-   char name[GPIO_NAME_SIZE];
-} gpio_names[MAX_NUM_GPIOS];
+struct tegra_gpio_platdata {
+   struct gpio_ctlr_bank *bank;
+   const char *port_name;  /* Name of port, e.g. "B" */
+   int base_gpio;  /* Port number for this port (0, 1,.., n-1) */
+};
 
-static char *get_name(int i)
-{
-   return *gpio_names[i].name ? gpio_names[i].name : "UNKNOWN";
-}
+/* Information about each port at run-time */
+struct tegra_port_info {
+   char label[TEGRA_GPIOS_PER_PORT][GPIO_NAME_SIZE];
+   struct gpio_ctlr_bank *bank;
+   int base_gpio;  /* Port number for this port (0, 1,.., n-1) */
+};
 
 /* Return config of pin 'gpio' as GPIO (1) or SFPIO (0) */
 static int get_config(unsigned gpio)
@@ -121,38 +132,72 @@ static void set_level(unsigned gpio, int high)
writel(u, &bank->gpio_out[GPIO_PORT(gpio)]);
 }
 
+static int check_reserved(struct udevice *dev, unsigned offset,
+ const char *func)
+{
+   struct tegra_port_info *state = dev_get_priv(dev);
+   struct gpio_dev_priv *uc_priv = dev->uclass_priv;
+
+   if (!*state->label[offset]) {
+   printf("tegra_gpio: %s: error: gpio %s%d not reserved\n",
+  func, uc_priv->bank_name, offset);
+   return -EBUSY;
+   }
+
+   return 0;
+}
+
+/* set GPIO pin 'gpio' as an output, with polarity 'value' */
+int tegra_spl_gpio_direction_output(int gpio, int value)
+{
+   /* Configure as a GPIO */
+   set_config(gpio, 1);
+
+   /* Configure GPIO output value. */
+   set_level(gpio, value);
+
+   /* Configure GPIO 

[U-Boot] [PATCH v7 12/13] exynos: Make sure that GPIOs are requested

2014-09-03 Thread Simon Glass
With driver model GPIOs must be requested before use. Make sure this is
done correctly.

(Note that the soft SPI part of universal is omitted, since this driver
is about to be replaced with a driver-model-aware version)

Signed-off-by: Simon Glass 
---

Changes in v7: None
Changes in v6: None
Changes in v5:
- Add additional gpio_request() calls for other samsung boards
- Use a mask instead of division in gpio_request() naming call

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/armv7/exynos/pinmux.c   |  3 +++
 board/samsung/arndale/arndale.c  |  2 ++
 board/samsung/common/misc.c  |  2 ++
 board/samsung/goni/goni.c|  2 ++
 board/samsung/smdk5250/exynos5-dt.c  |  7 +++
 board/samsung/smdk5420/smdk5420.c|  4 
 board/samsung/trats/trats.c  | 15 ---
 board/samsung/trats2/trats2.c| 26 +-
 board/samsung/universal_c210/universal.c |  3 +++
 drivers/mmc/s5p_sdhci.c  |  7 ++-
 10 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 8cc4e9c..fb1375d 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -172,6 +172,9 @@ static int exynos5420_mmc_config(int peripheral, int flags)
 * this same assumption.
 */
if ((peripheral == PERIPH_ID_SDMMC0) && (i == (start + 2))) {
+#ifndef CONFIG_SPL_BUILD
+   gpio_request(i, "sdmmc0_vdden");
+#endif
gpio_set_value(i, 1);
gpio_cfg_pin(i, S5P_GPIO_OUTPUT);
} else {
diff --git a/board/samsung/arndale/arndale.c b/board/samsung/arndale/arndale.c
index e39795d..881d080 100644
--- a/board/samsung/arndale/arndale.c
+++ b/board/samsung/arndale/arndale.c
@@ -19,6 +19,8 @@ int board_usb_init(int index, enum usb_init_type init)
/* Configure gpios for usb 3503 hub:
 * disconnect, toggle reset and connect
 */
+   gpio_request(EXYNOS5_GPIO_D17, "usb_connect");
+   gpio_request(EXYNOS5_GPIO_X35, "usb_reset");
gpio_direction_output(EXYNOS5_GPIO_D17, 0);
gpio_direction_output(EXYNOS5_GPIO_X35, 0);
 
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index a79119a..d274eb6 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -362,6 +362,8 @@ void check_boot_mode(void)
 void keys_init(void)
 {
/* Set direction to input */
+   gpio_request(KEY_VOL_UP_GPIO, "volume-up");
+   gpio_request(KEY_VOL_DOWN_GPIO, "volume-down");
gpio_direction_input(KEY_VOL_UP_GPIO);
gpio_direction_input(KEY_VOL_DOWN_GPIO);
 }
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index 01be714..22f4995 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -80,6 +80,7 @@ int board_mmc_init(bd_t *bis)
int i, ret, ret_sd = 0;
 
/* MASSMEMORY_EN: XMSMDATA7: GPJ2[7] output high */
+   gpio_request(S5PC110_GPIO_J27, "massmemory_en");
gpio_direction_output(S5PC110_GPIO_J27, 1);
 
/*
@@ -108,6 +109,7 @@ int board_mmc_init(bd_t *bis)
 * SD card (T_FLASH) detect and init
 * T_FLASH_DETECT: EINT28: GPH3[4] input mode
 */
+   gpio_request(S5PC110_GPIO_H34, "t_flash_detect");
gpio_cfg_pin(S5PC110_GPIO_H34, S5P_GPIO_INPUT);
gpio_set_pull(S5PC110_GPIO_H34, S5P_GPIO_PULL_UP);
 
diff --git a/board/samsung/smdk5250/exynos5-dt.c 
b/board/samsung/smdk5250/exynos5-dt.c
index d6ce133..53ff706 100644
--- a/board/samsung/smdk5250/exynos5-dt.c
+++ b/board/samsung/smdk5250/exynos5-dt.c
@@ -29,6 +29,7 @@ DECLARE_GLOBAL_DATA_PTR;
 static void board_enable_audio_codec(void)
 {
/* Enable MAX98095 Codec */
+   gpio_request(EXYNOS5_GPIO_X17, "max98095_enable");
gpio_direction_output(EXYNOS5_GPIO_X17, 1);
gpio_set_pull(EXYNOS5_GPIO_X17, S5P_GPIO_PULL_NONE);
 }
@@ -199,16 +200,19 @@ static int board_dp_bridge_setup(void)
/* Setup the GPIOs */
 
/* PD is ACTIVE_LOW, and initially de-asserted */
+   gpio_request(EXYNOS5_GPIO_Y25, "dp_bridge_pd");
gpio_set_pull(EXYNOS5_GPIO_Y25, S5P_GPIO_PULL_NONE);
gpio_direction_output(EXYNOS5_GPIO_Y25, 1);
 
/* Reset is ACTIVE_LOW */
+   gpio_request(EXYNOS5_GPIO_X15, "dp_bridge_reset");
gpio_set_pull(EXYNOS5_GPIO_X15, S5P_GPIO_PULL_NONE);
gpio_direction_output(EXYNOS5_GPIO_X15, 0);
 
udelay(10);
gpio_set_value(EXYNOS5_GPIO_X15, 1);
 
+   gpio_request(EXYNOS5_GPIO_X07, "dp_bridge_hpd");
gpio_direction_input(EXYNOS5_GPIO_X07);
 
/*
@@ -236,10 +240,12 @@ static int board_dp_bridge_setup(void)
 void exynos_cfg_lcd_gpio(void)
 {
/* For Backlight */
+   gpio_request(EXYNOS5_GPIO_B20, "lcd_backlight");
gpio_cfg_pin(EXYNOS5_GPIO_B20, 

[U-Boot] [PATCH v7 08/13] exynos: dts: Remove unused pinctrl information to save space

2014-09-03 Thread Simon Glass
We don't include the pinctrl functions for U-Boot as they use up quite
a bit of space and are not used.

We could instead perhaps eliminate this material with fdtgrep, but so far
this tool has not made it to upstream.

Signed-off-by: Simon Glass 
---

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/dts/exynos4210-pinctrl.dtsi | 543 ---
 arch/arm/dts/exynos4x12-pinctrl.dtsi | 612 ---
 arch/arm/dts/exynos4x12.dtsi | 100 --
 arch/arm/dts/exynos5250-pinctrl.dtsi | 459 --
 arch/arm/dts/exynos54xx-pinctrl.dtsi | 384 --
 5 files changed, 2098 deletions(-)

diff --git a/arch/arm/dts/exynos4210-pinctrl.dtsi 
b/arch/arm/dts/exynos4210-pinctrl.dtsi
index a7c2128..bda17f7 100644
--- a/arch/arm/dts/exynos4210-pinctrl.dtsi
+++ b/arch/arm/dts/exynos4210-pinctrl.dtsi
@@ -144,281 +144,6 @@
#interrupt-cells = <2>;
};
 
-   uart0_data: uart0-data {
-   samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <0x2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart0_fctl: uart0-fctl {
-   samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart1_data: uart1-data {
-   samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart1_fctl: uart1-fctl {
-   samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   i2c2_bus: i2c2-bus {
-   samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart2_data: uart2-data {
-   samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart2_fctl: uart2-fctl {
-   samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart_audio_a: uart-audio-a {
-   samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   i2c3_bus: i2c3-bus {
-   samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart3_data: uart3-data {
-   samsung,pins = "gpa1-4", "gpa1-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart_audio_b: uart-audio-b {
-   samsung,pins = "gpa1-4", "gpa1-5";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   spi0_bus: spi0-bus {
-   samsung,pins = "gpb-0", "gpb-2", "gpb-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
-   };
-
-   i2c4_bus: i2c4-bus {
-   samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
-   };
-
-   spi1_bus: spi1-bus {
-   samsung,pins = "gpb-4", "gpb-6", "gpb-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
-   };
-
-   i2c5_bus: i2c5-bus {
-   samsung,pins = "gpb-6", "gpb-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
- 

[U-Boot] [PATCH v7 02/13] Set up stdio earlier when using driver model

2014-09-03 Thread Simon Glass
Since driver model registers itself with the stdio subsystem, and we
want to avoid delayed registration and other complexity associated with
the current serial console, move the stdio subsystem init earlier when
driver model is used for serial.

This simplifies the implementation. Should there be any problems with
this approach they can be dealt with as boards are converted over to
use driver model for serial.

Signed-off-by: Simon Glass 
---

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 common/board_r.c | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index f9647e1..64beae5 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -727,6 +727,15 @@ init_fnc_t init_sequence_r[] = {
set_cpu_clk_info, /* Setup clock information */
 #endif
initr_reloc_global_data,
+   initr_barrier,
+   initr_malloc,
+   bootstage_relocate,
+#ifdef CONFIG_DM_SERIAL
+   stdio_init,
+#endif
+#ifdef CONFIG_DM
+   initr_dm,
+#endif
initr_serial,
initr_announce,
INIT_FUNC_WATCHDOG_RESET
@@ -763,12 +772,6 @@ init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_WINBOND_83C553
initr_w83c553f,
 #endif
-   initr_barrier,
-   initr_malloc,
-   bootstage_relocate,
-#ifdef CONFIG_DM
-   initr_dm,
-#endif
 #ifdef CONFIG_ARCH_EARLY_INIT_R
arch_early_init_r,
 #endif
@@ -818,7 +821,9 @@ init_fnc_t init_sequence_r[] = {
 */
initr_pci,
 #endif
+#ifndef CONFIG_DM_SERIAL
stdio_init,
+#endif
initr_jumptable,
 #ifdef CONFIG_API
initr_api,
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v7 09/13] exynos: dts: Adjust device tree files for U-Boot

2014-09-03 Thread Simon Glass
The pinctrl bindings used by Linux are an incomplete description of the
hardware. It is possible in most cases to determine the register address
of each, but not in all cases. By adding an additional property we can
fix this, and avoid adding a table to U-Boot for every single Exynos
SOC.

Signed-off-by: Simon Glass 
---

Changes in v7: None
Changes in v6:
- Move U-Boot changes into their own file
- Use exynos54xx everywhere instead of exynos5420

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/dts/exynos4210-pinctrl-uboot.dtsi | 27 
 arch/arm/dts/exynos4210-pinctrl.dtsi   |  2 ++
 arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi | 46 ++
 arch/arm/dts/exynos4x12-pinctrl.dtsi   |  2 ++
 arch/arm/dts/exynos5250-pinctrl-uboot.dtsi | 40 +++
 arch/arm/dts/exynos5250-pinctrl.dtsi   |  2 ++
 arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi | 52 ++
 arch/arm/dts/exynos54xx-pinctrl.dtsi   |  2 ++
 arch/arm/dts/exynos54xx.dtsi   | 11 +++
 9 files changed, 184 insertions(+)
 create mode 100644 arch/arm/dts/exynos4210-pinctrl-uboot.dtsi
 create mode 100644 arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi
 create mode 100644 arch/arm/dts/exynos5250-pinctrl-uboot.dtsi
 create mode 100644 arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi

diff --git a/arch/arm/dts/exynos4210-pinctrl-uboot.dtsi 
b/arch/arm/dts/exynos4210-pinctrl-uboot.dtsi
new file mode 100644
index 000..ee071c1
--- /dev/null
+++ b/arch/arm/dts/exynos4210-pinctrl-uboot.dtsi
@@ -0,0 +1,27 @@
+/*
+ * U-Boot additions to enable a generic Exynos GPIO driver
+ *
+ * Copyright (c) 2014 Google, Inc
+ */
+
+/{
+   pinctrl_0: pinctrl@1140 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "samsung,exynos4210-pinctrl";
+   };
+
+   pinctrl_1: pinctrl@1100 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   gpy0: gpy0 {
+   reg = <0xc00>;
+   };
+   };
+
+   pinctrl_2: pinctrl@0386 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
+
+};
diff --git a/arch/arm/dts/exynos4210-pinctrl.dtsi 
b/arch/arm/dts/exynos4210-pinctrl.dtsi
index bda17f7..87f162b 100644
--- a/arch/arm/dts/exynos4210-pinctrl.dtsi
+++ b/arch/arm/dts/exynos4210-pinctrl.dtsi
@@ -14,6 +14,8 @@
  * published by the Free Software Foundation.
 */
 
+#include "exynos4210-pinctrl-uboot.dtsi"
+
 / {
pinctrl@1140 {
gpa0: gpa0 {
diff --git a/arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi 
b/arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi
new file mode 100644
index 000..c02796d
--- /dev/null
+++ b/arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi
@@ -0,0 +1,46 @@
+/*
+ * U-Boot additions to enable a generic Exynos GPIO driver
+ *
+ * Copyright (c) 2014 Google, Inc
+ */
+
+/{
+   pinctrl_0: pinctrl@1140 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   gpf0: gpf0 {
+   reg = <0xc180>;
+   };
+   gpj0: gpj0 {
+   reg = <0x240>;
+   };
+   };
+
+   pinctrl_1: pinctrl@1100 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   gpk0: gpk0 {
+   reg = <0x40>;
+   };
+   gpm0: gpm0 {
+   reg = <0x260>;
+   };
+   gpy0: gpy0 {
+   reg = <0x120>;
+   };
+   gpx0: gpx0 {
+   reg = <0xc00>;
+   };
+   };
+
+   pinctrl_2: pinctrl@0386 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
+
+   pinctrl_3: pinctrl@106E {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
+
+};
diff --git a/arch/arm/dts/exynos4x12-pinctrl.dtsi 
b/arch/arm/dts/exynos4x12-pinctrl.dtsi
index 93f3998..f40de1f 100644
--- a/arch/arm/dts/exynos4x12-pinctrl.dtsi
+++ b/arch/arm/dts/exynos4x12-pinctrl.dtsi
@@ -12,6 +12,8 @@
  * published by the Free Software Foundation.
 */
 
+#include "exynos4x12-pinctrl-uboot.dtsi"
+
 / {
pinctrl@1140 {
gpa0: gpa0 {
diff --git a/arch/arm/dts/exynos5250-pinctrl-uboot.dtsi 
b/arch/arm/dts/exynos5250-pinctrl-uboot.dtsi
new file mode 100644
index 000..7edb0ca
--- /dev/null
+++ b/arch/arm/dts/exynos5250-pinctrl-uboot.dtsi
@@ -0,0 +1,40 @@
+/*
+ * U-Boot additions to enable a generic Exynos GPIO driver
+ *
+ * Copyright (c) 2014 Google, Inc
+ */
+
+/{
+   pinctrl_0: pinctrl@1140 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   gpc4: gpc4 {
+   reg = <0x2e0>;
+   };
+   gpx0: gpx0 {
+   reg = <0xc00>;
+   };
+   

[U-Boot] [PATCH v7 06/13] exynos: dts: Convert /include/ to #include

2014-09-03 Thread Simon Glass
We should be consistent about this. The kernel has moved to #include
which breaks error reporting to some extent but does allow us to include
binding files.

Signed-off-by: Simon Glass 
---

Changes in v7: None
Changes in v6: None
Changes in v5:
- Put this patch before the others to avoid breaking bisectability

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/dts/exynos4.dtsi  | 2 +-
 arch/arm/dts/exynos4210-origen.dts | 4 ++--
 arch/arm/dts/exynos4210-smdkv310.dts   | 2 +-
 arch/arm/dts/exynos4210-trats.dts  | 2 +-
 arch/arm/dts/exynos4210-universal_c210.dts | 2 +-
 arch/arm/dts/exynos4412-trats2.dts | 2 +-
 arch/arm/dts/exynos5.dtsi  | 2 +-
 arch/arm/dts/exynos5250-smdk5250.dts   | 2 +-
 arch/arm/dts/exynos5250-snow.dts   | 2 +-
 arch/arm/dts/exynos5250.dtsi   | 2 +-
 arch/arm/dts/exynos5420-peach-pit.dts  | 2 +-
 arch/arm/dts/exynos5420-smdk5420.dts   | 2 +-
 arch/arm/dts/exynos54xx.dtsi   | 2 +-
 arch/arm/dts/s5pc1xx-goni.dts  | 2 +-
 arch/arm/dts/s5pc1xx-smdkc100.dts  | 2 +-
 15 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/arm/dts/exynos4.dtsi b/arch/arm/dts/exynos4.dtsi
index 110eb43..6b83516 100644
--- a/arch/arm/dts/exynos4.dtsi
+++ b/arch/arm/dts/exynos4.dtsi
@@ -7,7 +7,7 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
serial@1380 {
diff --git a/arch/arm/dts/exynos4210-origen.dts 
b/arch/arm/dts/exynos4210-origen.dts
index 15059d2..556a3a2 100644
--- a/arch/arm/dts/exynos4210-origen.dts
+++ b/arch/arm/dts/exynos4210-origen.dts
@@ -8,8 +8,8 @@
  */
 
 /dts-v1/;
-/include/ "skeleton.dtsi"
-/include/ "exynos4.dtsi"
+#include "skeleton.dtsi"
+#include "exynos4.dtsi"
 
 / {
model = "Insignal Origen evaluation board based on Exynos4210";
diff --git a/arch/arm/dts/exynos4210-smdkv310.dts 
b/arch/arm/dts/exynos4210-smdkv310.dts
index c390c8f..00cad04 100644
--- a/arch/arm/dts/exynos4210-smdkv310.dts
+++ b/arch/arm/dts/exynos4210-smdkv310.dts
@@ -7,7 +7,7 @@
  */
 
 /dts-v1/;
-/include/ "exynos4.dtsi"
+#include "exynos4.dtsi"
 
 / {
model = "Samsung SMDKV310 on Exynos4210";
diff --git a/arch/arm/dts/exynos4210-trats.dts 
b/arch/arm/dts/exynos4210-trats.dts
index 0ff6939..71202d0 100644
--- a/arch/arm/dts/exynos4210-trats.dts
+++ b/arch/arm/dts/exynos4210-trats.dts
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "exynos4.dtsi"
+#include "exynos4.dtsi"
 
 / {
model = "Samsung Trats based on Exynos4210";
diff --git a/arch/arm/dts/exynos4210-universal_c210.dts 
b/arch/arm/dts/exynos4210-universal_c210.dts
index 6941906..d30f131 100644
--- a/arch/arm/dts/exynos4210-universal_c210.dts
+++ b/arch/arm/dts/exynos4210-universal_c210.dts
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "exynos4.dtsi"
+#include "exynos4.dtsi"
 
 / {
model = "Samsung Universal C210 based on Exynos4210 rev0";
diff --git a/arch/arm/dts/exynos4412-trats2.dts 
b/arch/arm/dts/exynos4412-trats2.dts
index cc58c87..9d22de7 100644
--- a/arch/arm/dts/exynos4412-trats2.dts
+++ b/arch/arm/dts/exynos4412-trats2.dts
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "exynos4.dtsi"
+#include "exynos4.dtsi"
 
 / {
model = "Samsung Trats2 based on Exynos4412";
diff --git a/arch/arm/dts/exynos5.dtsi b/arch/arm/dts/exynos5.dtsi
index a2b533a..329a89a 100644
--- a/arch/arm/dts/exynos5.dtsi
+++ b/arch/arm/dts/exynos5.dtsi
@@ -5,7 +5,7 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
compatible = "samsung,exynos5";
diff --git a/arch/arm/dts/exynos5250-smdk5250.dts 
b/arch/arm/dts/exynos5250-smdk5250.dts
index 9020382..8850409 100644
--- a/arch/arm/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/dts/exynos5250-smdk5250.dts
@@ -10,7 +10,7 @@
 */
 
 /dts-v1/;
-/include/ "exynos5250.dtsi"
+#include "exynos5250.dtsi"
 
 / {
model = "SAMSUNG SMDK5250 board based on EXYNOS5250";
diff --git a/arch/arm/dts/exynos5250-snow.dts b/arch/arm/dts/exynos5250-snow.dts
index ab4f2f8..2003412 100644
--- a/arch/arm/dts/exynos5250-snow.dts
+++ b/arch/arm/dts/exynos5250-snow.dts
@@ -10,7 +10,7 @@
 */
 
 /dts-v1/;
-/include/ "exynos5250.dtsi"
+#include "exynos5250.dtsi"
 
 / {
model = "Google Snow";
diff --git a/arch/arm/dts/exynos5250.dtsi b/arch/arm/dts/exynos5250.dtsi
index 0c644e7..771f8d3 100644
--- a/arch/arm/dts/exynos5250.dtsi
+++ b/arch/arm/dts/exynos5250.dtsi
@@ -5,7 +5,7 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-/include/ "exynos5.dtsi"
+#include "exynos5.dtsi"
 
 / {
i2c@12ca {
diff --git a/arch/arm/dts/exynos5420-peach-pit.dts 
b/arch/arm/dts/exynos5420-peach-pit.dts
index 995e62b..c4c4b8e 100644
--- a/arch/arm/dts/exynos5420-peach-pit.dts
+++ b/arch/arm/dts/exynos5420-peach-pit.dts
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "exynos54xx.dtsi"
+#include "exynos54xx.dtsi"
 
 / {
model = "Sam

[U-Boot] [PATCH v7 13/13] exynos: gpio: Convert to driver model

2014-09-03 Thread Simon Glass
Convert the exynos GPIO driver to driver model. This implements the generic
GPIO interface but not the extra Exynos-specific functions.

Signed-off-by: Simon Glass 
---

Changes in v7:
- Bring in patches from the SPI series to move post-reloc DM init earlier

Changes in v6: None
Changes in v5:
- Remove RFC label now that build errors are fixed
- Tidy up and update cover letter message
- Avoid reordering functions

Changes in v4:
- Add patches for exynos GPIO support

Changes in v3: None
Changes in v2: None

 drivers/gpio/s5p_gpio.c | 422 +++-
 include/configs/exynos-common.h |   4 +
 2 files changed, 290 insertions(+), 136 deletions(-)

diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index 99f2dd8..38ef14d 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -6,8 +6,15 @@
  */
 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
 
 #define S5P_GPIO_GET_PIN(x)(x % GPIO_PER_BANK)
 
@@ -26,100 +33,45 @@
 #define RATE_MASK(gpio)(0x1 << (gpio + 16))
 #define RATE_SET(gpio) (0x1 << (gpio + 16))
 
-#define name_to_gpio(n) s5p_name_to_gpio(n)
-static inline int s5p_name_to_gpio(const char *name)
+#define GPIO_NAME_SIZE 20
+
+/* Platform data for each bank */
+struct exynos_gpio_platdata {
+   struct s5p_gpio_bank *bank;
+   const char *bank_name;  /* Name of port, e.g. 'gpa0" */
+};
+
+/* Information about each bank at run-time */
+struct exynos_bank_info {
+   char label[GPIO_PER_BANK][GPIO_NAME_SIZE];
+   struct s5p_gpio_bank *bank;
+};
+
+static struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned int gpio)
 {
-   unsigned num, irregular_set_number, irregular_bank_base;
-   const struct gpio_name_num_table *tabp;
-   char this_bank, bank_name, irregular_bank_name;
-   char *endp;
-
-   /*
-* The gpio name starts with either 'g' or 'gp' followed by the bank
-* name character. Skip one or two characters depending on the prefix.
-*/
-   if (name[0] == 'g' && name[1] == 'p')
-   name += 2;
-   else if (name[0] == 'g')
-   name++;
-   else
-   return -1; /* Name must start with 'g' */
-
-   bank_name = *name++;
-   if (!*name)
-   return -1; /* At least one digit is required/expected. */
-
-   /*
-* On both exynos5 and exynos5420 architectures there is a bank of
-* GPIOs which does not fall into the regular address pattern. Those
-* banks are c4 on Exynos5 and y7 on Exynos5420. The rest of the below
-* assignments help to handle these irregularities.
-*/
-#if defined(CONFIG_EXYNOS4) || defined(CONFIG_EXYNOS5)
-   if (cpu_is_exynos5()) {
-   if (proid_is_exynos5420()) {
-   tabp = exynos5420_gpio_table;
-   irregular_bank_name = 'y';
-   irregular_set_number = '7';
-   irregular_bank_base = EXYNOS5420_GPIO_Y70;
-   } else {
-   tabp = exynos5_gpio_table;
-   irregular_bank_name = 'c';
-   irregular_set_number = '4';
-   irregular_bank_base = EXYNOS5_GPIO_C40;
-   }
-   } else {
-   if (proid_is_exynos4412())
-   tabp = exynos4x12_gpio_table;
-   else
-   tabp = exynos4_gpio_table;
-   irregular_bank_name = 0;
-   irregular_set_number = 0;
-   irregular_bank_base = 0;
-   }
-#else
-   if (cpu_is_s5pc110())
-   tabp = s5pc110_gpio_table;
-   else
-   tabp = s5pc100_gpio_table;
-   irregular_bank_name = 0;
-   irregular_set_number = 0;
-   irregular_bank_base = 0;
-#endif
+   const struct gpio_info *data;
+   unsigned int upto;
+   int i, count;
 
-   this_bank = tabp->bank;
-   do {
-   if (bank_name == this_bank) {
-   unsigned pin_index; /* pin number within the bank */
-   if ((bank_name == irregular_bank_name) &&
-   (name[0] == irregular_set_number)) {
-   pin_index = name[1] - '0';
-   /* Irregular sets have 8 pins. */
-   if (pin_index >= GPIO_PER_BANK)
-   return -1;
-   num = irregular_bank_base + pin_index;
-   } else {
-   pin_index = simple_strtoul(name, &endp, 8);
-   pin_index -= tabp->bank_offset;
-   /*
-* Sanity check: bunk 'z' has no set number,
-* for all other banks there must be exactly
-   

[U-Boot] [PATCH v7 01/13] dm: Move pre-reloc init earlier to cope with board_early_init_f()

2014-09-03 Thread Simon Glass
In order to support GPIO access in board_early_init_f() we must set up
driver model before this function is called. In any case, earlier is
better since driver model is (or will become) a key function for most
init.

Signed-off-by: Simon Glass 
---

Changes in v7:
- Add new patch to init driver model before board_early_init_f()

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 common/board_f.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index 4ece2b6..ea33ead 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -831,6 +831,8 @@ static init_fnc_t init_sequence_f[] = {
 #ifdef CONFIG_OF_CONTROL
fdtdec_check_fdt,
 #endif
+   initf_malloc,
+   initf_dm,
 #if defined(CONFIG_BOARD_EARLY_INIT_F)
board_early_init_f,
 #endif
@@ -866,8 +868,6 @@ static init_fnc_t init_sequence_f[] = {
sdram_adjust_866,
init_timebase,
 #endif
-   initf_malloc,
-   initf_dm,
init_baud_rate, /* initialze baudrate settings */
serial_init,/* serial communications setup */
console_init_f, /* stage 1 init of console */
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v7 10/13] exynos: Tidy up GPIO headers

2014-09-03 Thread Simon Glass
The wrong header is being included, thus requiring the code to re-declare
the generic GPIO interface in each GPIO header.

Fix this.

Signed-off-by: Simon Glass 
---

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/armv7/exynos/pinmux.c   | 2 +-
 arch/arm/include/asm/arch-exynos/gpio.h  | 5 -
 arch/arm/include/asm/arch-s5pc1xx/gpio.h | 4 
 board/samsung/arndale/arndale.c  | 2 +-
 board/samsung/common/board.c | 2 +-
 board/samsung/common/misc.c  | 1 -
 board/samsung/goni/goni.c| 2 +-
 board/samsung/origen/origen.c| 2 +-
 board/samsung/smdk5420/smdk5420.c| 2 +-
 board/samsung/smdkc100/smdkc100.c| 2 +-
 board/samsung/smdkv310/smdkv310.c| 2 +-
 board/samsung/trats/trats.c  | 2 +-
 board/samsung/trats2/trats2.c| 1 +
 board/samsung/universal_c210/universal.c | 1 -
 drivers/gpio/s5p_gpio.c  | 3 +--
 15 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 86a0c75..8cc4e9c 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -7,7 +7,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/arch/arm/include/asm/arch-exynos/gpio.h 
b/arch/arm/include/asm/arch-exynos/gpio.h
index 8fb5c23..ba169b9 100644
--- a/arch/arm/include/asm/arch-exynos/gpio.h
+++ b/arch/arm/include/asm/arch-exynos/gpio.h
@@ -1504,12 +1504,7 @@ static const struct gpio_name_num_table 
exynos5420_gpio_table[] = {
 void gpio_cfg_pin(int gpio, int cfg);
 void gpio_set_pull(int gpio, int mode);
 void gpio_set_drv(int gpio, int mode);
-int gpio_direction_input(unsigned gpio);
-int gpio_direction_output(unsigned gpio, int value);
-int gpio_set_value(unsigned gpio, int value);
-int gpio_get_value(unsigned gpio);
 void gpio_set_rate(int gpio, int mode);
-struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned gpio);
 int s5p_gpio_get_pin(unsigned gpio);
 #endif
 
diff --git a/arch/arm/include/asm/arch-s5pc1xx/gpio.h 
b/arch/arm/include/asm/arch-s5pc1xx/gpio.h
index d5dbc22..bd6f2d2 100644
--- a/arch/arm/include/asm/arch-s5pc1xx/gpio.h
+++ b/arch/arm/include/asm/arch-s5pc1xx/gpio.h
@@ -815,11 +815,7 @@ static const struct gpio_name_num_table 
s5pc110_gpio_table[] = {
 void gpio_cfg_pin(int gpio, int cfg);
 void gpio_set_pull(int gpio, int mode);
 void gpio_set_drv(int gpio, int mode);
-int gpio_direction_output(unsigned gpio, int value);
-int gpio_set_value(unsigned gpio, int value);
-int gpio_get_value(unsigned gpio);
 void gpio_set_rate(int gpio, int mode);
-struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned gpio);
 int s5p_gpio_get_pin(unsigned gpio);
 
 /* GPIO pins per bank  */
diff --git a/board/samsung/arndale/arndale.c b/board/samsung/arndale/arndale.c
index 83fd3bd..e39795d 100644
--- a/board/samsung/arndale/arndale.c
+++ b/board/samsung/arndale/arndale.c
@@ -6,9 +6,9 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 1f6f0a0..82595d1 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -13,10 +13,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 03106fd..a79119a 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index eb0f9bf..01be714 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -7,7 +7,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
index a539267..99a2fac 100644
--- a/board/samsung/origen/origen.c
+++ b/board/samsung/origen/origen.c
@@ -6,8 +6,8 @@
 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/board/samsung/smdk5420/smdk5420.c 
b/board/samsung/smdk5420/smdk5420.c
index 270ee83..47998ab 100644
--- a/board/samsung/smdk5420/smdk5420.c
+++ b/board/samsung/smdk5420/smdk5420.c
@@ -11,9 +11,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/board/samsung/smdkc100/smdkc100.c 
b/board/samsung/smdkc100/smdkc100.c
index e009564..66b6a98 100644
--- a/board/samsung/smdkc100/smdkc100.c
+++ b/board/samsung/smdkc100/smdkc100.c
@@ -7,9 +7,9 @@
  */
 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/samsung/smdkv310/smdkv310.c 
b/board/samsung/smdkv310/smdkv310.c
index 8eca358

[U-Boot] [PATCH v7 0/13] Enable driver model for GPIOs on Tegra and Exynos

2014-09-03 Thread Simon Glass
Now that driver model is part of U-Boot, the task of converting drivers over
to it begins. GPIO is one of the easiest to convert, since it already has a
sandbox driver and a uclass driver.

The Tegra GPIO driver is relatively simple since it has a linear numbering
and already uses the generic GPIO framework. Each GPIO bank has a separate
device. Some arguments have been made that a single device should support
all the GPIO banks, but currently the driver model uclass does not work that
way and it would require a second-level data structure to handle the bank
feature.

This driver has been tested on:

- Seaboard (Tegra 20)
- Beaver (Tegra 30)
- Jetson-TK1 (Tegra 124).

I don't have a Tegra 114 board (Dalmore seems to be the only one with U-Boot
support) but I am quite confident that it works.

For exynos, the pinctrl device tree files are brought in from the kernel
and cut down to remove the groupings which we don't yet use. Very small
additions are made to avoid replicating the awful tables that Linux has
for every exynos SoC. This series sits on top of the exynos refactors.

The 'gpio' command is updated to support display of only the allocated
GPIOs. This is much more friendly than displaying a large table.

A few related clean-ups are provided as well.

This series is available at u-boot-dm.git, branch working.

Changes in v7:
- Add new patch to init driver model before board_early_init_f()
- Add new patch to enable pre-reloc malloc() for tegra
- Set up pin config in tegra_spl_gpio_direction_output()
- Bring in patches from the SPI series to move post-reloc DM init earlier

Changes in v6:
- Use base_gpio instead of base_port for simplicity
- Add an implementation of the get_function() method
- Fix typo in compatible string
- Remove exynos5420.dtsi which is not used in U-Boot
- Move U-Boot changes into their own file
- Use exynos54xx everywhere instead of exynos5420

Changes in v5:
- Put this patch before the others to avoid breaking bisectability
- Add additional gpio_request() calls for other samsung boards
- Use a mask instead of division in gpio_request() naming call
- Remove RFC label now that build errors are fixed
- Tidy up and update cover letter message
- Avoid reordering functions

Changes in v4:
- Rename struct device to struct udevice
- Add patches for exynos GPIO support

Changes in v3:
- Move dm command enable to previous patch
- Use gpio number for the internal helper functions

Changes in v2:
- Remove RFC status
- Add exynos serial support
- Split out core driver model patches into a separate set
- Split out driver model changes into separate patches
- Correct bugs found during testing

Simon Glass (13):
  dm: Move pre-reloc init earlier to cope with board_early_init_f()
  Set up stdio earlier when using driver model
  dm: Make driver model available before board_init()
  dm: tegra: Set up a pre-reloc malloc()
  tegra: Convert tegra GPIO driver to use driver model
  exynos: dts: Convert /include/ to #include
  exynos: Bring in pinctrl dts files from Linux kernel
  exynos: dts: Remove unused pinctrl information to save space
  exynos: dts: Adjust device tree files for U-Boot
  exynos: Tidy up GPIO headers
  exynos: Tidy up GPIO defines
  exynos: Make sure that GPIOs are requested
  exynos: gpio: Convert to driver model

 arch/arm/cpu/armv7/exynos/pinmux.c |   5 +-
 arch/arm/dts/exynos4.dtsi  |   9 +-
 arch/arm/dts/exynos4210-origen.dts |   4 +-
 arch/arm/dts/exynos4210-pinctrl-uboot.dtsi |  27 ++
 arch/arm/dts/exynos4210-pinctrl.dtsi   | 306 
 arch/arm/dts/exynos4210-smdkv310.dts   |   2 +-
 arch/arm/dts/exynos4210-trats.dts  |   2 +-
 arch/arm/dts/exynos4210-universal_c210.dts |   2 +-
 arch/arm/dts/exynos4210.dtsi   | 155 ++
 arch/arm/dts/exynos4412-trats2.dts |   2 +-
 arch/arm/dts/exynos4412.dtsi   |  38 +++
 arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi |  46 +++
 arch/arm/dts/exynos4x12-pinctrl.dtsi   | 346 ++
 arch/arm/dts/exynos4x12.dtsi   | 114 
 arch/arm/dts/exynos5.dtsi  |  56 +++-
 arch/arm/dts/exynos5250-pinctrl-uboot.dtsi |  40 +++
 arch/arm/dts/exynos5250-pinctrl.dtsi   | 333 ++
 arch/arm/dts/exynos5250-smdk5250.dts   |   2 +-
 arch/arm/dts/exynos5250-snow.dts   |   2 +-
 arch/arm/dts/exynos5250.dtsi   |  40 ++-
 arch/arm/dts/exynos5420-peach-pit.dts  |   2 +-
 arch/arm/dts/exynos5420-smdk5420.dts   |   2 +-
 arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi |  52 
 arch/arm/dts/exynos54xx-pinctrl.dtsi   | 305 
 arch/arm/dts/exynos54xx.dtsi   |  57 +++-
 arch/arm/dts/s5pc1xx-goni.dts  |   2 +-
 arch/arm/dts/s5pc1xx-smdkc100.dts  |   2 +-
 arch/arm/include/asm/arch-exynos/gpio.h|   5 -
 arch/arm/include/asm/arch-s5pc1xx/gpio.h   |   4 -
 arch/arm/include/asm/arch-tegra/gpio.h |  15 +-
 board/nvidia/

Re: [U-Boot] [PATCH v3 0/4] introduce get_maintainer.pl

2014-09-03 Thread Simon Glass
Hi Daniel,

On 31 July 2014 18:24, Daniel Schwierzeck  wrote:
>
> This series imports get_maintainer.pl from kernel and reintroduce
> the MAINTAINERS file in the according format. Currently one have to
> manually grep all infos about board maintainers or custodians from
> various sources like git log, wiki or boards.cfg. get_maintainer.pl
> makes this task much easier. Also patman is already able to use it
> for cc-cmd.
>
> The MAINTAINERS file contains all custodians and is hand-written based
> on infos from wiki [1] and u-boot git forks [2]. Thus the source files
> infos (F:) are not complete yet. Furthermore status (S:) and
> maintainership (M:) for some custodian trees are probably wrong.
> Any help in completing and fixing that is appreciated.
>
> The get_maintainers.pl script is modified to scan multiple
> MAINTAINERS files in the board directory. This is required
> with the switch to Kconfig which adds a MAINTAINERS file per board.
>
> Examples:
>
>  $ ./scripts/get_maintainer.pl --nogit-fallback -f board/sandbox/
>Simon Glass  (maintainer:SANDBOX BOARD)
>u-boot@lists.denx.de (open list)
>
>  $ ./scripts/get_maintainer.pl --nogit-fallback -f arch/sandbox/
>Simon Glass  (maintainer:SANDBOX)
>u-boot@lists.denx.de (open list)
>
>  $ ./scripts/get_maintainer.pl --nogit-fallback -f board/sandburst/metrobox/
>Travis Sawyer  (orphan (since 
> 2014-03):METROBOX BOARD)
>u-boot@lists.denx.de (open list)
>
> This series is also available at 
> git://git.denx.de/u-boot-mips.git/maintainers_v3.

Patman now picks this up which is great. But it does sometimes produce
a long list of maintainers. I wonder if we could have an option to
turn it off (perhaps -m)?

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


Re: [U-Boot] [PATCH] patman: make run results better visible

2014-09-03 Thread Vadim Bendebury
On Wed, Sep 3, 2014 at 3:14 PM, Doug Anderson  wrote:
> Vadim,
>
> On Wed, Sep 3, 2014 at 12:16 PM, Vadim Bendebury  wrote:
>> For an occasional user of patman some failures are not obvious: for
>> instance when checkpatch reports warnings, the dry run still reports
>> that the email would be sent. If it is not dry run, the warnings are
>> shown on the screen, but it is not clear that the email was not sent.
>>
>> Add some code to report failure to send email explicitly.
>>
>> Tested by running the script on a patch with style violations,
>> observed error messages in the script output.
>>
>> Signed-off-by: Vadim Bendebury 
>> ---
>>
>>  tools/patman/patman.py | 8 +++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/patman/patman.py b/tools/patman/patman.py
>> index c60aa5a..0163ccd 100755
>> --- a/tools/patman/patman.py
>> +++ b/tools/patman/patman.py
>> @@ -154,13 +154,19 @@ else:
>>
>>  # Email the patches out (giving the user time to check / cancel)
>>  cmd = ''
>> -if ok or options.ignore_errors:
>> +its_a_go = ok or options.ignore_errors
>> +if its_a_go:
>>  cmd = gitutil.EmailPatches(series, cover_fname, args,
>>  options.dry_run, not options.ignore_bad_tags, cc_file,
>>  in_reply_to=options.in_reply_to)
>> +else:
>> +print col.Color(col.RED,
>> +"Not sending emails due to checkpatch 
>> errors/warnings")
>
> Technically it could be due to other problems, too (like errors applying).

good point, what wording would you suggest?

--vb

>
>
>>  # For a dry run, just show our actions as a sanity check
>>  if options.dry_run:
>>  series.ShowActions(args, cmd, options.process_tags)
>> +if not its_a_go:
>> +print col.Color(col.RED, "Email would not be sent")
>>
>>  os.remove(cc_file)
>
> Looks good to me, other than that.
>
> -Doug
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] patman: make run results better visible

2014-09-03 Thread Doug Anderson
Vadim,

On Wed, Sep 3, 2014 at 12:16 PM, Vadim Bendebury  wrote:
> For an occasional user of patman some failures are not obvious: for
> instance when checkpatch reports warnings, the dry run still reports
> that the email would be sent. If it is not dry run, the warnings are
> shown on the screen, but it is not clear that the email was not sent.
>
> Add some code to report failure to send email explicitly.
>
> Tested by running the script on a patch with style violations,
> observed error messages in the script output.
>
> Signed-off-by: Vadim Bendebury 
> ---
>
>  tools/patman/patman.py | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/tools/patman/patman.py b/tools/patman/patman.py
> index c60aa5a..0163ccd 100755
> --- a/tools/patman/patman.py
> +++ b/tools/patman/patman.py
> @@ -154,13 +154,19 @@ else:
>
>  # Email the patches out (giving the user time to check / cancel)
>  cmd = ''
> -if ok or options.ignore_errors:
> +its_a_go = ok or options.ignore_errors
> +if its_a_go:
>  cmd = gitutil.EmailPatches(series, cover_fname, args,
>  options.dry_run, not options.ignore_bad_tags, cc_file,
>  in_reply_to=options.in_reply_to)
> +else:
> +print col.Color(col.RED,
> +"Not sending emails due to checkpatch 
> errors/warnings")

Technically it could be due to other problems, too (like errors applying).


>  # For a dry run, just show our actions as a sanity check
>  if options.dry_run:
>  series.ShowActions(args, cmd, options.process_tags)
> +if not its_a_go:
> +print col.Color(col.RED, "Email would not be sent")
>
>  os.remove(cc_file)

Looks good to me, other than that.

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


Re: [U-Boot] [PATCH v7 1/2] net: fec_mxc: Adjust RX DMA alignment for mx6solox

2014-09-03 Thread Fabio Estevam
Hi Stefano,

On Mon, Aug 25, 2014 at 1:34 PM, Fabio Estevam
 wrote:
> mx6solox has a requirement for 64 bytes alignment for RX DMA transfer.
> Other SoCs work with the standard 32 bytes alignment.
>
> Adjust it accordingly by using 64 bytes aligment in the FEC RX DMA buffers,
> which addresses the needs from mx6solox and also works for the other SoCs.
>
> Signed-off-by: Fabio Estevam 

Could we have this series applied for 2014.10-rc ?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] arm: Make reset position-independent

2014-09-03 Thread Benoît Thébaudeau
On Wed, Sep 3, 2014 at 11:32 PM, Benoît Thébaudeau
 wrote:
> Some boards, like mx31pdk and tx25, require the beginning of the SPL
> code to be position-independent. For these two boards, this is because
> they use the i.MX external NAND boot, which starts by executing the
> first NAND Flash page from the NFC page buffer. The SPL then needs to
> copy itself to its actual link address in order to free the NFC page
> buffer and use it to load the non-SPL image from Flash before running
> it. This means that the SPL runtime address differs from its link
> address between the reset and the initial copy performed by
> board_init_f(), so this part of the SPL binary must be
> position-independent.
>
> This requirement was broken by commit 41623c9 'arm: move exception
> handling out of start.S files', which used an absolute address to branch
> to the reset routine. This new commit restores the original behavior,
> which just performed a relative branch. This fixes the boot of mx31pdk
> and tx25.
>
> Signed-off-by: Benoît Thébaudeau 
> Reported-by: Helmut Raiger 
> Cc: Albert Aribaud 
> Cc: Magnus Lilja 
> Cc: John Rigby 
> ---
>  arch/arm/lib/vectors.S |3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm/lib/vectors.S b/arch/arm/lib/vectors.S
> index 493f337..843b18f 100644
> --- a/arch/arm/lib/vectors.S
> +++ b/arch/arm/lib/vectors.S
> @@ -50,7 +50,7 @@
>  #endif
>
>  _start:
> -   ldr pc, _reset
> +   b   reset
> ldr pc, _undefined_instruction
> ldr pc, _software_interrupt
> ldr pc, _prefetch_abort
> @@ -77,7 +77,6 @@ _start:
> .globl  _irq
> .globl  _fiq
>
> -_reset:.word reset
>  _undefined_instruction:.word undefined_instruction
>  _software_interrupt:   .word software_interrupt
>  _prefetch_abort:   .word prefetch_abort
> --
> 1.7.10.4
>

Adding Helmut to Cc.

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


Re: [U-Boot] [PATCH 1/2] arm: Make reset position-independent

2014-09-03 Thread Benoît Thébaudeau
On Wed, Sep 3, 2014 at 11:32 PM, Benoît Thébaudeau
 wrote:
> Some boards, like mx31pdk and tx25, require the beginning of the SPL
> code to be position-independent. For these two boards, this is because
> they use the i.MX external NAND boot, which starts by executing the
> first NAND Flash page from the NFC page buffer. The SPL then needs to
> copy itself to its actual link address in order to free the NFC page
> buffer and use it to load the non-SPL image from Flash before running
> it. This means that the SPL runtime address differs from its link
> address between the reset and the initial copy performed by
> board_init_f(), so this part of the SPL binary must be
> position-independent.
>
> This requirement was broken by commit 41623c9 'arm: move exception
> handling out of start.S files', which used an absolute address to branch
> to the reset routine. This new commit restores the original behavior,
> which just performed a relative branch. This fixes the boot of mx31pdk
> and tx25.
>
> Signed-off-by: Benoît Thébaudeau 
> Reported-by: Helmut Raiger 
> Cc: Albert Aribaud 
> Cc: Magnus Lilja 
> Cc: John Rigby 
> ---
>  arch/arm/lib/vectors.S |3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm/lib/vectors.S b/arch/arm/lib/vectors.S
> index 493f337..843b18f 100644
> --- a/arch/arm/lib/vectors.S
> +++ b/arch/arm/lib/vectors.S
> @@ -50,7 +50,7 @@
>  #endif
>
>  _start:
> -   ldr pc, _reset
> +   b   reset
> ldr pc, _undefined_instruction
> ldr pc, _software_interrupt
> ldr pc, _prefetch_abort
> @@ -77,7 +77,6 @@ _start:
> .globl  _irq
> .globl  _fiq
>
> -_reset:.word reset
>  _undefined_instruction:.word undefined_instruction
>  _software_interrupt:   .word software_interrupt
>  _prefetch_abort:   .word prefetch_abort
> --
> 1.7.10.4
>

Magnus, can I have your 'Tested-by' for mx31pdk since you said you
have tested this?

Tom, Albert, can you build-test all ARM boards with this patch (that
would take eons on my ultra slow machine)? It would also be nice if
someone could runtime-test an ARM board other than mx31pdk and tx25
with this patch.

Thanks in advance.

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


[U-Boot] [PATCH 1/2] arm: Make reset position-independent

2014-09-03 Thread Benoît Thébaudeau
Some boards, like mx31pdk and tx25, require the beginning of the SPL
code to be position-independent. For these two boards, this is because
they use the i.MX external NAND boot, which starts by executing the
first NAND Flash page from the NFC page buffer. The SPL then needs to
copy itself to its actual link address in order to free the NFC page
buffer and use it to load the non-SPL image from Flash before running
it. This means that the SPL runtime address differs from its link
address between the reset and the initial copy performed by
board_init_f(), so this part of the SPL binary must be
position-independent.

This requirement was broken by commit 41623c9 'arm: move exception
handling out of start.S files', which used an absolute address to branch
to the reset routine. This new commit restores the original behavior,
which just performed a relative branch. This fixes the boot of mx31pdk
and tx25.

Signed-off-by: Benoît Thébaudeau 
Reported-by: Helmut Raiger 
Cc: Albert Aribaud 
Cc: Magnus Lilja 
Cc: John Rigby 
---
 arch/arm/lib/vectors.S |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/lib/vectors.S b/arch/arm/lib/vectors.S
index 493f337..843b18f 100644
--- a/arch/arm/lib/vectors.S
+++ b/arch/arm/lib/vectors.S
@@ -50,7 +50,7 @@
 #endif
 
 _start:
-   ldr pc, _reset
+   b   reset
ldr pc, _undefined_instruction
ldr pc, _software_interrupt
ldr pc, _prefetch_abort
@@ -77,7 +77,6 @@ _start:
.globl  _irq
.globl  _fiq
 
-_reset:.word reset
 _undefined_instruction:.word undefined_instruction
 _software_interrupt:   .word software_interrupt
 _prefetch_abort:   .word prefetch_abort
-- 
1.7.10.4

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


[U-Boot] [PATCH 2/2] arm: Fix _start for CONFIG_SYS_DV_NOR_BOOT_CFG

2014-09-03 Thread Benoît Thébaudeau
The boards using CONFIG_SYS_DV_NOR_BOOT_CFG (i.e. calimain,
da850evm_direct_nor and enbw_cmc) had the _start symbol defined after
the CONFIG_SYS_DV_NOR_BOOT_CFG word rather than before it in
arch/arm/lib/vectors.S. Because of that, if by lack of luck
'gd->mon_len = (ulong)&__bss_end - (ulong)_start' (see setup_mon_len())
was a multiple of 4 kiB (see reserve_uboot()), then the last BSS word
overlapped the first word of the following reserved RAM area (or went
beyond the top of RAM without such an area) after relocation because
__image_copy_start did not match _start (see relocate_code()).

This was broken by commit 41623c9 'arm: move exception handling out of
start.S files', which defined _start twice (before and after the
CONFIG_SYS_DV_NOR_BOOT_CFG word), then by commit 0a26e1d 'arm: fix a
double-definition error of _start symbol', which kept the definition of
the _start symbol after the CONFIG_SYS_DV_NOR_BOOT_CFG word. This new
commit fixes this issue by restoring the original behavior, i.e. by
defining the _start symbol before the CONFIG_SYS_DV_NOR_BOOT_CFG word.

Signed-off-by: Benoît Thébaudeau 
Cc: Albert Aribaud 
Cc: Manfred Rudigier 
Cc: Christian Riesch 
Cc: Sudhakar Rajashekhara 
Cc: Heiko Schocher 
---
 arch/arm/lib/vectors.S |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/lib/vectors.S b/arch/arm/lib/vectors.S
index 843b18f..0cb87ce 100644
--- a/arch/arm/lib/vectors.S
+++ b/arch/arm/lib/vectors.S
@@ -45,11 +45,12 @@
  *
  */
 
+_start:
+
 #ifdef CONFIG_SYS_DV_NOR_BOOT_CFG
.word   CONFIG_SYS_DV_NOR_BOOT_CFG
 #endif
 
-_start:
b   reset
ldr pc, _undefined_instruction
ldr pc, _software_interrupt
-- 
1.7.10.4

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


[U-Boot] [PATCH] common: fix include guards for CONFIG_MP

2014-09-03 Thread Gabriel Huau
This was breaking the build for some boards:
MPC8536DS MPC8536DS_36BIT MPC8536DS_SDCARD MPC8536DS_SPIFLASH qemu-ppce500

Include only these features for some PPC boards if the configuration for 
MultiProcessor
is enabled.

Signed-off-by: Gabriel Huau 
Cc: Tom Rini 
Cc: York Sun 
---
 common/board_f.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index 4ece2b6..deea9ca 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -34,7 +34,7 @@
 #ifdef CONFIG_MPC5xxx
 #include 
 #endif
-#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
+#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
 #include 
 #endif
 
@@ -392,7 +392,7 @@ static int setup_dest_addr(void)
gd->ram_top = board_get_usable_ram_top(gd->mon_len);
gd->relocaddr = gd->ram_top;
debug("Ram top: %08lX\n", (ulong)gd->ram_top);
-#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
+#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
/*
 * We need to make sure the location we intend to put secondary core
 * boot code is reserved and not used by any part of u-boot
-- 
2.0.1

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


Re: [U-Boot] [PATCH] common: fix include guards for CONFIG_MP

2014-09-03 Thread York Sun
On 09/03/2014 01:57 PM, Gabriel Huau wrote:
> This was breaking the build for some boards:
> MPC8536DS MPC8536DS_36BIT MPC8536DS_SDCARD MPC8536DS_SPIFLASH qemu-ppce500
> 
> Include only these features for some PPC boards if the configuration for 
> MultiProcessor
> is enabled.
> 
> Signed-off-by: Gabriel Huau 
> Cc: Tom Rini 
> Cc: York Sun 
> ---
>  common/board_f.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/common/board_f.c b/common/board_f.c
> index 4ece2b6..deea9ca 100644
> --- a/common/board_f.c
> +++ b/common/board_f.c
> @@ -34,7 +34,7 @@
>  #ifdef CONFIG_MPC5xxx
>  #include 
>  #endif
> -#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
> +#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
>  #include 
>  #endif
>  
> @@ -392,7 +392,7 @@ static int setup_dest_addr(void)
>   gd->ram_top = board_get_usable_ram_top(gd->mon_len);
>   gd->relocaddr = gd->ram_top;
>   debug("Ram top: %08lX\n", (ulong)gd->ram_top);
> -#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
> +#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
>   /*
>* We need to make sure the location we intend to put secondary core
>* boot code is reserved and not used by any part of u-boot
> 

Looks good.

York

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


Re: [U-Boot] [PATCH v3 1/6] vexpress64: kconfig: consolidate CONFIG_TARGET_VEXPRESS_AEMV8A_SEMI

2014-09-03 Thread Masahiro YAMADA
Tom,  (or Albert if he is ready)

Could you apply these two, please?
http://patchwork.ozlabs.org/patch/384614/
http://patchwork.ozlabs.org/patch/384616/

This kind of patches tend to cause conflicts.

-- 
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] kconfig: show an error message when defconfig is not found

2014-09-03 Thread Stephen Warren

On 09/03/2014 02:48 PM, Masahiro Yamada wrote:

When a non-existing defconfig is specified,
display an easy-to-understand message
(fake the error message on Linux Kernel):

   $ make foo_defconfig
   ***
   *** Can't find default configuration "confis/foo_defconfig"!
   ***


Echo to stderr rather than stdout seems better for an error message. I'm 
not sure the *** banner part of the message is that useful, but it's not 
a big deal.

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


[U-Boot] [PATCH] kconfig: show an error message when defconfig is not found

2014-09-03 Thread Masahiro Yamada
When a non-existing defconfig is specified,
display an easy-to-understand message
(fake the error message on Linux Kernel):

  $ make foo_defconfig
  ***
  *** Can't find default configuration "confis/foo_defconfig"!
  ***

Signed-off-by: Masahiro Yamada 
---

 scripts/multiconfig.sh | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/scripts/multiconfig.sh b/scripts/multiconfig.sh
index a579042..af8dbe1 100644
--- a/scripts/multiconfig.sh
+++ b/scripts/multiconfig.sh
@@ -118,6 +118,13 @@ do_board_defconfig () {
defconfig_path=$srctree/configs/$1
tmp_defconfig_path=configs/.tmp_defconfig
 
+   if [ ! -r $defconfig_path ]; then
+   echo "***"
+   echo "*** Can't find default configuration \"confis/$1\"!"
+   echo "***"
+   exit 1
+   fi
+
mkdir -p arch configs
# defconfig for Normal:
#  pick lines without prefixes and lines starting '+' prefix
-- 
1.9.1

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


[U-Boot] [PATCH v2 4/4] kconfig: fix a bug of "make config"

2014-09-03 Thread Masahiro Yamada
Since 3ff291f371fa9858426774f3732924bacb61ed1c
(kconfig: convert Kconfig helper script into a shell script),
"make config" is not working because of a missing '$' before '(Q)'.

Besides, "make config" should be invoked via scripts/multiconfig.sh
to avoid a warning message:
Kconfig:11:warning: environment variable KCONFIG_OBJDIR undefined

Signed-off-by: Masahiro Yamada 
---

Changes in v2:
  - Newly added

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index fdda3ec..fe7d98f 100644
--- a/Makefile
+++ b/Makefile
@@ -458,7 +458,7 @@ KBUILD_DEFCONFIG := sandbox_defconfig
 export KBUILD_DEFCONFIG KBUILD_KCONFIG
 
 config: scripts_basic outputmakefile FORCE
-   (Q)$(MAKE) $(build)=scripts/kconfig $@
+   +$(Q)$(CONFIG_SHELL) $(srctree)/scripts/multiconfig.sh $@
 
 %config: scripts_basic outputmakefile FORCE
+$(Q)$(CONFIG_SHELL) $(srctree)/scripts/multiconfig.sh $@
-- 
1.9.1

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


[U-Boot] [PATCH v2 2/4] kconfig: fix whitespace handling bug of savedefconfig

2014-09-03 Thread Masahiro Yamada
Commit 3ff291f371fa9858426774f3732924bacb61ed1c
(kconfig: convert Kconfig helper script into a shell script)
introduced another regression.

Shell usually handles whitespaces as separators,
so "make saveconfig" outputs

  # CONFIG_FOO is not set

into:

  #
  CONFIG_FOO
  is
  not
  set

Whitespaces should not be treated as separators here.

Signed-off-by: Masahiro Yamada 
---

Changes in v2:
  - Resend as a series
  - Change the commit subject

 scripts/multiconfig.sh | 37 +
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/scripts/multiconfig.sh b/scripts/multiconfig.sh
index 785f563..7606193 100644
--- a/scripts/multiconfig.sh
+++ b/scripts/multiconfig.sh
@@ -170,7 +170,7 @@ do_savedefconfig () {
# backslashes as an escape character
while read -r line
do
-   output_lines="$output_lines $line"
+   output_lines="$output_lines%$line"
done < defconfig
 
for img in $subimages
@@ -185,43 +185,64 @@ do_savedefconfig () {
tmp=
match=
 
+   # "# CONFIG_FOO is not set" should not be divided.
+   # Use "%" as a separator, instead of a whitespace.
+   # "%" is unlikely to appear in defconfig context.
+   save_IFS=$IFS
+   IFS=%
# coalesce common lines together
for i in $output_lines
do
case "$i" in
"[+A-Z]*:$line")
-   tmp="$tmp $unmatched"
+   tmp="$tmp%$unmatched"
i=$(echo "$i" | \
sed -e "s/^\([^:]\)*/\1$symbol/")
-   tmp="$tmp $i"
+   tmp="$tmp%$i"
match=1
;;
"$line")
-   tmp="$tmp $unmatched"
-   tmp="$tmp +$symbol:$i"
+   tmp="$tmp%$unmatched"
+   tmp="$tmp%+$symbol:$i"
match=1
;;
*)
-   tmp="$tmp $i"
+   tmp="$tmp%$i"
;;
esac
done
 
+   # Restore the default separator for the outer for loop.
+   IFS=$save_IFS
+
if [ "$match" ]; then
output_lines="$tmp"
unmatched=
else
-   unmatched="$unmatched $symbol:$line"
+   unmatched="$unmatched%$symbol:$line"
fi
done < defconfig
done
 
rm -f defconfig
touch defconfig
+
+   save_IFS=$IFS
+   IFS=%
+
for line in $output_lines
do
-   echo $line >> defconfig
+   case "$line" in
+   "")
+   # do not output blank lines
+   ;;
+   *)
+   echo $line >> defconfig
+   ;;
+   esac
done
+
+   IFS=$save_IFS
 }
 
 # Usage:
-- 
1.9.1

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


[U-Boot] [PATCH v2 3/4] kconfig: fix savedefconfig to handle TPL correctly

2014-09-03 Thread Masahiro Yamada
Since 3ff291f371fa9858426774f3732924bacb61ed1c
(kconfig: convert Kconfig helper script into a shell script),
"make savedefconfig" of TPL boards has not been working.

Signed-off-by: Masahiro Yamada 
---

Changes in v2:
  - Newly added

 scripts/multiconfig.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/multiconfig.sh b/scripts/multiconfig.sh
index 7606193..a579042 100644
--- a/scripts/multiconfig.sh
+++ b/scripts/multiconfig.sh
@@ -194,14 +194,14 @@ do_savedefconfig () {
for i in $output_lines
do
case "$i" in
-   "[+A-Z]*:$line")
+   [+A-Z]*:$line)
tmp="$tmp%$unmatched"
i=$(echo "$i" | \
-   sed -e "s/^\([^:]\)*/\1$symbol/")
+   sed -e "s/^\([^:]*\)/\1$symbol/")
tmp="$tmp%$i"
match=1
;;
-   "$line")
+   $line)
tmp="$tmp%$unmatched"
tmp="$tmp%+$symbol:$i"
match=1
-- 
1.9.1

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


[U-Boot] [PATCH v2 1/4] kconfig: fix savedefconfig to output empty defconfig

2014-09-03 Thread Masahiro Yamada
Commit 3ff291f371fa9858426774f3732924bacb61ed1c
(kconfig: convert Kconfig helper script into a shell script)
introduced a minor regression.

make alldefconfig; make savedefconfig
should create an empty 'defconfig'.

Signed-off-by: Masahiro Yamada 
Acked-by: Simon Glass 
---

Changes in v2:
  - Resend as a series.
  - Change the commit subject

 scripts/multiconfig.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/multiconfig.sh b/scripts/multiconfig.sh
index 4190798..785f563 100644
--- a/scripts/multiconfig.sh
+++ b/scripts/multiconfig.sh
@@ -217,6 +217,7 @@ do_savedefconfig () {
done
 
rm -f defconfig
+   touch defconfig
for line in $output_lines
do
echo $line >> defconfig
-- 
1.9.1

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


[U-Boot] [PATCH v2 0/4] Kconfig: Fix various bugs

2014-09-03 Thread Masahiro Yamada
Commit 3ff291f371fa9858426774f3732924bacb61ed1c
(kconfig: convert Kconfig helper script into a shell script)
introduced various bugs.

We are trying to be user-friendly, not developer-friendly,
but it causes my headache...



Masahiro Yamada (4):
  kconfig: fix savedefconfig to output empty defconfig
  kconfig: fix whitespace handling bug of savedefconfig
  kconfig: fix savedefconfig to handle TPL correctly
  kconfig: fix a bug of "make config"

 Makefile   |  2 +-
 scripts/multiconfig.sh | 44 +---
 2 files changed, 34 insertions(+), 12 deletions(-)

-- 
1.9.1

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


[U-Boot] [RFC] mainline u-boot on socfpga

2014-09-03 Thread Pavel Machek
Hi!

I know coding style leaves something to be desired.

But.. it recognizes MMC/ethernet, and can load linux kernel.

Unfortunately, linux kernel then fails to mount / filesystem (or fails
to launch init if filesystem is clean); same kernel works with
rocketboards u-boot. Ideas what could be a problem are welcome.

Best regards,
Pavel

diff --git a/arch/arm/cpu/armv7/socfpga/Makefile 
b/arch/arm/cpu/armv7/socfpga/Makefile
index eb33f2c..c36e0d0 100644
--- a/arch/arm/cpu/armv7/socfpga/Makefile
+++ b/arch/arm/cpu/armv7/socfpga/Makefile
@@ -10,3 +10,4 @@
 obj-y  := lowlevel_init.o
 obj-y  += misc.o timer.o reset_manager.o system_manager.o clock_manager.o
 obj-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o scan_manager.o
+obj-y  += fpga_manager.o
diff --git a/arch/arm/cpu/armv7/socfpga/clock_manager.c 
b/arch/arm/cpu/armv7/socfpga/clock_manager.c
index 158501a..c062f1f 100644
--- a/arch/arm/cpu/armv7/socfpga/clock_manager.c
+++ b/arch/arm/cpu/armv7/socfpga/clock_manager.c
@@ -30,6 +30,10 @@ static const struct socfpga_clock_manager 
*clock_manager_base =
CLKMGR_MAINPLLGRP_VCO_EN_SET(1)| \
CLKMGR_MAINPLLGRP_VCO_BGPWRDN_SET(0))
 
+unsigned long cm_l4_sp_clock;
+unsigned long cm_sdmmc_clock;
+unsigned long cm_qspi_clock;
+
 static inline void cm_wait_for_lock(uint32_t mask)
 {
register uint32_t inter_val;
@@ -358,3 +362,165 @@ void cm_basic_init(const cm_config_t *cfg)
writel(~0, &clock_manager_base->per_pll.en);
writel(~0, &clock_manager_base->sdr_pll.en);
 }
+
+#define CLKMGR_CTRL_ADDRESS 0x0
+#define CLKMGR_BYPASS_ADDRESS 0x4
+#define CLKMGR_INTER_ADDRESS 0x8
+#define CLKMGR_INTREN_ADDRESS 0xc
+#define CLKMGR_DBCTRL_ADDRESS 0x10
+#define CLKMGR_STAT_ADDRESS 0x14
+#define CLKMGR_MAINPLLGRP_ADDRESS 0x40
+#define CLKMGR_MAINPLLGRP_VCO_ADDRESS 0x40
+#define CLKMGR_MAINPLLGRP_MISC_ADDRESS 0x44
+#define CLKMGR_MAINPLLGRP_MPUCLK_ADDRESS 0x48
+#define CLKMGR_MAINPLLGRP_MAINCLK_ADDRESS 0x4c
+#define CLKMGR_MAINPLLGRP_DBGATCLK_ADDRESS 0x50
+#define CLKMGR_MAINPLLGRP_MAINQSPICLK_ADDRESS 0x54
+#define CLKMGR_MAINPLLGRP_MAINNANDSDMMCCLK_ADDRESS 0x58
+#define CLKMGR_MAINPLLGRP_CFGS2FUSER0CLK_ADDRESS 0x5c
+#define CLKMGR_MAINPLLGRP_EN_ADDRESS 0x60
+#define CLKMGR_MAINPLLGRP_MAINDIV_ADDRESS 0x64
+#define CLKMGR_MAINPLLGRP_DBGDIV_ADDRESS 0x68
+#define CLKMGR_MAINPLLGRP_TRACEDIV_ADDRESS 0x6c
+#define CLKMGR_MAINPLLGRP_L4SRC_ADDRESS 0x70
+#define CLKMGR_PERPLLGRP_ADDRESS 0x80
+#define CLKMGR_PERPLLGRP_VCO_ADDRESS 0x80
+#define CLKMGR_PERPLLGRP_MISC_ADDRESS 0x84
+#define CLKMGR_PERPLLGRP_EMAC0CLK_ADDRESS 0x88
+#define CLKMGR_PERPLLGRP_EMAC1CLK_ADDRESS 0x8c
+#define CLKMGR_PERPLLGRP_PERQSPICLK_ADDRESS 0x90
+#define CLKMGR_PERPLLGRP_PERNANDSDMMCCLK_ADDRESS 0x94
+#define CLKMGR_PERPLLGRP_PERBASECLK_ADDRESS 0x98
+#define CLKMGR_PERPLLGRP_S2FUSER1CLK_ADDRESS 0x9c
+#define CLKMGR_PERPLLGRP_EN_ADDRESS 0xa0
+#define CLKMGR_PERPLLGRP_DIV_ADDRESS 0xa4
+#define CLKMGR_PERPLLGRP_GPIODIV_ADDRESS 0xa8
+#define CLKMGR_PERPLLGRP_SRC_ADDRESS 0xac
+#define CLKMGR_SDRPLLGRP_ADDRESS 0xc0
+#define CLKMGR_SDRPLLGRP_VCO_ADDRESS 0xc0
+#define CLKMGR_SDRPLLGRP_CTRL_ADDRESS 0xc4
+#define CLKMGR_SDRPLLGRP_DDRDQSCLK_ADDRESS 0xc8
+#define CLKMGR_SDRPLLGRP_DDR2XDQSCLK_ADDRESS 0xcc
+#define CLKMGR_SDRPLLGRP_DDRDQCLK_ADDRESS 0xd0
+#define CLKMGR_SDRPLLGRP_S2FUSER2CLK_ADDRESS 0xd4
+#define CLKMGR_SDRPLLGRP_EN_ADDRESS 0xd8
+#define CLKMGR_ALTERAGRP_MPUCLK 0xe0
+#define CLKMGR_ALTERAGRP_MAINCLK 0xe4
+
+#define CLKMGR_MAINPLLGRP_VCO_DENOM_GET(x) (((x) & 0x003f) >> 16)
+#define CLKMGR_MAINPLLGRP_VCO_NUMER_GET(x) (((x) & 0xfff8) >> 3)
+#define CLKMGR_MAINPLLGRP_L4SRC_L4SP_GET(x)(((x) & 0x0002) >> 1)
+#define CLKMGR_MAINPLLGRP_MAINDIV_L4SPCLK_GET(x)  (((x) & 0x0380) >> 7)
+#define CLKMGR_SDRPLLGRP_VCO_SSRC_GET(x)   (((x) & 0x00c0) >> 22)
+#define CLKMGR_SDRPLLGRP_VCO_DENOM_GET(x)  (((x) & 0x003f) >> 16)
+#define CLKMGR_SDRPLLGRP_VCO_NUMER_GET(x)  (((x) & 0xfff8) >> 3)
+#define CLKMGR_SDRPLLGRP_DDRDQSCLK_CNT_GET(x)  (((x) & 0x01ff) >> 0)
+#define CLKMGR_PERPLLGRP_VCO_SSRC_GET(x)   (((x) & 0x00c0) >> 22)
+#define CLKMGR_PERPLLGRP_VCO_DENOM_GET(x)  (((x) & 0x003f) >> 16)
+#define CLKMGR_PERPLLGRP_VCO_NUMER_GET(x)  (((x) & 0xfff8) >> 3)
+#define CLKMGR_PERPLLGRP_SRC_QSPI_GET(x)   (((x) & 0x0030) >> 4)
+#define CLKMGR_PERPLLGRP_SRC_SDMMC_GET(x)  (((x) & 0x0003) >> 0)
+
+#define CLKMGR_VCO_SSRC_EOSC1  0x0
+#define CLKMGR_VCO_SSRC_EOSC2  0x1
+#define CLKMGR_VCO_SSRC_F2S0x2
+#define CLKMGR_L4_SP_CLK_SRC_MAINPLL   0x0
+#define CLKMGR_L4_SP_CLK_SRC_PERPLL0x1
+#define CLKMGR_SDMMC_CLK_SRC_F2S   0x0
+#define CLKMGR_SDMMC_CLK_SRC_MAIN  0x1
+#define CLKMGR_SDMMC_CLK_SRC_PER   0x2
+#define CLKMGR_QSPI_CLK_SRC_F2S0x0
+#define CLKMGR_QSPI_CLK_SRC_MAIN   0x1
+#define CLKMGR_QSPI_CLK_SRC_PER0x2
+
+#d

[U-Boot] [PATCH] patman: make run results better visible

2014-09-03 Thread Vadim Bendebury
For an occasional user of patman some failures are not obvious: for
instance when checkpatch reports warnings, the dry run still reports
that the email would be sent. If it is not dry run, the warnings are
shown on the screen, but it is not clear that the email was not sent.

Add some code to report failure to send email explicitly.

Tested by running the script on a patch with style violations,
observed error messages in the script output.

Signed-off-by: Vadim Bendebury 
---

 tools/patman/patman.py | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/patman/patman.py b/tools/patman/patman.py
index c60aa5a..0163ccd 100755
--- a/tools/patman/patman.py
+++ b/tools/patman/patman.py
@@ -154,13 +154,19 @@ else:
 
 # Email the patches out (giving the user time to check / cancel)
 cmd = ''
-if ok or options.ignore_errors:
+its_a_go = ok or options.ignore_errors
+if its_a_go:
 cmd = gitutil.EmailPatches(series, cover_fname, args,
 options.dry_run, not options.ignore_bad_tags, cc_file,
 in_reply_to=options.in_reply_to)
+else:
+print col.Color(col.RED,
+"Not sending emails due to checkpatch errors/warnings")
 
 # For a dry run, just show our actions as a sanity check
 if options.dry_run:
 series.ShowActions(args, cmd, options.process_tags)
+if not its_a_go:
+print col.Color(col.RED, "Email would not be sent")
 
 os.remove(cc_file)
-- 
2.1.0.rc2.206.gedb03e5

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


Re: [U-Boot] uboot env in mmc partition

2014-09-03 Thread Naitik Amin
More info..

Below is what I see on bootup.

My env is at 0x10 from base of sd card. It seems something happened on 
the hash insert.


> Boot Log >

U-Boot SPL 2013.01.01 (May 02 2014 - 11:49:21)
BOARD : Altera SOCFPGA Cyclone V Board
SDRAM: Initializing MMR registers
SDRAM: Calibrating PHY
SEQ.C: Preparing to start memory calibration
SEQ.C: CALIBRATION PASSED
ALTERA DWMMC: 0


U-Boot 2013.01.01 (Sep 03 2014 - 15:12:29)

CPU   : Altera SOCFPGA Platform
BOARD : Altera SOCFPGA Cyclone V Board
DRAM:  512 MiB
MMC:   ALTERA DWMMC: 0
env offset 1048576
CRC from Header 0x6cf572d5 Computed CRC 0x6cf572d5
" (type: m)lags type check failure for "ethaddr" <= "04:25:fe:ed:00:18
" into hash tableinsert "ethaddr=04:25:fe:ed:00:18
" (type: m)lags type check failure for "ethaddr" <= "00:b0:19:00:01:02
" into hash tableinsert "ethaddr=00:b0:19:00:01:02
In:serial
Out:   serial
Err:   serial
Net:   mii0
Warning: failed to set MAC address

Hit any key to stop autoboot:  0
reading u-boot.scr
 **Unable to read file u-boot.scr
Optional boot script not found. Continuing to boot normally
' - try 'help'd '
' - try 'help'd 'fatload
' - try 'help'd 'fatload
" not definedcboot





From:   Hannes Petermaier 
To: "Peter A. Bigot" , 
Cc: u-boot@lists.denx.de, Naitik Amin 
Date:   09/03/2014 10:14 AM
Subject:Re: [U-Boot] uboot env in mmc partition



> 
> On 09/03/2014 07:54 AM, Naitik Amin wrote:
> > Hi Hannes,
> >
> > So I did as you had indicated and made some progress, so now, my 
#defines
> > look as below.
> > #define CONFIG_SYS_MMC_ENV_DEV  0   /* device 0 */
> > #define CONFIG_ENV_OFFSET   0x2190
> >
> > I calculated the env offset from the block number it was on based on 
the
> > first block number of the partition.
> >
> > Doing this on uboot startup, I dont get the warning saying, using 
default
> > environment. Neither it complained abt crc error. So it liked it 
seems.
> > But what it did is it trashed the partition which had my dtb and 
zImage.
> > Its a completely different partition. So after that, the bootup gets
> > halted. Any ideas ? What may have trashed the partition ?
> 
> Look at: http://www.mail-archive.com/u-boot@lists.denx.de/msg146396.html
> 
> and see if that's relevant, specifically the second patch which restores 


> the mmc device offset calculations to the values that correspond to the 
> partition number that's represented in the device structure.
> 
> Peter

Hi Peter,
i don't think that your patch has influence on this issue, due to no 
partition switching is done anymore.

Further i would like to check your patch series, i am not sure if there is 

everything ok.
I will do so tommorow - i am right in thinking that you are using MMC not 
eMMC ?

best regards,
Hannes





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


[U-Boot] U-boot-arm/master (and next) fast-forwarded to u-boot/master

2014-09-03 Thread Albert ARIBAUD
Hello,

FYI; subject says all.

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


Re: [U-Boot] [PATCH v6] mx6: add support of multi-processor command

2014-09-03 Thread Gabriel Huau

Hi York,

On 09/03/2014 11:00 AM, York Sun wrote:

On 07/28/2014 08:15 AM, Stefano Babic wrote:

Hi Gabriel,

On 26/07/2014 20:35, Gabriel Huau wrote:

This allows u-boot to load different OS or Bare Metal application on
different cores of the i.MX6 SoC.
For example: running Android on cpu0 and a RT OS like QNX/FreeRTOS on cpu1.

Signed-off-by: Gabriel Huau 
---
Changes for v2:
- Add a commit log message to explain the purpose of this patch
Changes for v3:
- Remove unnecessary check for unsigned values when they are negative
Changes for v4:
- Add CONFIG_MP to the common mx6 configuration
- Get the number of CPUs dynamically instead of using a macro
Changes for v5:
- Rebase on the last update of the tree (conflicts solved)
Changes for v6:
- Remove useless switch case
- Update board_f to not depend on mp.h unnecessary
- Fix build warnings
- Update commit message





--- a/common/board_f.c
+++ b/common/board_f.c
@@ -34,6 +34,9 @@
  #ifdef CONFIG_MPC5xxx
  #include 
  #endif
+#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
+#include 
+#endif
  
  #include 

  #include 
@@ -43,9 +46,6 @@
  #include 
  #include 
  #include 
-#ifdef CONFIG_MP
-#include 
-#endif
  #include 
  #ifdef CONFIG_X86
  #include 
@@ -381,7 +381,7 @@ static int setup_dest_addr(void)
gd->ram_top = board_get_usable_ram_top(gd->mon_len);
gd->relocaddr = gd->ram_top;
debug("Ram top: %08lX\n", (ulong)gd->ram_top);
-#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
+#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))

I didn't notice this patch until it got merged. Why dropping CONFIG_MP here?
This change breaks these boards

  MPC8536DS MPC8536DS_36BIT MPC8536DS_SDCARD MPC8536DS_SPIFLASH qemu-ppce500

York


Sorry, I didn't see the break for these boards.
'asm/mp.h' is used only for the powerpc board and using CONFIG_MP force 
the other architecture (or board) to create an empty header.
As this header was here to use only specific features (not generic), I 
removed it and put the include guards only for the boards needed.


Can't we add these boards to the board_f.c?

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


Re: [U-Boot] [PATCH v6] mx6: add support of multi-processor command

2014-09-03 Thread Gabriel Huau

On 09/03/2014 11:36 AM, York Sun wrote:

On 09/03/2014 11:26 AM, Gabriel Huau wrote:

Hi York,

On 09/03/2014 11:00 AM, York Sun wrote:

On 07/28/2014 08:15 AM, Stefano Babic wrote:

Hi Gabriel,

On 26/07/2014 20:35, Gabriel Huau wrote:

This allows u-boot to load different OS or Bare Metal application on
different cores of the i.MX6 SoC.
For example: running Android on cpu0 and a RT OS like QNX/FreeRTOS on cpu1.

Signed-off-by: Gabriel Huau 
---
Changes for v2:
- Add a commit log message to explain the purpose of this patch
Changes for v3:
- Remove unnecessary check for unsigned values when they are negative
Changes for v4:
- Add CONFIG_MP to the common mx6 configuration
- Get the number of CPUs dynamically instead of using a macro
Changes for v5:
- Rebase on the last update of the tree (conflicts solved)
Changes for v6:
- Remove useless switch case
- Update board_f to not depend on mp.h unnecessary
- Fix build warnings
- Update commit message





--- a/common/board_f.c
+++ b/common/board_f.c
@@ -34,6 +34,9 @@
   #ifdef CONFIG_MPC5xxx
   #include 
   #endif
+#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
+#include 
+#endif
   
   #include 

   #include 
@@ -43,9 +46,6 @@
   #include 
   #include 
   #include 
-#ifdef CONFIG_MP
-#include 
-#endif
   #include 
   #ifdef CONFIG_X86
   #include 
@@ -381,7 +381,7 @@ static int setup_dest_addr(void)
gd->ram_top = board_get_usable_ram_top(gd->mon_len);
gd->relocaddr = gd->ram_top;
debug("Ram top: %08lX\n", (ulong)gd->ram_top);
-#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
+#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))

I didn't notice this patch until it got merged. Why dropping CONFIG_MP here?
This change breaks these boards

   MPC8536DS MPC8536DS_36BIT MPC8536DS_SDCARD MPC8536DS_SPIFLASH qemu-ppce500

York

Sorry, I didn't see the break for these boards.
'asm/mp.h' is used only for the powerpc board and using CONFIG_MP force
the other architecture (or board) to create an empty header.
As this header was here to use only specific features (not generic), I
removed it and put the include guards only for the boards needed.

Can't we add these boards to the board_f.c?


I don't mind to change the guard for asm/mp.h. But you shouldn't remove the
guard for the function call. Not all powerpc SoCs support SMP. You could use

+#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
+#include 
+#endif

York



Oh! I see what you mean, my bad, sorry.
I'll propose the fix as soon as possible to revert the modification on 
the include guard and modify the one for the asm/mp.h


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


Re: [U-Boot] [PATCH v6] mx6: add support of multi-processor command

2014-09-03 Thread York Sun
On 09/03/2014 11:26 AM, Gabriel Huau wrote:
> Hi York,
> 
> On 09/03/2014 11:00 AM, York Sun wrote:
>> On 07/28/2014 08:15 AM, Stefano Babic wrote:
>>> Hi Gabriel,
>>>
>>> On 26/07/2014 20:35, Gabriel Huau wrote:
 This allows u-boot to load different OS or Bare Metal application on
 different cores of the i.MX6 SoC.
 For example: running Android on cpu0 and a RT OS like QNX/FreeRTOS on cpu1.

 Signed-off-by: Gabriel Huau 
 ---
 Changes for v2:
- Add a commit log message to explain the purpose of this patch
 Changes for v3:
- Remove unnecessary check for unsigned values when they are negative
 Changes for v4:
- Add CONFIG_MP to the common mx6 configuration
- Get the number of CPUs dynamically instead of using a macro
 Changes for v5:
- Rebase on the last update of the tree (conflicts solved)
 Changes for v6:
- Remove useless switch case
- Update board_f to not depend on mp.h unnecessary
- Fix build warnings
- Update commit message

>> 
>>
 --- a/common/board_f.c
 +++ b/common/board_f.c
 @@ -34,6 +34,9 @@
   #ifdef CONFIG_MPC5xxx
   #include 
   #endif
 +#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
 +#include 
 +#endif
   
   #include 
   #include 
 @@ -43,9 +46,6 @@
   #include 
   #include 
   #include 
 -#ifdef CONFIG_MP
 -#include 
 -#endif
   #include 
   #ifdef CONFIG_X86
   #include 
 @@ -381,7 +381,7 @@ static int setup_dest_addr(void)
gd->ram_top = board_get_usable_ram_top(gd->mon_len);
gd->relocaddr = gd->ram_top;
debug("Ram top: %08lX\n", (ulong)gd->ram_top);
 -#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || 
 defined(CONFIG_E500))
 +#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
>> I didn't notice this patch until it got merged. Why dropping CONFIG_MP here?
>> This change breaks these boards
>>
>>   MPC8536DS MPC8536DS_36BIT MPC8536DS_SDCARD MPC8536DS_SPIFLASH qemu-ppce500
>>
>> York
> 
> Sorry, I didn't see the break for these boards.
> 'asm/mp.h' is used only for the powerpc board and using CONFIG_MP force 
> the other architecture (or board) to create an empty header.
> As this header was here to use only specific features (not generic), I 
> removed it and put the include guards only for the boards needed.
> 
> Can't we add these boards to the board_f.c?
> 

I don't mind to change the guard for asm/mp.h. But you shouldn't remove the
guard for the function call. Not all powerpc SoCs support SMP. You could use

+#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
+#include 
+#endif

York

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


Re: [U-Boot] [PATCH v6] mx6: add support of multi-processor command

2014-09-03 Thread York Sun
On 07/28/2014 08:15 AM, Stefano Babic wrote:
> Hi Gabriel,
> 
> On 26/07/2014 20:35, Gabriel Huau wrote:
>> This allows u-boot to load different OS or Bare Metal application on
>> different cores of the i.MX6 SoC.
>> For example: running Android on cpu0 and a RT OS like QNX/FreeRTOS on cpu1.
>>
>> Signed-off-by: Gabriel Huau 
>> ---
>> Changes for v2:
>>  - Add a commit log message to explain the purpose of this patch
>> Changes for v3:
>>  - Remove unnecessary check for unsigned values when they are negative
>> Changes for v4:
>>  - Add CONFIG_MP to the common mx6 configuration
>>  - Get the number of CPUs dynamically instead of using a macro
>> Changes for v5:
>>  - Rebase on the last update of the tree (conflicts solved)
>> Changes for v6:
>>  - Remove useless switch case
>>  - Update board_f to not depend on mp.h unnecessary
>>  - Fix build warnings
>>  - Update commit message
>>



>> --- a/common/board_f.c
>> +++ b/common/board_f.c
>> @@ -34,6 +34,9 @@
>>  #ifdef CONFIG_MPC5xxx
>>  #include 
>>  #endif
>> +#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
>> +#include 
>> +#endif
>>  
>>  #include 
>>  #include 
>> @@ -43,9 +46,6 @@
>>  #include 
>>  #include 
>>  #include 
>> -#ifdef CONFIG_MP
>> -#include 
>> -#endif
>>  #include 
>>  #ifdef CONFIG_X86
>>  #include 
>> @@ -381,7 +381,7 @@ static int setup_dest_addr(void)
>>  gd->ram_top = board_get_usable_ram_top(gd->mon_len);
>>  gd->relocaddr = gd->ram_top;
>>  debug("Ram top: %08lX\n", (ulong)gd->ram_top);
>> -#if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
>> +#if (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))

I didn't notice this patch until it got merged. Why dropping CONFIG_MP here?
This change breaks these boards

 MPC8536DS MPC8536DS_36BIT MPC8536DS_SDCARD MPC8536DS_SPIFLASH qemu-ppce500

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


Re: [U-Boot] [PATCH v2] env_mmc: correct fini partition to match init partition

2014-09-03 Thread Peter A. Bigot

On 09/03/2014 12:46 PM, Stephen Warren wrote:

On 09/03/2014 11:30 AM, Peter A. Bigot wrote:

On 09/03/2014 11:52 AM, Stephen Warren wrote:

On 09/03/2014 10:32 AM, Peter A. Bigot wrote:

The code to set the MMC partition uses an weak function to obtain the
correct partition number.  Use that instead of the compile-time 
default

when deciding whether it needs to switch back.


Yes, this clearly fixes a bug.

Can you also please add a Fixes: tag that refers to the commit which
introduced the problem (i.e. which updated mmc_set_env_part() to call
mmc_get_env_part(), but forgot to update fini_mmc_for_env() to match.


Done.

If this tag is important enough to ask people to add it and resubmit
their patches with no other changes, it should probably be described at
http://www.denx.de/wiki/view/U-Boot/Patches#Review_Process_Git_Tags and
suggested in the section on general patch submission rules, so the poor
contributor might have a chance of being able to avoid the rework.


I'd expect that if the only issue was a patch was a missing fixes 
line, the person applying the patch could manually edit it in when 
applying the patch, so all the contributor would have to do is reply 
to the email with the desired content. Still, different committers 
have different levels of tolerance for this, so YMMV!


Ah; I'd forgotten that patchwork collects that sort of thing.  The need 
to provide the tag should still be described in the patch process wiki 
pages, but replying would have been an easier solution if I'd known that 
doing so would have satisfied your request to add it.


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


Re: [U-Boot] [PATCH v2] env_mmc: correct fini partition to match init partition

2014-09-03 Thread Stephen Warren

On 09/03/2014 11:30 AM, Peter A. Bigot wrote:

On 09/03/2014 11:52 AM, Stephen Warren wrote:

On 09/03/2014 10:32 AM, Peter A. Bigot wrote:

The code to set the MMC partition uses an weak function to obtain the
correct partition number.  Use that instead of the compile-time default
when deciding whether it needs to switch back.


Yes, this clearly fixes a bug.

Can you also please add a Fixes: tag that refers to the commit which
introduced the problem (i.e. which updated mmc_set_env_part() to call
mmc_get_env_part(), but forgot to update fini_mmc_for_env() to match.


Done.

If this tag is important enough to ask people to add it and resubmit
their patches with no other changes, it should probably be described at
http://www.denx.de/wiki/view/U-Boot/Patches#Review_Process_Git_Tags and
suggested in the section on general patch submission rules, so the poor
contributor might have a chance of being able to avoid the rework.


I'd expect that if the only issue was a patch was a missing fixes line, 
the person applying the patch could manually edit it in when applying 
the patch, so all the contributor would have to do is reply to the email 
with the desired content. Still, different committers have different 
levels of tolerance for this, so YMMV!

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


[U-Boot] [PATCH 2/2] standalone: use GCC_VERSION defined in compiler-gcc.h

2014-09-03 Thread Masahiro Yamada
Now GCC_VERSION is defined in include/linux/compiler-gcc.h
(with a little different definition).
Use it and delete the one in examples/standlone/stub.c.

This should work on Clang too because __GNUC__, __GNUC_MINOR__,
__GNUC_PATCHLEVEL__ are also defined on Clang.

Signed-off-by: Masahiro Yamada 
Cc: Jeroen Hofstee 
---

 examples/standalone/stubs.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c
index c5c025d..0bf690e 100644
--- a/examples/standalone/stubs.c
+++ b/examples/standalone/stubs.c
@@ -1,9 +1,6 @@
 #include 
 #include 
-
-#ifndef GCC_VERSION
-#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
-#endif /* GCC_VERSION */
+#include 
 
 #if defined(CONFIG_X86)
 /*
@@ -237,7 +234,7 @@ gd_t *global_data;
  * implementation. On the other hand, asm() statements with
  * arguments can be used only inside the functions (gcc limitation)
  */
-#if GCC_VERSION < 3004
+#if GCC_VERSION < 30400
 static
 #endif /* GCC_VERSION */
 void __attribute__((unused)) dummy(void)
-- 
1.9.1

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


[U-Boot] [PATCH 1/2] compiler*.h: sync include/linux/compiler*.h with Linux 3.16

2014-09-03 Thread Masahiro Yamada
Copy them from Linux v3.16 tag.
My main motivation of this commit is to add compiler-clang.h.

Signed-off-by: Masahiro Yamada 
Cc: Jeroen Hofstee 
---

I built all the supported board and compared MD5SUM.
I confirmed this patch does not change the produced binaries.


 include/linux/compiler-clang.h | 12 ++
 include/linux/compiler-gcc.h   | 57 ++
 include/linux/compiler-gcc3.h  | 20 -
 include/linux/compiler-gcc4.h  | 59 +++
 include/linux/compiler-intel.h | 40 ++
 include/linux/compiler.h   | 92 +-
 6 files changed, 236 insertions(+), 44 deletions(-)
 create mode 100644 include/linux/compiler-clang.h
 create mode 100644 include/linux/compiler-intel.h

diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
new file mode 100644
index 000..d1e49d5
--- /dev/null
+++ b/include/linux/compiler-clang.h
@@ -0,0 +1,12 @@
+#ifndef __LINUX_COMPILER_H
+#error "Please don't include  directly, include 
 instead."
+#endif
+
+/* Some compiler specific definitions are overwritten here
+ * for Clang compiler
+ */
+
+#ifdef uninitialized_var
+#undef uninitialized_var
+#define uninitialized_var(x) x = *(&(x))
+#endif
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 9896e54..02ae99e 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -5,6 +5,9 @@
 /*
  * Common definitions for all gcc versions go here.
  */
+#define GCC_VERSION (__GNUC__ * 1 \
+  + __GNUC_MINOR__ * 100 \
+  + __GNUC_PATCHLEVEL__)
 
 
 /* Optimization barrier */
@@ -34,9 +37,15 @@
 __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
 (typeof(ptr)) (__ptr + (off)); })
 
+/* Make the optimizer believe the variable can be manipulated arbitrarily. */
+#define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var))
+
+#ifdef __CHECKER__
+#define __must_be_array(arr) 0
+#else
 /* &a[0] degrades to a pointer: a different type from an array */
-#define __must_be_array(a) \
-  BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
+#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
+#endif
 
 /*
  * Force always-inline if the user requests it so via the .config,
@@ -44,15 +53,18 @@
  */
 #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
 !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
-# define inlineinline  __attribute__((always_inline))
-# define __inline____inline__  __attribute__((always_inline))
-# define __inline  __inline__attribute__((always_inline))
+# define inlineinline  __attribute__((always_inline)) 
notrace
+# define __inline____inline__  __attribute__((always_inline)) notrace
+# define __inline  __inline__attribute__((always_inline)) notrace
+#else
+/* A lot of inline functions can cause havoc with function tracing */
+# define inlineinline  notrace
+# define __inline____inline__  notrace
+# define __inline  __inlinenotrace
 #endif
 
 #define __deprecated   __attribute__((deprecated))
-#ifndef __packed
-# define __packed  __attribute__((packed))
-#endif
+#define __packed   __attribute__((packed))
 #define __weak __attribute__((weak))
 
 /*
@@ -60,8 +72,12 @@
  * naked functions because then mcount is called without stack and frame 
pointer
  * being set up and there is no chance to restore the lr register to the value
  * before mcount was called.
+ *
+ * The asm() bodies of naked functions often depend on standard calling 
conventions,
+ * therefore they must be noinline and noclone.  GCC 4.[56] currently fail to 
enforce
+ * this, so we must do so ourselves.  See GCC PR44290.
  */
-#define __naked__attribute__((naked)) notrace
+#define __naked__attribute__((naked)) noinline 
__noclone notrace
 
 #define __noreturn __attribute__((noreturn))
 
@@ -75,13 +91,10 @@
  * would be.
  * [...]
  */
-#ifndef __pure
-# define __pure__attribute__((pure))
-#endif
-#ifndef __aligned
-# define __aligned(x)  __attribute__((aligned(x)))
-#endif
-#define __printf(a,b)  __attribute__((format(printf,a,b)))
+#define __pure __attribute__((pure))
+#define __aligned(x)   __attribute__((aligned(x)))
+#define __printf(a, b) __attribute__((format(printf, a, b)))
+#define __scanf(a, b)  __attribute__((format(scanf, a, b)))
 #define  noinline  __attribute__((noinline))
 #define __attribute_const____attribute__((__const__))
 #define __maybe_unused __attribute__((unused))
@@ -91,3 +104,15 @@
 #define _gcc_

[U-Boot] [PATCH 0/2] Sync compiler*.h with Linux 3.16

2014-09-03 Thread Masahiro Yamada



Masahiro Yamada (2):
  compiler*.h: sync include/linux/compiler*.h with Linux 3.16
  standalone: use GCC_VERSION defined in compiler-gcc.h

 examples/standalone/stubs.c|  7 +---
 include/linux/compiler-clang.h | 12 ++
 include/linux/compiler-gcc.h   | 57 ++
 include/linux/compiler-gcc3.h  | 20 -
 include/linux/compiler-gcc4.h  | 59 +++
 include/linux/compiler-intel.h | 40 ++
 include/linux/compiler.h   | 92 +-
 7 files changed, 238 insertions(+), 49 deletions(-)
 create mode 100644 include/linux/compiler-clang.h
 create mode 100644 include/linux/compiler-intel.h

-- 
1.9.1

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


[U-Boot] [U-boot] [Patch 3/6] keystone2: msmc: add MSMC cache coherency support for K2L SOC

2014-09-03 Thread Ivan Khoronzhuk
From: Hao Zhang 

This patch adds Keystone II Lamar (K2L) SoC specific definitions
to support MSMC cache coherency.

Acked-by: Vitaly Andrianov 
Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---
 arch/arm/cpu/armv7/keystone/init.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/cpu/armv7/keystone/init.c 
b/arch/arm/cpu/armv7/keystone/init.c
index a8f8aee..a0ecfa2 100644
--- a/arch/arm/cpu/armv7/keystone/init.c
+++ b/arch/arm/cpu/armv7/keystone/init.c
@@ -32,6 +32,9 @@ int arch_cpu_init(void)
 #ifdef CONFIG_SOC_K2E
msmc_share_all_segments(13); /* PCIE 1 */
 #endif
+#ifdef CONFIG_SOC_K2L
+   msmc_share_all_segments(14); /* PCIE 1 */
+#endif
 
/*
 * just initialise the COM2 port so that TI specific
-- 
1.8.3.2

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


[U-Boot] [U-boot] [Patch 6/6] keystone2: k2l-evm: add board support

2014-09-03 Thread Ivan Khoronzhuk
From: Hao Zhang 

This patch adds Keystone II Lammar (K2L) EVM board support.

Acked-by: Vitaly Andrianov 
Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---
 arch/arm/Kconfig   |  3 ++
 arch/arm/include/asm/arch-keystone/clock-k2l.h |  6 +++
 board/ti/ks2_evm/Kconfig   | 24 +++
 board/ti/ks2_evm/Makefile  |  2 +
 board/ti/ks2_evm/board_k2l.c   | 60 ++
 board/ti/ks2_evm/ddr3_cfg.c| 36 
 board/ti/ks2_evm/ddr3_cfg.h|  3 ++
 board/ti/ks2_evm/ddr3_k2l.c| 43 ++
 configs/k2l_evm_defconfig  |  2 +
 include/configs/k2l_evm.h  | 37 
 10 files changed, 216 insertions(+)
 create mode 100644 board/ti/ks2_evm/board_k2l.c
 create mode 100644 board/ti/ks2_evm/ddr3_k2l.c
 create mode 100644 configs/k2l_evm_defconfig
 create mode 100644 include/configs/k2l_evm.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e385eda..29c4b00 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -467,6 +467,9 @@ config TARGET_K2E_EVM
 config TARGET_K2HK_EVM
bool "Support k2hk_evm"
 
+config TARGET_K2L_EVM
+   bool "Support k2l_evm"
+
 config TARGET_M53EVK
bool "Support m53evk"
 
diff --git a/arch/arm/include/asm/arch-keystone/clock-k2l.h 
b/arch/arm/include/asm/arch-keystone/clock-k2l.h
index 8cacee0..b3f4e71 100644
--- a/arch/arm/include/asm/arch-keystone/clock-k2l.h
+++ b/arch/arm/include/asm/arch-keystone/clock-k2l.h
@@ -69,7 +69,9 @@ enum {
 
 #define CORE_PLL_799   {CORE_PLL, 13, 1, 2}
 #define CORE_PLL_983   {CORE_PLL, 16, 1, 2}
+#define CORE_PLL_1000  {CORE_PLL, 114, 7, 2}
 #define CORE_PLL_1167  {CORE_PLL, 19, 1, 2}
+#define CORE_PLL_1198  {CORE_PLL, 39, 2, 2}
 #define CORE_PLL_1228  {CORE_PLL, 20, 1, 2}
 #define PASS_PLL_1228  {PASS_PLL, 20, 1, 2}
 #define PASS_PLL_983   {PASS_PLL, 16, 1, 2}
@@ -78,8 +80,12 @@ enum {
 #define TETRIS_PLL_737 {TETRIS_PLL, 12, 1, 2}
 #define TETRIS_PLL_799 {TETRIS_PLL, 13, 1, 2}
 #define TETRIS_PLL_983 {TETRIS_PLL, 16, 1, 2}
+#define TETRIS_PLL_1000{TETRIS_PLL, 114, 7, 2}
 #define TETRIS_PLL_1167{TETRIS_PLL, 19, 1, 2}
+#define TETRIS_PLL_1198{TETRIS_PLL, 39, 2, 2}
 #define TETRIS_PLL_1228{TETRIS_PLL, 20, 1, 2}
+#define TETRIS_PLL_1352{TETRIS_PLL, 22, 1, 2}
+#define TETRIS_PLL_1401{TETRIS_PLL, 114, 5, 2}
 #define DDR3_PLL_200   {DDR3_PLL, 4, 1, 2}
 #define DDR3_PLL_400   {DDR3_PLL, 16, 1, 4}
 #define DDR3_PLL_800   {DDR3_PLL, 16, 1, 2}
diff --git a/board/ti/ks2_evm/Kconfig b/board/ti/ks2_evm/Kconfig
index 7890b30..81cf07a 100644
--- a/board/ti/ks2_evm/Kconfig
+++ b/board/ti/ks2_evm/Kconfig
@@ -45,3 +45,27 @@ config SYS_CONFIG_NAME
default "k2hk_evm"
 
 endif
+
+if TARGET_K2L_EVM
+
+config SYS_CPU
+   string
+   default "armv7"
+
+config SYS_BOARD
+   string
+   default "ks2_evm"
+
+config SYS_VENDOR
+   string
+   default "ti"
+
+config SYS_SOC
+   string
+   default "keystone"
+
+config SYS_CONFIG_NAME
+   string
+   default "k2l_evm"
+
+endif
diff --git a/board/ti/ks2_evm/Makefile b/board/ti/ks2_evm/Makefile
index 00f1164..071dbee 100644
--- a/board/ti/ks2_evm/Makefile
+++ b/board/ti/ks2_evm/Makefile
@@ -11,3 +11,5 @@ obj-$(CONFIG_K2HK_EVM) += board_k2hk.o
 obj-$(CONFIG_K2HK_EVM) += ddr3_k2hk.o
 obj-$(CONFIG_K2E_EVM) += board_k2e.o
 obj-$(CONFIG_K2E_EVM) += ddr3_k2e.o
+obj-$(CONFIG_K2L_EVM) += board_k2l.o
+obj-$(CONFIG_K2L_EVM) += ddr3_k2l.o
diff --git a/board/ti/ks2_evm/board_k2l.c b/board/ti/ks2_evm/board_k2l.c
new file mode 100644
index 000..b8faff6
--- /dev/null
+++ b/board/ti/ks2_evm/board_k2l.c
@@ -0,0 +1,60 @@
+/*
+ * K2L EVM : Board initialization
+ *
+ * (C) Copyright 2014
+ * Texas Instruments Incorporated, 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int external_clk[ext_clk_count] = {
+   [sys_clk]   = 12288,
+   [alt_core_clk]  = 1,
+   [pa_clk]= 12288,
+   [tetris_clk]= 12288,
+   [ddr3_clk]  = 1,
+   [pcie_clk]  = 1,
+   [sgmii_clk] = 15625,
+   [usb_clk]   = 1,
+};
+
+static struct pll_init_data core_pll_config[] = {
+   CORE_PLL_799,
+   CORE_PLL_1000,
+   CORE_PLL_1198,
+};
+
+static struct pll_init_data tetris_pll_config[] = {
+   TETRIS_PLL_799,
+   TETRIS_PLL_1000,
+   TETRIS_PLL_1198,
+   TETRIS_PLL_1352,
+   TETRIS_PLL_1401,
+};
+
+static struct pll_init_data pa_pll_config =
+   PASS_PLL_983;
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+   int speed;
+
+   speed = get_max_dev_speed();
+   init_pll(&core_pll_config[speed]);
+
+   init_pll(&pa_pll_config);
+
+   speed = get_max_arm_speed();
+ 

[U-Boot] [U-boot] [Patch 4/6] ARM: keystone2: spl: add K2L SoC support

2014-09-03 Thread Ivan Khoronzhuk
From: Hao Zhang 

Add Keystone II Lamar (K2L) SoC support.

Acked-by: Vitaly Andrianov 
Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---
 arch/arm/cpu/armv7/keystone/spl.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/cpu/armv7/keystone/spl.c 
b/arch/arm/cpu/armv7/keystone/spl.c
index d4b0e9b..6a3adf4 100644
--- a/arch/arm/cpu/armv7/keystone/spl.c
+++ b/arch/arm/cpu/armv7/keystone/spl.c
@@ -31,6 +31,13 @@ static struct pll_init_data spl_pll_config[] = {
 };
 #endif
 
+#ifdef CONFIG_K2L_EVM
+static struct pll_init_data spl_pll_config[] = {
+   CORE_PLL_799,
+   TETRIS_PLL_491,
+};
+#endif
+
 void spl_init_keystone_plls(void)
 {
init_plls(ARRAY_SIZE(spl_pll_config), spl_pll_config);
-- 
1.8.3.2

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


[U-Boot] [U-boot] [Patch 5/6] keystone2: enable OSR clock domain for K2L SoC

2014-09-03 Thread Ivan Khoronzhuk
From: Hao Zhang 

This patches enables the On-chip Shared Ram clock domain for K2L SoC.

Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---
 arch/arm/cpu/armv7/keystone/init.c| 49 +++
 arch/arm/include/asm/arch-keystone/hardware-k2l.h | 25 
 arch/arm/include/asm/arch-keystone/hardware.h |  1 +
 3 files changed, 75 insertions(+)

diff --git a/arch/arm/cpu/armv7/keystone/init.c 
b/arch/arm/cpu/armv7/keystone/init.c
index a0ecfa2..2228132 100644
--- a/arch/arm/cpu/armv7/keystone/init.c
+++ b/arch/arm/cpu/armv7/keystone/init.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 void chip_configuration_unlock(void)
 {
@@ -20,6 +21,53 @@ void chip_configuration_unlock(void)
__raw_writel(KS2_KICK1_MAGIC, KS2_KICK1);
 }
 
+#ifdef CONFIG_SOC_K2L
+void osr_init(void)
+{
+   u32 i;
+   u32 j;
+   u32 val;
+   u32 base = KS2_OSR_CFG_BASE;
+   u32 ecc_ctrl[KS2_OSR_NUM_RAM_BANKS];
+
+   /* Enable the OSR clock domain */
+   psc_enable_module(KS2_LPSC_OSR);
+
+   /* Disable OSR ECC check for all the ram banks */
+   for (i = 0; i < KS2_OSR_NUM_RAM_BANKS; i++) {
+   val = i | KS2_OSR_ECC_VEC_TRIG_RD |
+   (KS2_OSR_ECC_CTRL << KS2_OSR_ECC_VEC_RD_ADDR_SH);
+
+   writel(val , base + KS2_OSR_ECC_VEC);
+
+   /**
+* wait till read is done.
+* Print should be added after earlyprintk support is added.
+*/
+   for (j = 0; j < 1; j++) {
+   val = readl(base + KS2_OSR_ECC_VEC);
+   if (val & KS2_OSR_ECC_VEC_RD_DONE)
+   break;
+   }
+
+   ecc_ctrl[i] = readl(base + KS2_OSR_ECC_CTRL) ^
+   KS2_OSR_ECC_CTRL_CHK;
+
+   writel(ecc_ctrl[i], KS2_MSMC_DATA_BASE + i * 4);
+   writel(ecc_ctrl[i], base + KS2_OSR_ECC_CTRL);
+   }
+
+   /* Reset OSR memory to all zeros */
+   for (i = 0; i < KS2_OSR_SIZE; i += 4)
+   writel(0, KS2_OSR_DATA_BASE + i);
+
+   /* Enable OSR ECC check for all the ram banks */
+   for (i = 0; i < KS2_OSR_NUM_RAM_BANKS; i++)
+   writel(ecc_ctrl[i] |
+  KS2_OSR_ECC_CTRL_CHK, base + KS2_OSR_ECC_CTRL);
+}
+#endif
+
 int arch_cpu_init(void)
 {
chip_configuration_unlock();
@@ -34,6 +82,7 @@ int arch_cpu_init(void)
 #endif
 #ifdef CONFIG_SOC_K2L
msmc_share_all_segments(14); /* PCIE 1 */
+   osr_init();
 #endif
 
/*
diff --git a/arch/arm/include/asm/arch-keystone/hardware-k2l.h 
b/arch/arm/include/asm/arch-keystone/hardware-k2l.h
index 3402d0c..dfde040 100644
--- a/arch/arm/include/asm/arch-keystone/hardware-k2l.h
+++ b/arch/arm/include/asm/arch-keystone/hardware-k2l.h
@@ -57,6 +57,31 @@
 #define KS2_CIC2_DDR3_ECC_IRQ_NUM  0x0D3
 #define KS2_CIC2_DDR3_ECC_CHAN_NUM 0x01D
 
+/* OSR */
+#define KS2_OSR_DATA_BASE  0x7000  /* OSR data base */
+#define KS2_OSR_CFG_BASE   0x02348c00  /* OSR config base */
+#define KS2_OSR_ECC_VEC0x08/* ECC Vector 
reg */
+#define KS2_OSR_ECC_CTRL   0x14/* ECC control reg */
+
+/* OSR ECC Vector register */
+#define KS2_OSR_ECC_VEC_TRIG_RDBIT(15) /* trigger a 
read op */
+#define KS2_OSR_ECC_VEC_RD_DONEBIT(24) /* read 
complete */
+
+#define KS2_OSR_ECC_VEC_RAM_ID_SH  0   /* RAM ID shift */
+#define KS2_OSR_ECC_VEC_RD_ADDR_SH 16  /* read address shift */
+
+/* OSR ECC control register */
+#define KS2_OSR_ECC_CTRL_ENBIT(0)  /* ECC enable bit */
+#define KS2_OSR_ECC_CTRL_CHK   BIT(1)  /* ECC check bit */
+#define KS2_OSR_ECC_CTRL_RMW   BIT(2)  /* ECC check bit */
+
+/* Number of OSR RAM banks */
+#define KS2_OSR_NUM_RAM_BANKS  4
+
+/* OSR memory size */
+#define KS2_OSR_SIZE   0x10
+
+
 /* Number of DSP cores */
 #define KS2_NUM_DSPS   4
 
diff --git a/arch/arm/include/asm/arch-keystone/hardware.h 
b/arch/arm/include/asm/arch-keystone/hardware.h
index 89dce96..2eec4e7 100644
--- a/arch/arm/include/asm/arch-keystone/hardware.h
+++ b/arch/arm/include/asm/arch-keystone/hardware.h
@@ -161,6 +161,7 @@ typedef volatile unsigned int   *dv_reg_p;
 
 /* MSMC control */
 #define KS2_MSMC_CTRL_BASE 0x0bc0
+#define KS2_MSMC_DATA_BASE 0x0c00
 
 /* USB */
 #define KS2_USB_SS_BASE0x0268
-- 
1.8.3.2

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


[U-Boot] [U-boot] [Patch 1/6] ARM: keystone2: add K2L device hardware definitions

2014-09-03 Thread Ivan Khoronzhuk
From: Hao Zhang 

This patch adds hardware definitions specific to Keystone II
Lamar (K2L) SoC.

Acked-by: Vitaly Andrianov 
Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---
 arch/arm/include/asm/arch-keystone/hardware-k2hk.h |  2 -
 arch/arm/include/asm/arch-keystone/hardware-k2l.h  | 74 ++
 arch/arm/include/asm/arch-keystone/hardware.h  | 13 
 3 files changed, 87 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-keystone/hardware-k2l.h

diff --git a/arch/arm/include/asm/arch-keystone/hardware-k2hk.h 
b/arch/arm/include/asm/arch-keystone/hardware-k2hk.h
index 43c2c42..2db806c 100644
--- a/arch/arm/include/asm/arch-keystone/hardware-k2hk.h
+++ b/arch/arm/include/asm/arch-keystone/hardware-k2hk.h
@@ -10,8 +10,6 @@
 #ifndef __ASM_ARCH_HARDWARE_K2HK_H
 #define __ASM_ARCH_HARDWARE_K2HK_H
 
-#define KS2_MISC_CTRL  (KS2_DEVICE_STATE_CTRL_BASE + 0xc7c)
-
 #define KS2_ARM_PLL_EN BIT(13)
 
 /* PA SS Registers */
diff --git a/arch/arm/include/asm/arch-keystone/hardware-k2l.h 
b/arch/arm/include/asm/arch-keystone/hardware-k2l.h
new file mode 100644
index 000..3402d0c
--- /dev/null
+++ b/arch/arm/include/asm/arch-keystone/hardware-k2l.h
@@ -0,0 +1,74 @@
+/*
+ * K2L: SoC definitions
+ *
+ * (C) Copyright 2012-2014
+ * Texas Instruments Incorporated, 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_K2L_H
+#define __ASM_ARCH_HARDWARE_K2L_H
+
+#define KS2_ARM_PLL_EN BIT(13)
+
+/* PA SS Registers */
+#define KS2_PASS_BASE  0x2600
+
+/* Power and Sleep Controller (PSC) Domains */
+#define KS2_LPSC_MOD   0
+#define KS2_LPSC_DFE_IQN_SYS   1
+#define KS2_LPSC_USB   2
+#define KS2_LPSC_EMIF25_SPI3
+#define KS2_LPSC_TSIP   4
+#define KS2_LPSC_DEBUGSS_TRC   5
+#define KS2_LPSC_TETB_TRC  6
+#define KS2_LPSC_PKTPROC   7
+#define KS2_LPSC_PAKS2_LPSC_PKTPROC
+#define KS2_LPSC_SGMII 8
+#define KS2_LPSC_CPGMACKS2_LPSC_SGMII
+#define KS2_LPSC_CRYPTO9
+#define KS2_LPSC_PCIE0 10
+#define KS2_LPSC_PCIE1 11
+#define KS2_LPSC_JESD_MISC 12
+#define KS2_LPSC_CHIP_SRSS 13
+#define KS2_LPSC_MSMC  14
+#define KS2_LPSC_GEM_1 16
+#define KS2_LPSC_GEM_2 17
+#define KS2_LPSC_GEM_3 18
+#define KS2_LPSC_EMIF4F_DDR3   23
+#define KS2_LPSC_TAC   25
+#define KS2_LPSC_RAC   26
+#define KS2_LPSC_DDUC4X_CFR2X_BB   27
+#define KS2_LPSC_FFTC_A28
+#define KS2_LPSC_OSR   34
+#define KS2_LPSC_TCP3D_0   35
+#define KS2_LPSC_TCP3D_1   37
+#define KS2_LPSC_VCP2X4_A  39
+#define KS2_LPSC_VCP2X4_B  40
+#define KS2_LPSC_VCP2X4_C  41
+#define KS2_LPSC_VCP2X4_D  42
+#define KS2_LPSC_BCP   47
+#define KS2_LPSC_DPD4X 48
+#define KS2_LPSC_FFTC_B49
+#define KS2_LPSC_IQN_AIL   50
+
+/* Chip Interrupt Controller */
+#define KS2_CIC2_DDR3_ECC_IRQ_NUM  0x0D3
+#define KS2_CIC2_DDR3_ECC_CHAN_NUM 0x01D
+
+/* Number of DSP cores */
+#define KS2_NUM_DSPS   4
+
+/* NETCP pktdma */
+#define KS2_NETCP_PDMA_CTRL_BASE   0x26186000
+#define KS2_NETCP_PDMA_TX_BASE 0x26187000
+#define KS2_NETCP_PDMA_TX_CH_NUM   21
+#define KS2_NETCP_PDMA_RX_BASE 0x26188000
+#define KS2_NETCP_PDMA_RX_CH_NUM   91
+#define KS2_NETCP_PDMA_SCHED_BASE  0x26186100
+#define KS2_NETCP_PDMA_RX_FLOW_BASE0x26189000
+#define KS2_NETCP_PDMA_RX_FLOW_NUM 96
+#define KS2_NETCP_PDMA_TX_SND_QUEUE896
+
+#endif /* __ASM_ARCH_HARDWARE_K2L_H */
diff --git a/arch/arm/include/asm/arch-keystone/hardware.h 
b/arch/arm/include/asm/arch-keystone/hardware.h
index fdffb87..89dce96 100644
--- a/arch/arm/include/asm/arch-keystone/hardware.h
+++ b/arch/arm/include/asm/arch-keystone/hardware.h
@@ -141,6 +141,7 @@ typedef volatile unsigned int   *dv_reg_p;
 /* Device speed */
 #define KS2_REV1_DEVSPEED  (KS2_DEVICE_STATE_CTRL_BASE + 0xc98)
 #define KS2_EFUSE_BOOTROM  (KS2_DEVICE_STATE_CTRL_BASE + 0xc90)
+#define KS2_MISC_CTRL  (KS2_DEVICE_STATE_CTRL_BASE + 0xc7c)
 
 /* Queue manager */
 #define KS2_QM_BASE_ADDRESS0x23a8
@@ -175,6 +176,10 @@ typedef volatile unsigned int   *dv_reg_p;
 #include 
 #endif
 
+#ifdef CONFIG_SOC_K2L
+#include 
+#endif
+
 #ifndef __ASSEMBLY__
 static inline int cpu_is_k2hk(void)
 {
@@ -192,6 +197,14 @@ static inline int cpu_is_k2e(void)
return (part_no == 0xb9a6) ? 1 : 0;
 }
 
+static inline int cpu_is_k2l(void)
+{
+   unsigned int jtag_id= __raw_readl(KS2_JTAG_ID_REG);
+   unsigned in

[U-Boot] [U-boot] [Patch 2/6] keystone2: clock: add K2L clock definitions and commands

2014-09-03 Thread Ivan Khoronzhuk
From: Hao Zhang 

This patch adds clock definitions and commands to support Keystone II
K2L SOC.

Acked-by: Vitaly Andrianov 
Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---
 arch/arm/cpu/armv7/keystone/Makefile   |   1 +
 arch/arm/cpu/armv7/keystone/clock-k2l.c| 139 +
 arch/arm/cpu/armv7/keystone/cmd_clock.c|  10 ++
 arch/arm/include/asm/arch-keystone/clock-k2l.h |  88 
 arch/arm/include/asm/arch-keystone/clock.h |   4 +
 5 files changed, 242 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/keystone/clock-k2l.c
 create mode 100644 arch/arm/include/asm/arch-keystone/clock-k2l.h

diff --git a/arch/arm/cpu/armv7/keystone/Makefile 
b/arch/arm/cpu/armv7/keystone/Makefile
index 3d8fb70..4750371 100644
--- a/arch/arm/cpu/armv7/keystone/Makefile
+++ b/arch/arm/cpu/armv7/keystone/Makefile
@@ -10,6 +10,7 @@ obj-y += psc.o
 obj-y  += clock.o
 obj-$(CONFIG_SOC_K2HK) += clock-k2hk.o
 obj-$(CONFIG_SOC_K2E) += clock-k2e.o
+obj-$(CONFIG_SOC_K2L) += clock-k2l.o
 obj-y  += cmd_clock.o
 obj-y  += cmd_mon.o
 obj-y  += msmc.o
diff --git a/arch/arm/cpu/armv7/keystone/clock-k2l.c 
b/arch/arm/cpu/armv7/keystone/clock-k2l.c
new file mode 100644
index 000..783355a
--- /dev/null
+++ b/arch/arm/cpu/armv7/keystone/clock-k2l.c
@@ -0,0 +1,139 @@
+/*
+ * Keystone2: get clk rate for K2L
+ *
+ * (C) Copyright 2012-2014
+ * Texas Instruments Incorporated, 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+
+const struct keystone_pll_regs keystone_pll_regs[] = {
+   [CORE_PLL] = {KS2_MAINPLLCTL0, KS2_MAINPLLCTL1},
+   [PASS_PLL] = {KS2_PASSPLLCTL0, KS2_PASSPLLCTL1},
+   [TETRIS_PLL] = {KS2_ARMPLLCTL0,  KS2_ARMPLLCTL1},
+   [DDR3_PLL] = {KS2_DDR3APLLCTL0, KS2_DDR3APLLCTL1},
+};
+
+int dev_speeds[] = {
+   SPD800,
+   SPD1000,
+   SPD1200,
+   SPD800,
+   SPD800,
+   SPD800,
+   SPD800,
+   SPD800,
+   SPD1200,
+   SPD1000,
+   SPD800,
+   SPD800,
+   SPD800,
+};
+
+int arm_speeds[] = {
+   SPD800,
+   SPD1000,
+   SPD1200,
+   SPD1350,
+   SPD1400,
+   SPD800,
+   SPD1400,
+   SPD1350,
+   SPD1200,
+   SPD1000,
+   SPD800,
+   SPD800,
+   SPD800,
+};
+
+/**
+ * pll_freq_get - get pll frequency
+ * Fout = Fref * NF(mult) / NR(prediv) / OD
+ * @pll:   pll identifier
+ */
+static unsigned long pll_freq_get(int pll)
+{
+   unsigned long mult = 1, prediv = 1, output_div = 2;
+   unsigned long ret;
+   u32 tmp, reg;
+
+   if (pll == CORE_PLL) {
+   ret = external_clk[sys_clk];
+   if (pllctl_reg_read(pll, ctl) & PLLCTL_PLLEN) {
+   /* PLL mode */
+   tmp = __raw_readl(KS2_MAINPLLCTL0);
+   prediv = (tmp & PLL_DIV_MASK) + 1;
+   mult = (((tmp & PLLM_MULT_HI_SMASK) >> 6) |
+   (pllctl_reg_read(pll, mult) &
+   PLLM_MULT_LO_MASK)) + 1;
+   output_div = ((pllctl_reg_read(pll, secctl) >>
+   PLL_CLKOD_SHIFT) & PLL_CLKOD_MASK) + 1;
+
+   ret = ret / prediv / output_div * mult;
+   }
+   } else {
+   switch (pll) {
+   case PASS_PLL:
+   ret = external_clk[pa_clk];
+   reg = KS2_PASSPLLCTL0;
+   break;
+   case TETRIS_PLL:
+   ret = external_clk[tetris_clk];
+   reg = KS2_ARMPLLCTL0;
+   break;
+   case DDR3_PLL:
+   ret = external_clk[ddr3_clk];
+   reg = KS2_DDR3APLLCTL0;
+   break;
+   default:
+   return 0;
+   }
+
+   tmp = __raw_readl(reg);
+
+   if (!(tmp & PLLCTL_BYPASS)) {
+   /* Bypass disabled */
+   prediv = (tmp & PLL_DIV_MASK) + 1;
+   mult = ((tmp >> PLL_MULT_SHIFT) & PLL_MULT_MASK) + 1;
+   output_div = ((tmp >> PLL_CLKOD_SHIFT) &
+ PLL_CLKOD_MASK) + 1;
+   ret = ((ret / prediv) * mult) / output_div;
+   }
+   }
+
+   return ret;
+}
+
+unsigned long clk_get_rate(unsigned int clk)
+{
+   switch (clk) {
+   case core_pll_clk:  return pll_freq_get(CORE_PLL);
+   case pass_pll_clk:  return pll_freq_get(PASS_PLL);
+   case tetris_pll_clk:return pll_freq_get(TETRIS_PLL);
+   case ddr3_pll_clk:  return pll_freq_get(DDR3_PLL);
+   case sys_clk0_1_clk:
+   case sys_clk0_clk:  return pll_freq_get(CORE_PLL) / pll0div_read(1);
+   case sys_clk1_clk:  return pll_freq_get(CORE_PLL) / pll0div_read(2);
+   case sys_clk2_clk:  return pl

[U-Boot] [U-boot] [Patch 0/6] keystone2: add k2l SoC and k2l_evm board support

2014-09-03 Thread Ivan Khoronzhuk
This patch series adds Keystone II Lamar (K2L) SoC and k2l_evm
board support.

Based on "[U-boot] [Patch] mtd: nand: davinci_nand:
  correct keystone RBL layout definition"
https://www.mail-archive.com/u-boot@lists.denx.de/msg146305.html

Hao Zhang (6):
  ARM: keystone2: add K2L device hardware definitions
  keystone2: clock: add K2L clock definitions and commands
  keystone2: msmc: add MSMC cache coherency support for K2L SOC
  ARM: keystone2: spl: add K2L SoC support
  keystone2: enable OSR clock domain for K2L SoC
  keystone2: k2l-evm: add board support

 arch/arm/Kconfig   |   3 +
 arch/arm/cpu/armv7/keystone/Makefile   |   1 +
 arch/arm/cpu/armv7/keystone/clock-k2l.c| 139 +
 arch/arm/cpu/armv7/keystone/cmd_clock.c|  10 ++
 arch/arm/cpu/armv7/keystone/init.c |  52 
 arch/arm/cpu/armv7/keystone/spl.c  |   7 ++
 arch/arm/include/asm/arch-keystone/clock-k2l.h |  94 ++
 arch/arm/include/asm/arch-keystone/clock.h |   4 +
 arch/arm/include/asm/arch-keystone/hardware-k2hk.h |   2 -
 arch/arm/include/asm/arch-keystone/hardware-k2l.h  |  99 +++
 arch/arm/include/asm/arch-keystone/hardware.h  |  14 +++
 board/ti/ks2_evm/Kconfig   |  24 
 board/ti/ks2_evm/Makefile  |   2 +
 board/ti/ks2_evm/board_k2l.c   |  60 +
 board/ti/ks2_evm/ddr3_cfg.c|  36 ++
 board/ti/ks2_evm/ddr3_cfg.h|   3 +
 board/ti/ks2_evm/ddr3_k2l.c|  43 +++
 configs/k2l_evm_defconfig  |   2 +
 include/configs/k2l_evm.h  |  37 ++
 19 files changed, 630 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/keystone/clock-k2l.c
 create mode 100644 arch/arm/include/asm/arch-keystone/clock-k2l.h
 create mode 100644 arch/arm/include/asm/arch-keystone/hardware-k2l.h
 create mode 100644 board/ti/ks2_evm/board_k2l.c
 create mode 100644 board/ti/ks2_evm/ddr3_k2l.c
 create mode 100644 configs/k2l_evm_defconfig
 create mode 100644 include/configs/k2l_evm.h

-- 
1.8.3.2

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


Re: [U-Boot] [PATCH v2] env_mmc: correct fini partition to match init partition

2014-09-03 Thread Peter A. Bigot

On 09/03/2014 11:52 AM, Stephen Warren wrote:

On 09/03/2014 10:32 AM, Peter A. Bigot wrote:

The code to set the MMC partition uses an weak function to obtain the
correct partition number.  Use that instead of the compile-time default
when deciding whether it needs to switch back.


Yes, this clearly fixes a bug.

Can you also please add a Fixes: tag that refers to the commit which 
introduced the problem (i.e. which updated mmc_set_env_part() to call 
mmc_get_env_part(), but forgot to update fini_mmc_for_env() to match.


Done.

If this tag is important enough to ask people to add it and resubmit 
their patches with no other changes, it should probably be described at 
http://www.denx.de/wiki/view/U-Boot/Patches#Review_Process_Git_Tags and 
suggested in the section on general patch submission rules, so the poor 
contributor might have a chance of being able to avoid the rework.


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


[U-Boot] [PATCH v3] env_mmc: correct fini partition to match init partition

2014-09-03 Thread Peter A. Bigot
The code to set the MMC partition uses an weak function to obtain the
correct partition number.  Use that instead of the compile-time default
when deciding whether it needs to switch back.

Fixes: 6e7b7df4df43574 ("env_mmc: support env partition setup in runtime")
Signed-off-by: Peter A. Bigot 
---
V3:
* Add Fixes line as requested

V2:
* Preserve desired behavior of avoiding diagnostic when no HW partition 
supported
* Supersedes https://patchwork.ozlabs.org/patch/385355/

 common/env_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/env_mmc.c b/common/env_mmc.c
index a7621a8..14648e3 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -113,7 +113,7 @@ static void fini_mmc_for_env(struct mmc *mmc)
 #ifdef CONFIG_SPL_BUILD
dev = 0;
 #endif
-   if (CONFIG_SYS_MMC_ENV_PART != mmc->part_num)
+   if (mmc_get_env_part(mmc) != mmc->part_num)
mmc_switch_part(dev, mmc->part_num);
 #endif
 }
-- 
1.8.5.5

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


[U-Boot] [PATCH v3 2/4] update code which handles Android sparse image format

2014-09-03 Thread Steve Rae
- remove unnecessary functions

Signed-off-by: Steve Rae 
---

Changes in v3: None
Changes in v2: None

 common/aboot.c | 2438 
 1 file changed, 2438 deletions(-)

diff --git a/common/aboot.c b/common/aboot.c
index 3b5092d..a302c92 100644
--- a/common/aboot.c
+++ b/common/aboot.c
@@ -30,1819 +30,6 @@
  *
  */
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#if DEVICE_TREE
-#include 
-#include 
-#endif
-
-#include "image_verify.h"
-#include "recovery.h"
-#include "bootimg.h"
-#include "fastboot.h"
-#include "sparse_format.h"
-#include "mmc.h"
-#include "devinfo.h"
-#include "board.h"
-#include "scm.h"
-
-extern  bool target_use_signed_kernel(void);
-extern void platform_uninit(void);
-extern void target_uninit(void);
-extern int get_target_boot_params(const char *cmdline, const char *part,
- char *buf, int buflen);
-
-void write_device_info_mmc(device_info *dev);
-void write_device_info_flash(device_info *dev);
-
-#define EXPAND(NAME) #NAME
-#define TARGET(NAME) EXPAND(NAME)
-
-#ifdef MEMBASE
-#define EMMC_BOOT_IMG_HEADER_ADDR (0xFF000+(MEMBASE))
-#else
-#define EMMC_BOOT_IMG_HEADER_ADDR 0xFF000
-#endif
-
-#ifndef MEMSIZE
-#define MEMSIZE 1024*1024
-#endif
-
-#define MAX_TAGS_SIZE   1024
-
-#define RECOVERY_MODE   0x77665502
-#define FASTBOOT_MODE   0x77665500
-
-/* make 4096 as default size to ensure EFS,EXT4's erasing */
-#define DEFAULT_ERASE_SIZE  4096
-#define MAX_PANEL_BUF_SIZE 128
-
-#define UBI_MAGIC  "UBI#"
-#define DISPLAY_DEFAULT_PREFIX "mdss_mdp"
-#define UBI_MAGIC_SIZE 0x04
-#define BOOT_DEV_MAX_LEN  64
-
-#define IS_ARM64(ptr) (ptr->magic_64 == KERNEL64_HDR_MAGIC) ? true : false
-
-#define ADD_OF(a, b) (UINT_MAX - b > a) ? (a + b) : UINT_MAX
-
-#if UFS_SUPPORT
-static const char *emmc_cmdline = " androidboot.bootdevice=";
-#else
-static const char *emmc_cmdline = " androidboot.emmc=true";
-#endif
-static const char *usb_sn_cmdline = " androidboot.serialno=";
-static const char *androidboot_mode = " androidboot.mode=";
-static const char *loglevel = " quiet";
-static const char *battchg_pause = " androidboot.mode=charger";
-static const char *auth_kernel = " androidboot.authorized_kernel=true";
-static const char *secondary_gpt_enable = " gpt";
-
-static const char *baseband_apq = " androidboot.baseband=apq";
-static const char *baseband_msm = " androidboot.baseband=msm";
-static const char *baseband_csfb= " androidboot.baseband=csfb";
-static const char *baseband_svlte2a = " androidboot.baseband=svlte2a";
-static const char *baseband_mdm = " androidboot.baseband=mdm";
-static const char *baseband_mdm2= " androidboot.baseband=mdm2";
-static const char *baseband_sglte   = " androidboot.baseband=sglte";
-static const char *baseband_dsda= " androidboot.baseband=dsda";
-static const char *baseband_dsda2   = " androidboot.baseband=dsda2";
-static const char *baseband_sglte2  = " androidboot.baseband=sglte2";
-static const char *warmboot_cmdline = " qpnp-power-on.warm_boot=1";
-
-static unsigned page_size = 0;
-static unsigned page_mask = 0;
-static char ffbm_mode_string[FFBM_MODE_BUF_SIZE];
-static bool boot_into_ffbm;
-static char target_boot_params[64];
-
-/* Assuming unauthorized kernel image by default */
-static int auth_kernel_img = 0;
-
-static device_info device = {DEVICE_MAGIC, 0, 0, 0, 0};
-
-struct atag_ptbl_entry
-{
-   char name[16];
-   unsigned offset;
-   unsigned size;
-   unsigned flags;
-};
-
-/*
- * Partition info, required to be published
- * for fastboot
- */
-struct getvar_partition_info {
-   const char part_name[MAX_GPT_NAME_SIZE]; /* Partition name */
-   char getvar_size[MAX_GET_VAR_NAME_SIZE]; /* fastboot get var name for 
size */
-   char getvar_type[MAX_GET_VAR_NAME_SIZE]; /* fastboot get var name for 
type */
-   char size_response[MAX_RSP_SIZE];/* fastboot response for size 
*/
-   char type_response[MAX_RSP_SIZE];/* fastboot response for type 
*/
-};
-
-/*
- * Right now, we are publishing the info for only
- * three partitions
- */
-struct getvar_partition_info part_info[] =
-{
-   { "system"  , "partition-size:", "partition-type:", "", "ext4" },
-   { "userdata", "partition-size:", "partition-type:", "", "ext4" },
-   { "cache"   , "partition-size:", "partition-type:", "", "ext4" },
-};
-
-char max_download_size[MAX_RSP_SIZE];
-char charger_screen_enabled[MAX_RSP_SIZE];
-char sn_buf[13];
-char display_panel_buf[MAX_PANEL_BUF_SIZE];
-char panel_display_mode[MAX_RSP_SIZE];
-
-extern int emmc_recovery_init(void);
-
-#if NO_KEYPAD_DRIVER
-extern int fastboot_trigger(void);
-#endif
-
-static void update_ker_tags_rdisk_addr(struct boot_img_hdr *hdr, bool is_arm64)
-{
-   /* o

[U-Boot] [PATCH v3 4/4] implement the Android sparse image format

2014-09-03 Thread Steve Rae
update to provide usable implementation to U-Boot

Signed-off-by: Steve Rae 
---

Changes in v3: None
Changes in v2: None

 common/aboot.c| 129 +-
 include/aboot.h   |  28 +++
 include/sparse_defs.h |   7 +++
 3 files changed, 111 insertions(+), 53 deletions(-)
 create mode 100644 include/aboot.h
 create mode 100644 include/sparse_defs.h

diff --git a/common/aboot.c b/common/aboot.c
index 3611feb..d5c464b 100644
--- a/common/aboot.c
+++ b/common/aboot.c
@@ -3,6 +3,7 @@
  * All rights reserved.
  *
  * Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
+ * Portions Copyright 2014 Broadcom Corporation.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -33,44 +34,32 @@
  *   to the "BSD-3-Clause", therefore, DO NOT MODIFY THIS LICENSE TEXT!
  */
 
-void cmd_flash_mmc_sparse_img(const char *arg, void *data, unsigned sz)
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+void write_sparse_image(block_dev_desc_t *dev_desc,
+   disk_partition_t *info, const char *part_name,
+   void *data, unsigned sz)
 {
+   lbaint_t blk;
+   lbaint_t blkcnt;
+   lbaint_t blks;
+   uint32_t bytes_written = 0;
unsigned int chunk;
unsigned int chunk_data_sz;
uint32_t *fill_buf = NULL;
uint32_t fill_val;
-   uint32_t chunk_blk_cnt = 0;
sparse_header_t *sparse_header;
chunk_header_t *chunk_header;
uint32_t total_blocks = 0;
-   unsigned long long ptn = 0;
-   unsigned long long size = 0;
-   int index = INVALID_PTN;
int i;
-   uint8_t lun = 0;
-
-   index = partition_get_index(arg);
-   ptn = partition_get_offset(index);
-   if(ptn == 0) {
-   fastboot_fail("partition table doesn't exist");
-   return;
-   }
-
-   size = partition_get_size(index);
-   if (ROUND_TO_PAGE(sz,511) > size) {
-   fastboot_fail("size too large");
-   return;
-   }
-
-   lun = partition_get_lun(index);
-   mmc_set_lun(lun);
 
/* Read and skip over sparse image header */
sparse_header = (sparse_header_t *) data;
-   if ((sparse_header->total_blks * sparse_header->blk_sz) > size) {
-   fastboot_fail("size too large");
-   return;
-   }
 
data += sparse_header->file_hdr_sz;
if (sparse_header->file_hdr_sz > sizeof(sparse_header_t))
@@ -92,17 +81,31 @@ void cmd_flash_mmc_sparse_img(const char *arg, void *data, 
unsigned sz)
debug("total_blks: %d\n", sparse_header->total_blks);
debug("total_chunks: %d\n", sparse_header->total_chunks);
 
+   /* verify sparse_header->blk_sz is an exact multiple of info->blksz */
+   if (sparse_header->blk_sz !=
+   (sparse_header->blk_sz & ~(info->blksz - 1))) {
+   printf("%s: Sparse image block size issue [%u]\n",
+  __func__, sparse_header->blk_sz);
+   fastboot_fail("sparse image block size issue");
+   return;
+   }
+
+   puts("Flashing Sparse Image\n");
+
/* Start processing chunks */
+   blk = info->start;
for (chunk=0; chunktotal_chunks; chunk++)
{
/* Read and skip over chunk header */
chunk_header = (chunk_header_t *) data;
data += sizeof(chunk_header_t);
 
-   debug("=== Chunk Header ===\n");
-   debug("chunk_type: 0x%x\n", chunk_header->chunk_type);
-   debug("chunk_data_sz: 0x%x\n", chunk_header->chunk_sz);
-   debug("total_size: 0x%x\n", chunk_header->total_sz);
+   if (chunk_header->chunk_type != CHUNK_TYPE_RAW) {
+   debug("=== Chunk Header ===\n");
+   debug("chunk_type: 0x%x\n", chunk_header->chunk_type);
+   debug("chunk_data_sz: 0x%x\n", chunk_header->chunk_sz);
+   debug("total_size: 0x%x\n", chunk_header->total_sz);
+   }
 
if (sparse_header->chunk_hdr_sz > sizeof(chunk_header_t))
{
@@ -115,6 +118,7 @@ void cmd_flash_mmc_sparse_img(const char *arg, void *data, 
unsigned sz)
}
 
chunk_data_sz = sparse_header->blk_sz * chunk_header->chunk_sz;
+   blkcnt = chunk_data_sz / info->blksz;
switch (chunk_header->chunk_type)
{
case CHUNK_TYPE_RAW:
@@ -126,14 +130,25 @@ void cmd_flash_mmc_sparse_img(const char *arg, void 
*data, unsigned sz)
return;
}
 
-   if (mmc_write(ptn +
- ((uint64_t)total_blocks *
-sparse_header->blk_sz),
-  

[U-Boot] [PATCH v3 0/4] Implement "sparse format" for fastboot

2014-09-03 Thread Steve Rae
This series implements the "sparse format" file handling for fastboot.
- [1/4] brings in the pristine file "aboot.c"
- [2/4] deletes all unnecessary functions in "aboot.c"
- [3/4] is a simple cleanup of "aboot.c"
- [4/4] provides the implementation of "aboot.c" suitable for U-Boot

Changes in v3:
- use original license text

Changes in v2:
- use BSD-3-Clause

Steve Rae (4):
  add code to handle Android sparse image format
  update code which handles Android sparse image format
  cleanup code which handles the Android sparse image format
  implement the Android sparse image format

 common/aboot.c| 243 ++
 include/aboot.h   |  28 ++
 include/sparse_defs.h |   7 ++
 3 files changed, 278 insertions(+)
 create mode 100644 common/aboot.c
 create mode 100644 include/aboot.h
 create mode 100644 include/sparse_defs.h

-- 
1.8.5

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


[U-Boot] [PATCH v3 1/4] add code to handle Android sparse image format

2014-09-03 Thread Steve Rae
Add original file (pristine) from :
  
https://www.codeaurora.org/cgit/quic/la/kernel/lk/plain/app/aboot/aboot.c?h=master
[3b5092d20bd15a7a2879c13e9f64acc48d04af2d]

Signed-off-by: Steve Rae 
---

Changes in v3: None
Changes in v2: None

 common/aboot.c | 2643 
 1 file changed, 2643 insertions(+)
 create mode 100644 common/aboot.c

diff --git a/common/aboot.c b/common/aboot.c
new file mode 100644
index 000..3b5092d
--- /dev/null
+++ b/common/aboot.c
@@ -0,0 +1,2643 @@
+/*
+ * Copyright (c) 2009, Google Inc.
+ * All rights reserved.
+ *
+ * Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * * Neither the name of The Linux Foundation nor
+ *   the names of its contributors may be used to endorse or promote
+ *   products derived from this software without specific prior written
+ *   permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if DEVICE_TREE
+#include 
+#include 
+#endif
+
+#include "image_verify.h"
+#include "recovery.h"
+#include "bootimg.h"
+#include "fastboot.h"
+#include "sparse_format.h"
+#include "mmc.h"
+#include "devinfo.h"
+#include "board.h"
+#include "scm.h"
+
+extern  bool target_use_signed_kernel(void);
+extern void platform_uninit(void);
+extern void target_uninit(void);
+extern int get_target_boot_params(const char *cmdline, const char *part,
+ char *buf, int buflen);
+
+void write_device_info_mmc(device_info *dev);
+void write_device_info_flash(device_info *dev);
+
+#define EXPAND(NAME) #NAME
+#define TARGET(NAME) EXPAND(NAME)
+
+#ifdef MEMBASE
+#define EMMC_BOOT_IMG_HEADER_ADDR (0xFF000+(MEMBASE))
+#else
+#define EMMC_BOOT_IMG_HEADER_ADDR 0xFF000
+#endif
+
+#ifndef MEMSIZE
+#define MEMSIZE 1024*1024
+#endif
+
+#define MAX_TAGS_SIZE   1024
+
+#define RECOVERY_MODE   0x77665502
+#define FASTBOOT_MODE   0x77665500
+
+/* make 4096 as default size to ensure EFS,EXT4's erasing */
+#define DEFAULT_ERASE_SIZE  4096
+#define MAX_PANEL_BUF_SIZE 128
+
+#define UBI_MAGIC  "UBI#"
+#define DISPLAY_DEFAULT_PREFIX "mdss_mdp"
+#define UBI_MAGIC_SIZE 0x04
+#define BOOT_DEV_MAX_LEN  64
+
+#define IS_ARM64(ptr) (ptr->magic_64 == KERNEL64_HDR_MAGIC) ? true : false
+
+#define ADD_OF(a, b) (UINT_MAX - b > a) ? (a + b) : UINT_MAX
+
+#if UFS_SUPPORT
+static const char *emmc_cmdline = " androidboot.bootdevice=";
+#else
+static const char *emmc_cmdline = " androidboot.emmc=true";
+#endif
+static const char *usb_sn_cmdline = " androidboot.serialno=";
+static const char *androidboot_mode = " androidboot.mode=";
+static const char *loglevel = " quiet";
+static const char *battchg_pause = " androidboot.mode=charger";
+static const char *auth_kernel = " androidboot.authorized_kernel=true";
+static const char *secondary_gpt_enable = " gpt";
+
+static const char *baseband_apq = " androidboot.baseband=apq";
+static const char *baseband_msm = " androidboot.baseband=msm";
+static const char *baseband_csfb= " androidboot.baseband=csfb";
+static const char *baseband_svlte2a = " androidboot.baseband=svlte2a";
+static const char *baseband_mdm = " androidboot.baseband=mdm";
+static const char *baseband_mdm2= " androidboot.baseband=mdm2";
+static const char *baseband_sglte   = " androidboot.baseband=sglte";
+static const char *baseband_dsda= " androidboot.baseband=dsda";
+static const char *baseband_dsda2   =

[U-Boot] [PATCH v3 3/4] cleanup code which handles the Android sparse image format

2014-09-03 Thread Steve Rae
- port dprintf() to debug()
- update formatting

Signed-off-by: Steve Rae 
---

Changes in v3:
- use original license text

Changes in v2:
- use BSD-3-Clause

 common/aboot.c | 97 +-
 1 file changed, 56 insertions(+), 41 deletions(-)

diff --git a/common/aboot.c b/common/aboot.c
index a302c92..3611feb 100644
--- a/common/aboot.c
+++ b/common/aboot.c
@@ -28,6 +28,9 @@
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
+ * NOTE:
+ *   Although it is very similar, this license text is not identical
+ *   to the "BSD-3-Clause", therefore, DO NOT MODIFY THIS LICENSE TEXT!
  */
 
 void cmd_flash_mmc_sparse_img(const char *arg, void *data, unsigned sz)
@@ -70,23 +73,24 @@ void cmd_flash_mmc_sparse_img(const char *arg, void *data, 
unsigned sz)
}
 
data += sparse_header->file_hdr_sz;
-   if(sparse_header->file_hdr_sz > sizeof(sparse_header_t))
+   if (sparse_header->file_hdr_sz > sizeof(sparse_header_t))
{
-   /* Skip the remaining bytes in a header that is longer than
+   /*
+* Skip the remaining bytes in a header that is longer than
 * we expected.
 */
data += (sparse_header->file_hdr_sz - sizeof(sparse_header_t));
}
 
-   dprintf (SPEW, "=== Sparse Image Header ===\n");
-   dprintf (SPEW, "magic: 0x%x\n", sparse_header->magic);
-   dprintf (SPEW, "major_version: 0x%x\n", sparse_header->major_version);
-   dprintf (SPEW, "minor_version: 0x%x\n", sparse_header->minor_version);
-   dprintf (SPEW, "file_hdr_sz: %d\n", sparse_header->file_hdr_sz);
-   dprintf (SPEW, "chunk_hdr_sz: %d\n", sparse_header->chunk_hdr_sz);
-   dprintf (SPEW, "blk_sz: %d\n", sparse_header->blk_sz);
-   dprintf (SPEW, "total_blks: %d\n", sparse_header->total_blks);
-   dprintf (SPEW, "total_chunks: %d\n", sparse_header->total_chunks);
+   debug("=== Sparse Image Header ===\n");
+   debug("magic: 0x%x\n", sparse_header->magic);
+   debug("major_version: 0x%x\n", sparse_header->major_version);
+   debug("minor_version: 0x%x\n", sparse_header->minor_version);
+   debug("file_hdr_sz: %d\n", sparse_header->file_hdr_sz);
+   debug("chunk_hdr_sz: %d\n", sparse_header->chunk_hdr_sz);
+   debug("blk_sz: %d\n", sparse_header->blk_sz);
+   debug("total_blks: %d\n", sparse_header->total_blks);
+   debug("total_chunks: %d\n", sparse_header->total_chunks);
 
/* Start processing chunks */
for (chunk=0; chunktotal_chunks; chunk++)
@@ -95,33 +99,37 @@ void cmd_flash_mmc_sparse_img(const char *arg, void *data, 
unsigned sz)
chunk_header = (chunk_header_t *) data;
data += sizeof(chunk_header_t);
 
-   dprintf (SPEW, "=== Chunk Header ===\n");
-   dprintf (SPEW, "chunk_type: 0x%x\n", chunk_header->chunk_type);
-   dprintf (SPEW, "chunk_data_sz: 0x%x\n", chunk_header->chunk_sz);
-   dprintf (SPEW, "total_size: 0x%x\n", chunk_header->total_sz);
+   debug("=== Chunk Header ===\n");
+   debug("chunk_type: 0x%x\n", chunk_header->chunk_type);
+   debug("chunk_data_sz: 0x%x\n", chunk_header->chunk_sz);
+   debug("total_size: 0x%x\n", chunk_header->total_sz);
 
-   if(sparse_header->chunk_hdr_sz > sizeof(chunk_header_t))
+   if (sparse_header->chunk_hdr_sz > sizeof(chunk_header_t))
{
-   /* Skip the remaining bytes in a header that is longer 
than
-* we expected.
+   /*
+* Skip the remaining bytes in a header that is longer
+* than we expected.
 */
-   data += (sparse_header->chunk_hdr_sz - 
sizeof(chunk_header_t));
+   data += (sparse_header->chunk_hdr_sz -
+sizeof(chunk_header_t));
}
 
chunk_data_sz = sparse_header->blk_sz * chunk_header->chunk_sz;
switch (chunk_header->chunk_type)
{
case CHUNK_TYPE_RAW:
-   if(chunk_header->total_sz != 
(sparse_header->chunk_hdr_sz +
-   
chunk_data_sz))
+   if (chunk_header->total_sz !=
+   (sparse_header->chunk_hdr_sz + chunk_data_sz))
{
-   fastboot_fail("Bogus chunk size for chunk type 
Raw");
+   fastboot_fail(
+   "Bogus chunk size for chunk type Raw");
return;
}
 
-   if(mmc_write(ptn + 
((uint64

Re: [U-Boot] mini summit talk proposal: "Getting SoC vendors to work with upstream u-boot"

2014-09-03 Thread Detlev Zundel
Hi Hans,

> I would to give a talk (more an intro to a group wide discussion) on
> how to get (more) manufacturers engaged in upstreaming their work /
> working directly with upstream from day one.

This is very welcome indeed, thanks!

> My own experience in this lies with the Allwinner sunxi support,
> where Allwinner themselves are shipping a quite old u-boot, which
> is not even fully functional as it gets chainloaded by a custom
> loader which sets up RAM first. Thanks to the work of various
> people in the community we've a fully functional u-boot (replacing
> the custom loader) for sun4i, sun5i and sun7i. But we are still
> e.g. waiting for someone to get sun6i support in place.
>
> This is not good, so I would like to give a talk with some
> proposals to (try to) get more manufacturers working with upstream,
> and then have a discussion on this.

Sounds very good to me.

> Biography:
> Hans has been a Linux developer since 1996, working on a wide variety
> of projects, lots of Fedora packaging work, writing various hwmon
> kernel drivers,
> (re)writing many webcam drivers, writing libv4l, various usb kernel
> work, libusb
> maintainership, Allwinner sunxi kernel and u-boot work.
>
> Since 2008 Hans works for Red Hat, besides continuing all the FOSS
> work he did before,
> at Red Hat he has worked on anaconda the Fedora / Red Hat installer,
> parted (the partition tool),
> Spice and usb-redirection under qemu, and currently he works on the
> input stack for
> wayland and new touchpad support for the kernel.

I reserved a 30 minutes time slot for you on our wiki[1].

Best wishes
  Detlev

[1] http://www.denx.de/wiki/U-Boot/MiniSummitELCE2014

-- 
I've been examining the existing [linux]  kernel configuration system, and I
have about concluded that the best favor we could do everybody involved with
it is to take it out behind the barn and shoot it through the head.
   -- Eric S. Raymond on linux-kbuild Mar 2000
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Call for participation in the U-Boot Mini Summit 2014

2014-09-03 Thread Przemyslaw Marczak

Hello Detlev,

On 08/11/2014 05:48 PM, Przemyslaw Marczak wrote:

Hello Detlev,

On 01/13/2014 06:12 PM, Detlev Zundel wrote:

Hi,

as already indicated, we are looking forward to our next U-Boot Mini
Summit at Embedded Linux Conference Europe 2014 which will take place in
Düsseldorf, Germany from October 13 - 15.

The call for papers of the main conference is now open[1] and if you
want to submit a talk for the main tracks, you should note the deadline
of July 11.

For our U-Boot Mini Summit, I'd like to get the schedule completed
synchronized to the schedule release of the main event, which is August
12.  So please submit talk proposals here with at least me on CC.

To coordinate the event better, I have setup another wiki page[2] that
can and _should_ be edited by the interested parties.  Feel free for
example to add yourself to the "interested participants" so that we get
an idea of how many of the U-Boot developers will be there.

Best wishes
   Detlev

[1]
http://events.linuxfoundation.org/events/embedded-linux-conference-europe/program/cfp

[2] http://www.denx.de/wiki/U-Boot/MiniSummitELCE2014



Tomorrow is the last day of submitting the talk proposals for U-Boot
Mini Summit, but there was no response for your e-mail and also there
are no topics on the wiki site.

So, will be there only an open discussion?

Some time ago I've send a RFC:
http://lists.denx.de/pipermail/u-boot/2014-May/179241.html

It was about PMIC/POWER framework rework - but I didn't have a time to
work on it.

Simon Glass has done a lot of work by introducing driver model to serial
and gpio last time, and I would like to rework PMIC drivers and pmic
framework using the DM.

So, can I reserve about 30min slot for a discussion?

Best Regards,


I am sending my late abstract:

"Power(full) framework based on Driver Model - discussion"

Abstract:

There are lots of various Power Management IC's in the Embedded Systems
nowadays. Each can provide the same functionality, like a voltage 
regulators, chargers, signal switches and some more - which are usually 
driven in a device specific way.


Beside the battery state, the current PMIC framework provides registers 
read/write operations only. So the user is obligated to check the 
documentation and set a specific value of some register to change the 
state of any regulator.


To solve the problem with driving common functionality - the Driver 
Model can be used.


The aim of this discussion is to present author's conception about how 
to use the Driver Model, and get the feedback from the listeners

to introduce a common and functional framework architecture.

I suppose that I will need about 30 minutes for this discussion.

Best Regards.
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marc...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] env_mmc: correct fini partition to match init partition

2014-09-03 Thread Stephen Warren

On 09/03/2014 10:32 AM, Peter A. Bigot wrote:

The code to set the MMC partition uses an weak function to obtain the
correct partition number.  Use that instead of the compile-time default
when deciding whether it needs to switch back.


Yes, this clearly fixes a bug.

Can you also please add a Fixes: tag that refers to the commit which 
introduced the problem (i.e. which updated mmc_set_env_part() to call 
mmc_get_env_part(), but forgot to update fini_mmc_for_env() to match.

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


Re: [U-Boot] [PATCH] cmd_mem: add static to internally used functions

2014-09-03 Thread Simon Glass
On 3 September 2014 08:38, Masahiro Yamada  wrote:
> Signed-off-by: Masahiro Yamada 

Would be nice to have a short commit message.

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


Re: [U-Boot] Call for participation in the U-Boot Mini Summit 2014

2014-09-03 Thread Detlev Zundel
Hi Lukasz,

[...]

> I'd like to share with the u-boot mailing list the proposal of my talk
> for u-boot's Mini summit in the ELCE2014.

Thanks a lot for the proposal.

> __Mainline u-boot for Tizen 3.0 - “war story”__
>
> Abstract:
>
> Utilization of u-boot bootloader at Samsung's Linux powered platforms
> has a long history.  For Tizen 3.0 the reference devices for mobile
> profile (RD_PQ and Odroid U3/X2) are due to run with u-boot developed
> with open source philosophy applied. It means that the code was
> developed, reviewed and tested first in the open source and then
> reused in Tizen.
>
> Introduced changes to mainline code were minimal and only necessary for
> assuring backward compatibility. In his presentation Lukasz will
> briefly cover history and future plans of u-boot development for Tizen
> (as e.g. ongoing work on single binary for Odroid U3 and M0), explain
> key aspects of persuading community to accept solutions tunned for
> mobile devices, present remarkable u-boot's “war stories” and give a
> handful of tips for successful cooperation with community.
>
> I would need around 25 minutes for talk and 5 more for discussion.

I really appreciate such a "war story" talk.  Actually I tried nudging a
lot of people to do such a thing but until now without any success - so
I'm all the more happy to see it finally appear.  I guess it will be
very instructive to share such inside experience on how to integrate a
decentralized open source component in a professional work flow.  Such
procedures have materialized around the Linux kernel, but the situation
is not so clear in the bootloader area that has traditionally seen a lot
of "fire and forget" strategies.

As I did not see any negative reaction to that talk, I'd say the talk is
accepted.

Best wishes
  Detlev
  
-- 
More than any other time in history, mankind faces a crossroads.  One
path leads  to despair  and utter  hopelessness.   The other to total
extinction.  Let us pray, we have the wisdom to choose correctly.
-- Woody Allen
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Call for participation in the U-Boot Mini Summit 2014

2014-09-03 Thread Detlev Zundel
Hi Marek,

[...]

> I got my talk, "Secure and flexible boot with U-Boot bootloader",
> accepted for the main track it seems. It's mostly about "use fitImage
> and use UBI on NAND" kind of talk, which covers introduction to
> fitImage and storing system components on UBI/UBIFS to prevent
> problems like silent data corruption on modern systems.

Excellent!

> That being said, I believe I won't be able to cover the fitImage
> verified boot part properly, so I might as well cook a talk for the
> u-boot summit about this advanced topic.

We had a talk about that exact topic last year on the main track by
Simon and in the mini summit by Jagan Teki[1].  In what respect will
your talk differ from that?

Thanks
  Detlev
  
[1] http://www.denx.de/wiki/U-Boot/MiniSummitELCE2013

-- 
"Milk?" called Reg. "Er, please." "One lump or two?" "One, please." "Sugar?"

Dirk Gently's Holistic Detective Agency, Douglas Adams
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Call for participation in the U-Boot Mini Summit 2014

2014-09-03 Thread Detlev Zundel
Hi Lukasz,

[...]

>> btw. Tom etc., do we have some "list of talks" for the minisummit or
>> some program for it available somewhere ? When is the deadline for
>> CFP ?
>
> I would also like to pose this question. Is there any ongoing work on
> the minisummit schedule?

Yes, I'm collecting all information and will push it to the wiki.

Best wishes
  Detlev
  
-- 
Man gelangt nicht dazu, gluecklich zu sein, aber man macht Feststellungen
ueber die Gruende, die uns daran hindern es zu sein.
-- Marcel Proust
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] mmc: restore capacity when switching to partition 0

2014-09-03 Thread Peter A. Bigot

On 09/03/2014 11:05 AM, Stephen Warren wrote:

On 09/03/2014 09:59 AM, Peter A. Bigot wrote:

On 09/03/2014 10:48 AM, Stephen Warren wrote:

On 09/02/2014 05:31 PM, Peter A. Bigot wrote:

The capacity and lba for an MMC device with part_num 0 reflects the
whole device.  When mmc_switch_part() successfully switches to a
partition, the capacity is changed to that partition.  As partition 0
does not physically exist, attempts to switch back to the whole device
will indicate an error, but the capacity setting for the whole device
must still be restored to match the partition.



diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c



@@ -594,10 +594,15 @@ int mmc_switch_part(int dev_num, unsigned int
part_num)
  ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
   (mmc->part_config & ~PART_ACCESS_MASK)
   | (part_num & PART_ACCESS_MASK));
-if (ret)
-return ret;

-return mmc_set_capacity(mmc, part_num);
+/*
+ * Set the capacity if the switch succeeded or was intended
+ * to return to representing the raw device.
+ */
+if ((ret == 0) || ((ret == -ENODEV) && (part_num == 0)))
+ret = mmc_set_capacity(mmc, part_num);
+
+return ret;
  }


I think this wouldn't be needed without patch 1/2, since without that
patch, no partition switching should ever happen if HW partitions
don't exist, and hence this patch shouldn't be required.


Not so.

In SPL mode, the mmc device passed in to the environment code is set up
for partition 0.  In the failure case, u-boot is configured to expect an


What failure case?


environment in partition 2, and so invokes mmc_switch_part to go to
partition 2 to see if it's a valid partition.  In my case that fails
because the partition size is zero, but regardless the mmc_switch_part
back to mmc->part_num fails because the mmc_switch() call rejects the
attempt with an error.


Isn't that where the bug should be fixed then; why doesn't 
mmc_switch() work as desired? If mmc_switch() isn't intended to work 
on devices without HW partitions, then why is it being called at all 
in any case (normal or failure case)?


I have no idea.

I also wonder why, if your board configuration is set up to assume an 
eMMC device with HW partitions, you're using a device without eMMC HW 
partitions; it seems like either the board configuration or your HW 
configuration is incorrect (or at least don't match), so if you have 
problems, it's not surprising, and not something that should be fixed.


This is a beaglebone (black).  It has an eMMC, and an SD card.  It can 
boot from either, and will fall back to the SD card if the eMMC is 
uninitialized or under other magic conditions.


If you believe the beaglebone u-boot configuration is wrong for how the 
beaglebone is intended to be used, I'll refer you to the TI folks to 
sort it out.





Without this second patch, you end up with mmc->part_num left at zero
but the capacity/lba fields configured for partition 2 which does not
exist and has size zero, and SPL is unable to locate u-boot.img to
continue.

Please review the details in the meta-ti discussion.


I have no idea what that is.


The link in the cover letter I provided with the patches, in hopes it 
would answer questions about why I was doing this.  It all starts here:


http://www.mail-archive.com/meta-ti@yoctoproject.org/msg04276.html

Tom Rini: OK, so I've provided the patch upstream as you requested. I'm 
not going to continue to fight to get it incorporated.  I believe you 
understand that there's a problem, and it's on hardware you're probably 
paid to support, unlike me.  Y'all can figure out whether and how you 
want to resolve it.


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


Re: [U-Boot] [PATCH] kconfig: fix a bug of savedefconfig

2014-09-03 Thread Simon Glass
On 2 September 2014 21:51, Masahiro Yamada  wrote:
> Commit 3ff291f371fa9858426774f3732924bacb61ed1c
> (kconfig: convert Kconfig helper script into a shell script)
> introduced a minor bug.
>
> make alldefconfig && make savedefconfig
> should create an empty 'defconfig'.
>
> Signed-off-by: Masahiro Yamada 

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


Re: [U-Boot] Call for participation in the U-Boot Mini Summit 2014

2014-09-03 Thread Detlev Zundel
Hi,

[...]

> I will be in U-Boot mini summit 2014.

Excellent!

> I am thinking about giving a talk on Kbuild and Kconfig.
>
> Kbuild - I think it is already stable enough, but I'd like to
> have a quick review of the big change we had in U-Boot
> in the past year.
>
> Kconfig - We have just switched to Kconfig.  I will explain
> how Kconfig was adjusted for U-Boot and why the current approach
> was chosen and then what will happen in the next phase.
>
>
> BTW, I am not good at talking. Nor am I good at English.
> (I hope my presentation won't be a disaster...)
> But I'd like to challenge a new thing.
> Could you bear with me during a 20min slot?

Actually I had a slot reserved for you already ;)

Best wishes
  Detlev
  
-- 
... does Linux have a better [security] track record than MS? Damn right it
does. We've had fewer problems, and I think there are more people out there
standing up for what's right anyway. Less PR people deathly afraid of rocking
the boat. Better technology, and fewer horrid design mistakes. [Linus Torvalds]
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] env_mmc: correct fini partition to match init partition

2014-09-03 Thread Peter A. Bigot
The code to set the MMC partition uses an weak function to obtain the
correct partition number.  Use that instead of the compile-time default
when deciding whether it needs to switch back.

Signed-off-by: Peter A. Bigot 
---

V2:
* Preserve desired behavior of avoiding diagnostic when no HW partition 
supported
* Supersedes https://patchwork.ozlabs.org/patch/385355/

 common/env_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/env_mmc.c b/common/env_mmc.c
index a7621a8..14648e3 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -113,7 +113,7 @@ static void fini_mmc_for_env(struct mmc *mmc)
 #ifdef CONFIG_SPL_BUILD
dev = 0;
 #endif
-   if (CONFIG_SYS_MMC_ENV_PART != mmc->part_num)
+   if (mmc_get_env_part(mmc) != mmc->part_num)
mmc_switch_part(dev, mmc->part_num);
 #endif
 }
-- 
1.8.5.5

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


Re: [U-Boot] uboot env in mmc partition

2014-09-03 Thread Sachin Verma
Hi Naitik,
On Wed, Sep 3, 2014 at 8:08 PM, Naitik Amin  wrote:

> Below is the layout of my partitions.
>
> [root@IM /root]# cat /proc/partitions
> major minor  #blocks  name
>
>  17903887104 mmcblk0
>  1791  20480 mmcblk0p1
>  1792 512000 mmcblk0p2
>  1793   1024 mmcblk0p3
>  1794 64 mmcblk0p4
>
> Further explanation
> Partition 1: Partition type: 0xB Fat32 (Holds zImage, dtb, rbf, uboot
> startup script)
> Partition 2: Partititon type: 0x83 ext3 (Holds rootfs)
> Partition 3: Partition type: A2 (raw) MBR looks for preloader at the
> beginning of the A2 partition. (Holds Preloader, followed by uboot)
> Partition 4: Partition type: A3 (raw) To hold the uboot-env (Newly
> created)
>
>
According to your partition layout, your environment offset must be :
(3887104 + 20480 + 512000 + 1024) = 4420608 blocks into the user partition
of eMMC.

So, the offset should be 4420608 * 512 = 2263351296 = 0x86E8


The offset (0x2190) you are using seems to be in your very first
partition i.e. mmcblk0 and hence it is corrupting your dtb and other files.

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


[U-Boot] Force check of RSA-Signature

2014-09-03 Thread Ulf Bartel
Hello.

We are currently testing U-Boot on a PPC. Beside booting the system we like to 
use it do some system updates (e.g. Kernel, FDT and Initrd). I've compiled 
U-Boot with support for AES and RSA-Signatures. We are storing the RSA public 
keys using a Fit-Image for U-Boot configuration on Flash. Basically both AES 
and RSA support works as expected,

but:

1) is there a possibility to always be sure that accessing an image from a 
Fit-container checks the signature?
If the signature is wrong, we get an error as expected. But if we generate an 
image without any signature (which may be generated by anybody) the access is 
of course possible. Currently I used something like

fdt get value algorithm /images/script@1/signature@1/ algo &&
test "$algorithm" = "sha1,rsa2048" && echo success   

to check if the image has a signature before proceeding. But this feels wrong.

2) Is there a possibility to check the signature/CRC before copying the image 
to ram with imxtract?

P.s. great project. I'm really impressed by its features!

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


[U-Boot] [PATCH] AM335x: igep0033: Convert to generic board and use ti_am335x_common.h.

2014-09-03 Thread Enric Balletbo i Serra
From: Enric Balletbo i Serra 

To reduce code duplication update am335x_igep0033.h to use ti_am335x_common.h
and convert to generic board.

Signed-off-by: Enric Balletbo i Serra 
---
 include/configs/am335x_igep0033.h | 221 --
 1 file changed, 43 insertions(+), 178 deletions(-)

diff --git a/include/configs/am335x_igep0033.h 
b/include/configs/am335x_igep0033.h
index dcded0a..a14310a 100644
--- a/include/configs/am335x_igep0033.h
+++ b/include/configs/am335x_igep0033.h
@@ -14,11 +14,8 @@
 #ifndef __CONFIG_IGEP0033_H
 #define __CONFIG_IGEP0033_H
 
-#define CONFIG_AM33XX
-#define CONFIG_OMAP
-#define CONFIG_OMAP_COMMON
-
-#include 
+#define CONFIG_NAND
+#include 
 
 /* Mach type */
 #define MACH_TYPE_IGEP0033 4521/* Until the next sync */
@@ -29,166 +26,81 @@
 #define V_SCLK (V_OSCK)
 
 #define CONFIG_ENV_SIZE(128 << 10) /* 128 KiB */
-#define CONFIG_SYS_MALLOC_LEN  (1024 << 10)
-#define CONFIG_SYS_LONGHELP/* undef to save memory */
-#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
-#define CONFIG_SYS_PROMPT  "U-Boot# "
-#define CONFIG_SYS_NO_FLASH
-
-/* Display cpuinfo */
-#define CONFIG_DISPLAY_CPUINFO
-
-/* Flattened Device Tree */
-#define CONFIG_OF_LIBFDT
-
-/* Commands to include */
-#include 
-
-#define CONFIG_CMD_ASKENV
-#define CONFIG_CMD_BOOTZ
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ECHO
-#define CONFIG_CMD_EXT4
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_FS_GENERIC
-#define CONFIG_CMD_MMC
-#define CONFIG_CMD_MTDPARTS
-#define CONFIG_CMD_NAND
-#define CONFIG_CMD_NET
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_UBI
-#define CONFIG_CMD_UBIFS
 
 /* Make the verbose messages from UBI stop printing */
 #define CONFIG_UBI_SILENCE_MSG
 #define CONFIG_UBIFS_SILENCE_MSG
 
-#define CONFIG_BOOTDELAY   1   /* negative for no autoboot */
-#define CONFIG_ENV_VARS_UBOOT_CONFIG
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
+#ifndef CONFIG_SPL_BUILD
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   "loadaddr=0x80F8\0" \
-   "dtbaddr=0x8020\0" \
+   DEFAULT_LINUX_BOOT_ENV \
"bootdir=/boot\0" \
"bootfile=zImage\0" \
"dtbfile=am335x-base0033.dtb\0" \
"console=ttyO0,115200n8\0" \
-   "mtdids=" MTDIDS_DEFAULT "\0" \
-   "mtdparts=" MTDPARTS_DEFAULT "\0" \
"mmcdev=0\0" \
"mmcroot=/dev/mmcblk0p2 rw\0" \
-   "ubiroot=ubi0:filesystem rw ubi.mtd=3,2048\0" \
"mmcrootfstype=ext4 rootwait\0" \
-   "ubirootfstype=ubifs rootwait\0" \
"mmcargs=setenv bootargs console=${console} " \
+   "${optargs} " \
"root=${mmcroot} " \
"rootfstype=${mmcrootfstype}\0" \
-   "ubiargs=setenv bootargs console=${console} " \
-   "root=${ubiroot} " \
-   "rootfstype=${ubirootfstype}\0" \
-   "bootenv=uEnv.txt\0" \
+   "bootenv=uEnv.txt\0" \
"loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
"importbootenv=echo Importing environment from mmc ...; " \
"env import -t ${loadaddr} ${filesize}\0" \
"mmcload=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}; " \
-   "load mmc ${mmcdev}:2 ${dtbaddr} ${bootdir}/${dtbfile}\0" \
-   "ubiload=ubi part filesystem 2048; ubifsmount ubi0; " \
+   "load mmc ${mmcdev}:2 ${fdtaddr} ${bootdir}/${dtbfile}\0" \
+   "mmcboot=mmc dev ${mmcdev}; " \
+   "if mmc rescan; then " \
+   "echo SD/MMC found on device ${mmcdev};" \
+   "if run loadbootenv; then " \
+   "echo Loaded environment from ${bootenv};" \
+   "run importbootenv;" \
+   "fi;" \
+   "if test -n $uenvcmd; then " \
+   "echo Running uenvcmd ...;" \
+   "run uenvcmd;" \
+   "fi;" \
+   "if run mmcload; then " \
+   "run mmcargs; " \
+   "bootz ${loadaddr} - ${fdtaddr};" \
+   "fi;" \
+   "fi;\0" \
+   "mtdids=" MTDIDS_DEFAULT "\0" \
+   "mtdparts=" MTDPARTS_DEFAULT "\0" \
+   "nandroot=ubi0:filesystem rw ubi.mtd=3,2048\0" \
+   "nandrootfstype=ubifs rootwait\0" \
+   "nandload=ubi part filesystem 2048; ubifsmount ubi0; " \
"ubifsload ${loadaddr} ${bootdir}/${bootfile}; " \
-   "ubifsload ${dtbaddr} ${bootdir}/${dtbfile} \0" \
-   "mmcboot=echo Booting from mmc ...; " \
-   "run mmcargs; " \
-   "bootz ${loadaddr} - ${dtbaddr}\0" \
-   "ubiboot=echo Booting from nand (ubifs) ...; " \
-   "run ubiargs; run ubiload; " \
-   "bootz ${loadaddr} - ${dtbaddr}\0" \
+   "ubifsload ${fdtaddr} ${

Re: [U-Boot] [PATCH 2/2] iMX6SLEVK: Change to use generic board

2014-09-03 Thread Nitin Garg
On 09/03/2014 04:43 AM, Ye.Li wrote:
> Enable CONFIG_SYS_GENERIC_BOARD for imx6slevk to use generic board.
> 
> Signed-off-by: Ye.Li 
> ---
>  include/configs/mx6slevk.h |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
> index 3d05a64..194d7bd 100644
> --- a/include/configs/mx6slevk.h
> +++ b/include/configs/mx6slevk.h
> @@ -26,6 +26,8 @@
>  #define CONFIG_INITRD_TAG
>  #define CONFIG_REVISION_TAG
>  
> +#define CONFIG_SYS_GENERIC_BOARD
> +
>  /* Size of malloc() pool */
>  #define CONFIG_SYS_MALLOC_LEN(3 * SZ_1M)
>  
> 

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


Re: [U-Boot] [PATCH 1/2] iMX6Q/DL:ARM2: Change to use generic board

2014-09-03 Thread Nitin Garg
On 09/03/2014 04:43 AM, Ye.Li wrote:
> Enable the CONFIG_SYS_GENERIC_BOARD for imx6q/dl arm2 board to
> use generic board.
> 
> Signed-off-by: Ye.Li 
> ---
>  include/configs/mx6qarm2.h |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/include/configs/mx6qarm2.h b/include/configs/mx6qarm2.h
> index f314b31..3566b15 100644
> --- a/include/configs/mx6qarm2.h
> +++ b/include/configs/mx6qarm2.h
> @@ -22,6 +22,8 @@
>  #define CONFIG_SETUP_MEMORY_TAGS
>  #define CONFIG_INITRD_TAG
>  
> +#define CONFIG_SYS_GENERIC_BOARD
> +
>  /* Size of malloc() pool */
>  #define CONFIG_SYS_MALLOC_LEN(CONFIG_ENV_SIZE + 2 * 1024 * 
> 1024)
>  
> 

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


Re: [U-Boot] [PATCH 2/2] mmc: restore capacity when switching to partition 0

2014-09-03 Thread Stephen Warren

On 09/03/2014 09:59 AM, Peter A. Bigot wrote:

On 09/03/2014 10:48 AM, Stephen Warren wrote:

On 09/02/2014 05:31 PM, Peter A. Bigot wrote:

The capacity and lba for an MMC device with part_num 0 reflects the
whole device.  When mmc_switch_part() successfully switches to a
partition, the capacity is changed to that partition.  As partition 0
does not physically exist, attempts to switch back to the whole device
will indicate an error, but the capacity setting for the whole device
must still be restored to match the partition.



diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c



@@ -594,10 +594,15 @@ int mmc_switch_part(int dev_num, unsigned int
part_num)
  ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
   (mmc->part_config & ~PART_ACCESS_MASK)
   | (part_num & PART_ACCESS_MASK));
-if (ret)
-return ret;

-return mmc_set_capacity(mmc, part_num);
+/*
+ * Set the capacity if the switch succeeded or was intended
+ * to return to representing the raw device.
+ */
+if ((ret == 0) || ((ret == -ENODEV) && (part_num == 0)))
+ret = mmc_set_capacity(mmc, part_num);
+
+return ret;
  }


I think this wouldn't be needed without patch 1/2, since without that
patch, no partition switching should ever happen if HW partitions
don't exist, and hence this patch shouldn't be required.


Not so.

In SPL mode, the mmc device passed in to the environment code is set up
for partition 0.  In the failure case, u-boot is configured to expect an


What failure case?


environment in partition 2, and so invokes mmc_switch_part to go to
partition 2 to see if it's a valid partition.  In my case that fails
because the partition size is zero, but regardless the mmc_switch_part
back to mmc->part_num fails because the mmc_switch() call rejects the
attempt with an error.


Isn't that where the bug should be fixed then; why doesn't mmc_switch() 
work as desired? If mmc_switch() isn't intended to work on devices 
without HW partitions, then why is it being called at all in any case 
(normal or failure case)?


I also wonder why, if your board configuration is set up to assume an 
eMMC device with HW partitions, you're using a device without eMMC HW 
partitions; it seems like either the board configuration or your HW 
configuration is incorrect (or at least don't match), so if you have 
problems, it's not surprising, and not something that should be fixed.



Without this second patch, you end up with mmc->part_num left at zero
but the capacity/lba fields configured for partition 2 which does not
exist and has size zero, and SPL is unable to locate u-boot.img to
continue.

Please review the details in the meta-ti discussion.


I have no idea what that is.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Suspected Spam] Re: uboot env in mmc partition

2014-09-03 Thread Naitik Amin
HI Stephen,

Yes, I do understand that its not a good idea at all to use hardcoded 
addresses like that, if you pls list some steps on how can I use the sw 
level partition. That be great.



From:   Stephen Warren 
To: Naitik Amin , u-boot@lists.denx.de, 
u-boot-requ...@lists.denx.de, 
Date:   09/03/2014 11:53 AM
Subject:[Suspected Spam]  Re: [U-Boot] uboot env in mmc partition



On 08/29/2014 11:21 AM, Naitik Amin wrote:
> HI there,
>
> I recently made changes to my system, where I created a new partition on
> my mmc. (mmcblk0p4)
>
> Then i dd'd a uboot env image into this partition, updated the
> fw_env.config to point to /dev/mmcblk0p4. At this point, my fw_printenv
> and fw_setenv work good. So as a next step, I am tried to modify uboot 
to
> make it point to my env image in my new partition.
>
> I made below changes to my config header and rebuilt the uboot. On doing
> printenv from uboot, I dont see the same env that I pushed it from 
linux,
> infact I see it as its defined in the config header.
>
> Can some one help ?
>
> /* environment setting for MMC */
> #ifdef CONFIG_ENV_IS_IN_MMC
> #define CONFIG_SYS_MMC_ENV_DEV  0   /* device 0 */
> #define CONFIG_SYS_MMC_ENV_PART 4
> #define CONFIG_ENV_OFFSET   0   /* just after the MBR */
> #endif

I think you're confusing eMMC HW-level partitions (0=user data or 
mmcblk0, 1=mmcblk0boot0, 2=mmcblk0boot1) and SW-level (MBR/GPT) 
partitions within the user data area; /dev/mmcblk0p4.

CONFIG_SYS_MMC_ENV_PART applies to eMMC HW-level partitions.

I don't know if there's an environment variable that selects which 
SW-level partition to use. This is the feature you're looking for!

Later in the thread I saw:
#define CONFIG_ENV_OFFSET0x2190

That's not a good idea, since if someone repartitions the disk, that 
offset will be incorrect. Better would be to use (or add) SW-level 
partition support in the MMC environment code.



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


Re: [U-Boot] [PATCH 1/2] env_mmc: remove condition on call to mmc_switch_part

2014-09-03 Thread Peter A. Bigot

On 09/03/2014 10:46 AM, Stephen Warren wrote:

On 09/02/2014 05:31 PM, Peter A. Bigot wrote:

Though it might be expected to do so, mmc_switch_part() does not change
the part_num field of the device on which the partition has been
changed.  As such, checking to see whether the partition is already the
target partition will fail to correctly restore the original
configuration in cases like env_mmc which rely on this behavior to
avoid having to preserve the pre-switch partition number outside the
device structure.



diff --git a/common/env_mmc.c b/common/env_mmc.c



-if (part != mmc->part_num) {
-ret = mmc_switch_part(dev, part);
-if (ret)
-puts("MMC partition switch failed\n");
-}
+ret = mmc_switch_part(dev, part);
+if (ret)
+puts("MMC partition switch failed\n");


I'm not sure this is correct, but it might be.

I believe the if() is present to avoid any attempt to call 
mmc_switch_part() on a device that doesn't have HW partitions (in 
which case, both part and mmc->part_num should already be 0), since 
such an attempt might print an error message.


That could be true.  The patch that added the feature didn't provide 
that information.  In my case, the device does have HW partitions.


If you don't observe any error message printed after this change, then 
perhaps this patch is fine.


It does work in my environment, but would not retain the behavior you 
describe.  The existing code is still wrong, but the error is elsewhere: 
I'll provide a new patch to supersede this one.


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


Re: [U-Boot] uboot env in mmc partition

2014-09-03 Thread Naitik Amin
Hi Sachin,

My paritions are not laid out in the same order of 1-4 in memory. The 
address that computed came from below

[root@IM mmcblk0p4]# ls
alignment_offset   holdersro stat
devinflight   size   subsystem
discard_alignment  partition  start  uevent
[root@IM mmcblk0p4]# cat start
1099776

1099776 * 512 = 0x2190




From:   Sachin Verma 
To: Naitik Amin , 
Cc: "Peter A. Bigot" , u-boot@lists.denx.de, Hannes 
Petermaier 
Date:   09/03/2014 11:54 AM
Subject:Re: [U-Boot] uboot env in mmc partition




Hi Naitik,
On Wed, Sep 3, 2014 at 8:08 PM, Naitik Amin  
wrote:
Below is the layout of my partitions.

[root@IM /root]# cat /proc/partitions
major minor  #blocks  name

 17903887104 mmcblk0
 1791  20480 mmcblk0p1
 1792 512000 mmcblk0p2
 1793   1024 mmcblk0p3
 1794 64 mmcblk0p4

Further explanation
Partition 1: Partition type: 0xB Fat32 (Holds zImage, dtb, rbf, uboot
startup script)
Partition 2: Partititon type: 0x83 ext3 (Holds rootfs)
Partition 3: Partition type: A2 (raw) MBR looks for preloader at the
beginning of the A2 partition. (Holds Preloader, followed by uboot)
Partition 4: Partition type: A3 (raw) To hold the uboot-env (Newly
created)

 
According to your partition layout, your environment offset must be :  
(3887104 + 20480 + 512000 + 1024) = 4420608 blocks into the user partition 
of eMMC.
 
So, the offset should be 4420608 * 512 = 2263351296 = 0x86E8
 
 
The offset (0x2190) you are using seems to be in your very first 
partition i.e. mmcblk0 and hence it is corrupting your dtb and other 
files.
 
Best Regards,
Sachin Verma.
 

 


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


Re: [U-Boot] [PATCH 2/2] mmc: restore capacity when switching to partition 0

2014-09-03 Thread Peter A. Bigot

On 09/03/2014 10:48 AM, Stephen Warren wrote:

On 09/02/2014 05:31 PM, Peter A. Bigot wrote:

The capacity and lba for an MMC device with part_num 0 reflects the
whole device.  When mmc_switch_part() successfully switches to a
partition, the capacity is changed to that partition.  As partition 0
does not physically exist, attempts to switch back to the whole device
will indicate an error, but the capacity setting for the whole device
must still be restored to match the partition.



diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c


@@ -594,10 +594,15 @@ int mmc_switch_part(int dev_num, unsigned int 
part_num)

  ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
   (mmc->part_config & ~PART_ACCESS_MASK)
   | (part_num & PART_ACCESS_MASK));
-if (ret)
-return ret;

-return mmc_set_capacity(mmc, part_num);
+/*
+ * Set the capacity if the switch succeeded or was intended
+ * to return to representing the raw device.
+ */
+if ((ret == 0) || ((ret == -ENODEV) && (part_num == 0)))
+ret = mmc_set_capacity(mmc, part_num);
+
+return ret;
  }


I think this wouldn't be needed without patch 1/2, since without that 
patch, no partition switching should ever happen if HW partitions 
don't exist, and hence this patch shouldn't be required.


Not so.

In SPL mode, the mmc device passed in to the environment code is set up 
for partition 0.  In the failure case, u-boot is configured to expect an 
environment in partition 2, and so invokes mmc_switch_part to go to 
partition 2 to see if it's a valid partition.  In my case that fails 
because the partition size is zero, but regardless the mmc_switch_part 
back to mmc->part_num fails because the mmc_switch() call rejects the 
attempt with an error.


Without this second patch, you end up with mmc->part_num left at zero 
but the capacity/lba fields configured for partition 2 which does not 
exist and has size zero, and SPL is unable to locate u-boot.img to continue.


Please review the details in the meta-ti discussion.

I'll respond to the comments on patch 1 separately.

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


Re: [U-Boot] uboot env in mmc partition

2014-09-03 Thread Stephen Warren

On 08/29/2014 11:21 AM, Naitik Amin wrote:

HI there,

I recently made changes to my system, where I created a new partition on
my mmc. (mmcblk0p4)

Then i dd'd a uboot env image into this partition, updated the
fw_env.config to point to /dev/mmcblk0p4. At this point, my fw_printenv
and fw_setenv work good. So as a next step, I am tried to modify uboot to
make it point to my env image in my new partition.

I made below changes to my config header and rebuilt the uboot. On doing
printenv from uboot, I dont see the same env that I pushed it from linux,
infact I see it as its defined in the config header.

Can some one help ?

/* environment setting for MMC */
#ifdef CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV  0   /* device 0 */
#define CONFIG_SYS_MMC_ENV_PART 4
#define CONFIG_ENV_OFFSET   0   /* just after the MBR */
#endif


I think you're confusing eMMC HW-level partitions (0=user data or 
mmcblk0, 1=mmcblk0boot0, 2=mmcblk0boot1) and SW-level (MBR/GPT) 
partitions within the user data area; /dev/mmcblk0p4.


CONFIG_SYS_MMC_ENV_PART applies to eMMC HW-level partitions.

I don't know if there's an environment variable that selects which 
SW-level partition to use. This is the feature you're looking for!


Later in the thread I saw:
#define CONFIG_ENV_OFFSET0x2190

That's not a good idea, since if someone repartitions the disk, that 
offset will be incorrect. Better would be to use (or add) SW-level 
partition support in the MMC environment code.

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


Re: [U-Boot] [PATCH 2/2] mmc: restore capacity when switching to partition 0

2014-09-03 Thread Stephen Warren

On 09/02/2014 05:31 PM, Peter A. Bigot wrote:

The capacity and lba for an MMC device with part_num 0 reflects the
whole device.  When mmc_switch_part() successfully switches to a
partition, the capacity is changed to that partition.  As partition 0
does not physically exist, attempts to switch back to the whole device
will indicate an error, but the capacity setting for the whole device
must still be restored to match the partition.



diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c



@@ -594,10 +594,15 @@ int mmc_switch_part(int dev_num, unsigned int part_num)
ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
 (mmc->part_config & ~PART_ACCESS_MASK)
 | (part_num & PART_ACCESS_MASK));
-   if (ret)
-   return ret;

-   return mmc_set_capacity(mmc, part_num);
+   /*
+* Set the capacity if the switch succeeded or was intended
+* to return to representing the raw device.
+*/
+   if ((ret == 0) || ((ret == -ENODEV) && (part_num == 0)))
+   ret = mmc_set_capacity(mmc, part_num);
+
+   return ret;
  }


I think this wouldn't be needed without patch 1/2, since without that 
patch, no partition switching should ever happen if HW partitions don't 
exist, and hence this patch shouldn't be required.

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


Re: [U-Boot] [PATCH 1/2] env_mmc: remove condition on call to mmc_switch_part

2014-09-03 Thread Stephen Warren

On 09/02/2014 05:31 PM, Peter A. Bigot wrote:

Though it might be expected to do so, mmc_switch_part() does not change
the part_num field of the device on which the partition has been
changed.  As such, checking to see whether the partition is already the
target partition will fail to correctly restore the original
configuration in cases like env_mmc which rely on this behavior to
avoid having to preserve the pre-switch partition number outside the
device structure.



diff --git a/common/env_mmc.c b/common/env_mmc.c



-   if (part != mmc->part_num) {
-   ret = mmc_switch_part(dev, part);
-   if (ret)
-   puts("MMC partition switch failed\n");
-   }
+   ret = mmc_switch_part(dev, part);
+   if (ret)
+   puts("MMC partition switch failed\n");


I'm not sure this is correct, but it might be.

I believe the if() is present to avoid any attempt to call 
mmc_switch_part() on a device that doesn't have HW partitions (in which 
case, both part and mmc->part_num should already be 0), since such an 
attempt might print an error message. If you don't observe any error 
message printed after this change, then perhaps this patch is fine.

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


[U-Boot] [PATCH] cmd_mem: add static to internally used functions

2014-09-03 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---

 common/cmd_mem.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 1febddb..bfca59e 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -215,7 +215,7 @@ static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 }
 
 #ifdef CONFIG_MX_CYCLIC
-int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mem_mdc(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
argv[])
 {
int i;
ulong count;
@@ -242,7 +242,7 @@ int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
return 0;
 }
 
-int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mem_mwc(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
argv[])
 {
int i;
ulong count;
@@ -595,7 +595,8 @@ static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc,
 }
 
 #ifdef CONFIG_LOOPW
-int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mem_loopw(cmd_tbl_t *cmdtp, int flag, int argc,
+   char * const argv[])
 {
ulong   addr, length, i, bytes;
int size;
-- 
1.9.1

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


Re: [U-Boot] [PATCH 6/8] ARMv8: PSCI: Fixup the device tree for PSCI v0.2

2014-09-03 Thread Mark Rutland
On Tue, Sep 02, 2014 at 04:21:24PM +0100, Stuart Yoder wrote:
> > > The idea here is that if there is no PSCI specific (most likely secure)
> > > memory allocated in the system, the macro "CONFIG_ARMV8_SECURE_BASE"
> > > will not be defined. In this case the PSCI vector table and its support
> > > code will be in DDR and will be protected from Linux using memreserve.
> > 
> > Sure, this will prevent the OS from explicitly modifying this memory.
> > 
> > However, the OS will still map the memory. This renders the protection
> > incomplete due to the possibility of mismatched attributes and/or
> > unexpected cache hits resulting in nasty coherency problems. We are
> > likely to get away with this most of the time (if the kernel and U-Boot
> > use the same attributes), but it would be very easy to blow things up
> > accidentally.
> > 
> > The only way to prevent that is to completely remove a portion of the
> > memory from the view of the OS, such that it doesn't map the memory at
> > all.
> 
> Can't this be done by simply removing that secure portion of memory
> from the memory advertised in the memory node of the device tree passed
> to the non-secure OS?  ...should prevent the OS from mapping the memory.

Yes, removing such memory entirely from the memory nodes would work.

The only caveat (I believe) is that it would be necessary to remove such
memory in 2MB naturally-aligned chunks due to the way Linux maps memory.

I intend to at some point decouple the Linux linear mapping from the
text mapping, so that Linux can address meemory below it. So it's vital
to remove the memory enitrely from the view of the kernel rather than
just loading the kernel 2MB higher.

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


  1   2   >