Re: [U-Boot] [PATCH] Move Cache-As-RAM memory from area mapped to ROM in QEMU

2017-11-10 Thread Tom Rini
On Fri, Nov 10, 2017 at 06:51:02PM +0100, Anton Gerasimov wrote:

> ROM has been made read-only in qemu recently (namely commit
> 208fa0e43645edd0b0d8f838857dfc79daff40a8), so this patch restores
> compatibility between u-boot and qemu. It is still broken for me
> unless I set CONFIG_SMP=n and disable lapic (i.e. revert patch
> 55751ab1e5a5cfa0962d604593a7e6f33ff6 in u-boot), but these are
> separate issues
> 
> Signed-off-by: Anton Gerasimov 
> ---
>  arch/x86/cpu/qemu/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/cpu/qemu/Kconfig b/arch/x86/cpu/qemu/Kconfig
> index 6808c9a6b9..f4b9922a34 100644
> --- a/arch/x86/cpu/qemu/Kconfig
> +++ b/arch/x86/cpu/qemu/Kconfig
> @@ -11,7 +11,7 @@ if QEMU
>  
>  config SYS_CAR_ADDR
>   hex
> - default 0xd
> + default 0x1
>  
>  config SYS_CAR_SIZE
>   hex

Bin, are you happy with this?  Do you want this in before release?
Thanks!

-- 
Tom


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


[U-Boot] [PATCH] net: ravb: Fix reset GPIO handling

2017-11-10 Thread Marek Vasut
Fix handling of the reset GPIO. Drop the _nodev() suffix from the
gpio_request_by_name() call as there is now a proper DM capable
GPIO driver. Also check if the GPIO is valid before freeing it in
remove path, otherwise U-Boot will crash.

Signed-off-by: Marek Vasut 
Cc: Joe Hershberger 
Cc: Nobuhiro Iwamatsu 
---
 drivers/net/ravb.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
index dc7a52534e..26d95f178f 100644
--- a/drivers/net/ravb.c
+++ b/drivers/net/ravb.c
@@ -492,8 +492,8 @@ static int ravb_probe(struct udevice *dev)
if (ret < 0)
goto err_mdio_alloc;
 
-   gpio_request_by_name_nodev(dev_ofnode(dev), "reset-gpios", 0,
-  >reset_gpio, GPIOD_IS_OUT);
+   gpio_request_by_name(dev, "reset-gpios", 0, >reset_gpio,
+GPIOD_IS_OUT);
 
mdiodev = mdio_alloc();
if (!mdiodev) {
@@ -528,7 +528,8 @@ static int ravb_remove(struct udevice *dev)
free(eth->phydev);
mdio_unregister(eth->bus);
mdio_free(eth->bus);
-   dm_gpio_free(dev, >reset_gpio);
+   if (dm_gpio_is_valid(>reset_gpio))
+   dm_gpio_free(dev, >reset_gpio);
unmap_physmem(eth->iobase, MAP_NOCACHE);
 
return 0;
-- 
2.11.0

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


[U-Boot] [PATCH] clk: rmobile: Add R8A7796 xHCI clock

2017-11-10 Thread Marek Vasut
Add xHCI entry into the clock tables, so that the xHCI USB driver
can enable the clock for the xHCI block via clock framework.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
---
 drivers/clk/renesas/clk-rcar-gen3.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/renesas/clk-rcar-gen3.c 
b/drivers/clk/renesas/clk-rcar-gen3.c
index c821bddc25..8dc4a657ee 100644
--- a/drivers/clk/renesas/clk-rcar-gen3.c
+++ b/drivers/clk/renesas/clk-rcar-gen3.c
@@ -490,6 +490,7 @@ static const struct mssr_mod_clk r8a7796_mod_clks[] = {
DEF_MOD("sdif0", 314,   R8A7796_CLK_SD0),
DEF_MOD("pcie1", 318,   R8A7796_CLK_S3D1),
DEF_MOD("pcie0", 319,   R8A7796_CLK_S3D1),
+   DEF_MOD("usb3-if0",  328,   R8A7796_CLK_S3D1),
DEF_MOD("usb-dmac0", 330,   R8A7796_CLK_S3D1),
DEF_MOD("usb-dmac1", 331,   R8A7796_CLK_S3D1),
DEF_MOD("rwdt",  402,   R8A7796_CLK_R),
-- 
2.11.0

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


Re: [U-Boot] [PATCH] test/py: Add dependency on HUSH parser

2017-11-10 Thread Stephen Warren

On 11/10/2017 04:01 AM, Michal Simek wrote:

After adding our small zynq uboot which has hush parser off these 3 tests
start to failed. It is probably just coincidence that others are
passing without hush parser.


What was the exact problem here? The set of tests you've disabled all 
seem to rely on setenv/printenv and don't seem to do anything 
complicated shell syntax wise. Are you sure they shouldn't depend on 
setenv being available rather than hush_parser?

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


Re: [U-Boot] [PATCH v3 1/3] mx25: Move MX25 selection to Kconfig

2017-11-10 Thread Fabio Estevam
Hi Benoît,

On Fri, Nov 10, 2017 at 6:19 PM, Benoît Thébaudeau
 wrote:

> I have seen other PRs going through, but nothing for this series.
> Please do not forget.

It has already been applied in master now :-)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 1/1] malloc: don't compare pointers to 0

2017-11-10 Thread Heinrich Schuchardt
0 is not a pointer. So do not compare pointers to 0.

Do not return 0 from functions with a pointer return
type.

Problem identified with Coccinelle.

Signed-off-by: Heinrich Schuchardt 
---
v2
Fix more occurences of the problem.
v1
[PATCH 1/1] malloc: compare pointer to NULL not to 0. 
https://patchwork.ozlabs.org/patch/836850/
---
 common/dlmalloc.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index c37979b43f..7bd722d679 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -149,7 +149,7 @@ gAllocatedSize))
{
new_address = findRegion (new_address, 
new_size);
 
-   if (new_address == 0)
+   if (!new_address)
return (void*)-1;
 
gAddressBase = gNextAddress =
@@ -175,7 +175,7 @@ gAllocatedSize))
(size + 
gNextAddress -
 AlignPage 
(gNextAddress)),
MEM_COMMIT, 
PAGE_READWRITE);
-   if (res == 0)
+   if (!res)
return (void*)-1;
}
tmp = (void*)gNextAddress;
@@ -1461,7 +1461,7 @@ Void_t* mALLOc(bytes) size_t bytes;
 #if HAVE_MMAP
 /* If big and would otherwise need to extend, try to use mmap instead */
 if ((unsigned long)nb >= (unsigned long)mmap_threshold &&
-   (victim = mmap_chunk(nb)) != 0)
+   (victim = mmap_chunk(nb)))
   return chunk2mem(victim);
 #endif
 
@@ -1671,7 +1671,10 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t 
bytes;
   mchunkptr fwd;  /* misc temp for linking */
 
 #ifdef REALLOC_ZERO_BYTES_FREES
-  if (bytes == 0) { fREe(oldmem); return 0; }
+  if (!bytes) {
+   fREe(oldmem);
+   return NULL;
+  }
 #endif
 
   if ((long)bytes < 0) return NULL;
@@ -1703,7 +1706,8 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t 
bytes;
 if(oldsize - SIZE_SZ >= nb) return oldmem; /* do nothing */
 /* Must alloc, copy, free. */
 newmem = mALLOc(bytes);
-if (newmem == 0) return 0; /* propagate failure */
+if (!newmem)
+   return NULL; /* propagate failure */
 MALLOC_COPY(newmem, oldmem, oldsize - 2*SIZE_SZ);
 munmap_chunk(oldp);
 return newmem;
-- 
2.14.2

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


Re: [U-Boot] [PATCH v3 1/3] mx25: Move MX25 selection to Kconfig

2017-11-10 Thread Benoît Thébaudeau
Hi Stefano, Tom,

On Tue, Nov 7, 2017 at 10:10 AM, Stefano Babic  wrote:
> On 07/11/2017 02:22, Tom Rini wrote:
>> On Mon, Nov 06, 2017 at 09:44:40PM -0200, Fabio Estevam wrote:
>>> Hi Stefano and Tom,
>>>
>>> On Fri, Nov 3, 2017 at 1:40 PM, Fabio Estevam  wrote:
 From: Fabio Estevam 

 The motivation for moving MX25 selection to Kconfig is to be
 able to better handle MX25 specific errata, so that an errata option
 can be selected at SoC level instead of board level.

 This selection method also aligns with the way other i.MX SoCs are
 selected in U-Boot.

 Signed-off-by: Fabio Estevam 
 Acked-by: Sebastien Bourdelin 
>>>
>>> Could you please consider this series (bug fix) for 2017.11?
>>
>> Otavio brought this up to me as well today, I would be happy to see this
>> come in as a bugfix.  Thanks!
>>
>
> I merge into u-boot-imx and I'll send my PR - thanks !

I have seen other PRs going through, but nothing for this series.
Please do not forget.

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


Re: [U-Boot] [PATCH] ARM: Samsung: Add Exynos5422-based Odroid HC1 support

2017-11-10 Thread Krzysztof Kozlowski
On Fri, Nov 03, 2017 at 09:30:30AM +0100, Marek Szyprowski wrote:
> Odroid HC1 board is based on Odroid XU4 board, but it has no HDMI,
> no eMMC, no build-in USB3.0 hub, no extension port pins, and no GPIO
> button. USB3.0 ports are used for build-in JMicron USB to SATA bridge
> and Gigabit R8152 ethernet chips. HC1 uses only passive cooling.
> 
> This patch also updates Odroid's ADCmax array and reduces ADC tolerance
> to 1% to ensure that XU4 and HC1 revisions are properly detected.
> 
> I've tested this with XU3, XU3-lite, XU4 and HC1 boards. In case of my test
> boards I got following values from ADC register: 372, 370, 1281 and 1313.
> 
> Signed-off-by: Marek Szyprowski 
> ---
>  board/samsung/common/exynos5-dt-types.c | 27 ---
>  board/samsung/common/exynos5-dt.c   |  4 ++--
>  configs/odroid-xu3_defconfig|  2 +-
>  include/samsung/exynos5-dt-types.h  |  2 ++
>  4 files changed, 25 insertions(+), 10 deletions(-)
>

Tested on Odroid HC1 with tftpboot:
Tested-by: Krzysztof Kozlowski 

Best regards,
Krzysztof

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


[U-Boot] [PATCH 1/1] mmc: sdhci: do not compare pointer to 0

2017-11-10 Thread Heinrich Schuchardt
data is defined as struct mmc_data *data.
So it should not be compared to 0.

Problem identified with Coccinelle.

Signed-off-by: Heinrich Schuchardt 
---
 drivers/mmc/sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 11d1f0c24c..e739117de2 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -201,7 +201,7 @@ static int sdhci_send_command(struct mmc *mmc, struct 
mmc_cmd *cmd,
flags |= SDHCI_CMD_DATA;
 
/* Set Transfer mode regarding to data flag */
-   if (data != 0) {
+   if (data) {
sdhci_writeb(host, 0xe, SDHCI_TIMEOUT_CONTROL);
mode = SDHCI_TRNS_BLK_CNT_EN;
trans_bytes = data->blocks * data->blocksize;
@@ -249,7 +249,7 @@ static int sdhci_send_command(struct mmc *mmc, struct 
mmc_cmd *cmd,
 
sdhci_writel(host, cmd->cmdarg, SDHCI_ARGUMENT);
 #ifdef CONFIG_MMC_SDHCI_SDMA
-   if (data != 0) {
+   if (data) {
trans_bytes = ALIGN(trans_bytes, CONFIG_SYS_CACHELINE_SIZE);
flush_cache(start_addr, trans_bytes);
}
-- 
2.14.2

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


[U-Boot] [PATCH 1/1] x86: don't compare pointers to 0

2017-11-10 Thread Heinrich Schuchardt
x86_vendor_name is defined as

static const char *const x86_vendor_name[]

So its elements should not be compared to 0.

Remove superfluous paranthesis.

Problem identified with Coccinelle.

Signed-off-by: Heinrich Schuchardt 
---
 arch/x86/cpu/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index e13786efa5..a7f00ca49f 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -143,8 +143,8 @@ const char *cpu_vendor_name(int vendor)
 {
const char *name;
name = "";
-   if ((vendor < (ARRAY_SIZE(x86_vendor_name))) &&
-   (x86_vendor_name[vendor] != 0))
+   if (vendor < (ARRAY_SIZE(x86_vendor_name)) &&
+   x86_vendor_name[vendor])
name = x86_vendor_name[vendor];
 
return name;
-- 
2.14.2

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


[U-Boot] [PATCH 1/1] malloc: compare pointer to NULL not to 0.

2017-11-10 Thread Heinrich Schuchardt
victim is defined as:

typedef struct malloc_chunk* mchunkptr;
mchunkptr victim;

So victim should be compared to NULL and not to 0.

Problem identified with Coccinelle.

Signed-off-by: Heinrich Schuchardt 
---
 common/dlmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index c37979b43f..86bbd57a4c 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -1461,7 +1461,7 @@ Void_t* mALLOc(bytes) size_t bytes;
 #if HAVE_MMAP
 /* If big and would otherwise need to extend, try to use mmap instead */
 if ((unsigned long)nb >= (unsigned long)mmap_threshold &&
-   (victim = mmap_chunk(nb)) != 0)
+   (victim = mmap_chunk(nb)) != NULL)
   return chunk2mem(victim);
 #endif
 
-- 
2.14.2

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


Re: [U-Boot] [PATCH] dra7x: fastboot: Increase recovery partition size

2017-11-10 Thread Sam Protsenko
On 9 November 2017 at 01:12, Praneeth Bajjuri  wrote:
> As per current android recommendation
> https://source.android.com/devices/architecture/kernel/modular-kernels
>
> 1. Android recovery mode should contain both SOC and ODM
> kernel modules in the recovery partition.
>
> 2. If a kernel module is required both in recovery and normal boot
> mode,  the module has to be located in recovery and vendor
> partition seperately.
>
> 3. Kernel modules used in recovery mode should be independent
> of vendor and odm partition
>
> 4. Recovery image should contain atleast
> storage, display, keypad, battery and pmic modules.
>
> Due to these requirements, recovery image size has increased
> to >10MB.
>
> This patch is to increase recovery partition size for TI devices
> so that we dont see such flashing error
>
> log:
> sending 'recovery' (12560 KB)...
> OKAY [  0.436s]
> writing 'recovery'...
> FAILED (remote: too large for partition)
> finished. total time: 0.458s
>
> Signed-off-by: Praneeth Bajjuri 
> ---
>  include/configs/am57xx_evm.h | 2 +-
>  include/configs/dra7xx_evm.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
> index ebb0474..dc05bea 100644
> --- a/include/configs/am57xx_evm.h
> +++ b/include/configs/am57xx_evm.h
> @@ -56,7 +56,7 @@
> "name=reserved,size=256K,uuid=${uuid_gpt_reserved};" \
> "name=efs,size=16M,uuid=${uuid_gpt_efs};" \
> "name=crypto,size=16K,uuid=${uuid_gpt_crypto};" \
> -   "name=recovery,size=10M,uuid=${uuid_gpt_recovery};" \
> +   "name=recovery,size=40M,uuid=${uuid_gpt_recovery};" \
> "name=boot,size=10M,uuid=${uuid_gpt_boot};" \
> "name=system,size=768M,uuid=${uuid_gpt_system};" \
> "name=vendor,size=256M,uuid=${uuid_gpt_vendor};" \
> diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
> index 34a4555..f84c1f0 100644
> --- a/include/configs/dra7xx_evm.h
> +++ b/include/configs/dra7xx_evm.h
> @@ -63,7 +63,7 @@
> "name=reserved,size=256K,uuid=${uuid_gpt_reserved};" \
> "name=efs,size=16M,uuid=${uuid_gpt_efs};" \
> "name=crypto,size=16K,uuid=${uuid_gpt_crypto};" \
> -   "name=recovery,size=10M,uuid=${uuid_gpt_recovery};" \
> +   "name=recovery,size=40M,uuid=${uuid_gpt_recovery};" \
> "name=boot,size=10M,uuid=${uuid_gpt_boot};" \
> "name=system,size=768M,uuid=${uuid_gpt_system};" \
> "name=vendor,size=256M,uuid=${uuid_gpt_vendor};" \
> --
> 1.9.1
>

Reviewed-by: Sam Protsenko 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/1] Makefile: add coccicheck target

2017-11-10 Thread Heinrich Schuchardt
Coccinelle is a program for static code analysis.
For details on Coccinelle see

http://coccinelle.lip6.fr/

Add scripts/coccicheck and Documentation/dev-tools/coccinelle.rst
copied from Linux kernel v4.14-rc8.

The coccicheck script executes the tests *.cocci in
directory scripts/coccinelle by calling spatch.

In Makefile add a coccicheck target. You can use it with

make coccicheck MODE=

where mode in patch, report, context, org.

Signed-off-by: Heinrich Schuchardt 
---
The patch depends on

[PATCH v2 1/1] scripts/ld-version.sh: regular expression compile fails
https://patchwork.ozlabs.org/patch/836029/
---
 Documentation/dev-tools/coccinelle.rst | 491 +
 Makefile   |   9 +
 scripts/coccicheck | 256 +
 3 files changed, 756 insertions(+)
 create mode 100644 Documentation/dev-tools/coccinelle.rst
 create mode 100755 scripts/coccicheck

diff --git a/Documentation/dev-tools/coccinelle.rst 
b/Documentation/dev-tools/coccinelle.rst
new file mode 100644
index 00..4a64b4c69d
--- /dev/null
+++ b/Documentation/dev-tools/coccinelle.rst
@@ -0,0 +1,491 @@
+.. Copyright 2010 Nicolas Palix 
+.. Copyright 2010 Julia Lawall 
+.. Copyright 2010 Gilles Muller 
+
+.. highlight:: none
+
+Coccinelle
+==
+
+Coccinelle is a tool for pattern matching and text transformation that has
+many uses in kernel development, including the application of complex,
+tree-wide patches and detection of problematic programming patterns.
+
+Getting Coccinelle
+---
+
+The semantic patches included in the kernel use features and options
+which are provided by Coccinelle version 1.0.0-rc11 and above.
+Using earlier versions will fail as the option names used by
+the Coccinelle files and coccicheck have been updated.
+
+Coccinelle is available through the package manager
+of many distributions, e.g. :
+
+ - Debian
+ - Fedora
+ - Ubuntu
+ - OpenSUSE
+ - Arch Linux
+ - NetBSD
+ - FreeBSD
+
+You can get the latest version released from the Coccinelle homepage at
+http://coccinelle.lip6.fr/
+
+Information and tips about Coccinelle are also provided on the wiki
+pages at http://cocci.ekstranet.diku.dk/wiki/doku.php
+
+Once you have it, run the following command::
+
+   ./configure
+make
+
+as a regular user, and install it with::
+
+sudo make install
+
+Supplemental documentation
+---
+
+For supplemental documentation refer to the wiki:
+
+https://bottest.wiki.kernel.org/coccicheck
+
+The wiki documentation always refers to the linux-next version of the script.
+
+Using Coccinelle on the Linux kernel
+
+
+A Coccinelle-specific target is defined in the top level
+Makefile. This target is named ``coccicheck`` and calls the ``coccicheck``
+front-end in the ``scripts`` directory.
+
+Four basic modes are defined: ``patch``, ``report``, ``context``, and
+``org``. The mode to use is specified by setting the MODE variable with
+``MODE=``.
+
+- ``patch`` proposes a fix, when possible.
+
+- ``report`` generates a list in the following format:
+  file:line:column-column: message
+
+- ``context`` highlights lines of interest and their context in a
+  diff-like style.Lines of interest are indicated with ``-``.
+
+- ``org`` generates a report in the Org mode format of Emacs.
+
+Note that not all semantic patches implement all modes. For easy use
+of Coccinelle, the default mode is "report".
+
+Two other modes provide some common combinations of these modes.
+
+- ``chain`` tries the previous modes in the order above until one succeeds.
+
+- ``rep+ctxt`` runs successively the report mode and the context mode.
+  It should be used with the C option (described later)
+  which checks the code on a file basis.
+
+Examples
+
+
+To make a report for every semantic patch, run the following command::
+
+   make coccicheck MODE=report
+
+To produce patches, run::
+
+   make coccicheck MODE=patch
+
+
+The coccicheck target applies every semantic patch available in the
+sub-directories of ``scripts/coccinelle`` to the entire Linux kernel.
+
+For each semantic patch, a commit message is proposed.  It gives a
+description of the problem being checked by the semantic patch, and
+includes a reference to Coccinelle.
+
+As any static code analyzer, Coccinelle produces false
+positives. Thus, reports must be carefully checked, and patches
+reviewed.
+
+To enable verbose messages set the V= variable, for example::
+
+   make coccicheck MODE=report V=1
+
+Coccinelle parallelization
+---
+
+By default, coccicheck tries to run as parallel as possible. To change
+the parallelism, set the J= variable. For example, to run across 4 CPUs::
+
+   make coccicheck MODE=report J=4
+
+As of Coccinelle 1.0.2 Coccinelle uses Ocaml parmap for 

[U-Boot] [PATCH 1/1] scripts/coccinelle: add some more coccinelle tests

2017-11-10 Thread Heinrich Schuchardt
Add some useful static code analysis scripts for coccinelle
copied from the Linux kernel v4.14-rc8:

Warn on check against NULL before calling free.
scripts/coccinelle/free/ifnullfree.cocci

Detect superfluous NULL check for list iterator.
scripts/coccinelle/iterators/itnull.cocci

Check if list iterator is reassigned.
scripts/coccinelle/iterators/list_entry_update.cocci

Check if list iterator is used after loop.
scripts/coccinelle/iterators/use_after_iter.cocci

Find wrong argument of sizeof in allocation function:
scripts/coccinelle/misc/badty.cocci

Signed-off-by: Heinrich Schuchardt 
---
 scripts/coccinelle/free/ifnullfree.cocci   |  59 +
 scripts/coccinelle/iterators/itnull.cocci  |  94 +
 .../coccinelle/iterators/list_entry_update.cocci   |  62 +
 scripts/coccinelle/iterators/use_after_iter.cocci  | 147 +
 scripts/coccinelle/misc/badty.cocci|  76 +++
 5 files changed, 438 insertions(+)
 create mode 100644 scripts/coccinelle/free/ifnullfree.cocci
 create mode 100644 scripts/coccinelle/iterators/itnull.cocci
 create mode 100644 scripts/coccinelle/iterators/list_entry_update.cocci
 create mode 100644 scripts/coccinelle/iterators/use_after_iter.cocci
 create mode 100644 scripts/coccinelle/misc/badty.cocci

diff --git a/scripts/coccinelle/free/ifnullfree.cocci 
b/scripts/coccinelle/free/ifnullfree.cocci
new file mode 100644
index 00..14a4cd98e8
--- /dev/null
+++ b/scripts/coccinelle/free/ifnullfree.cocci
@@ -0,0 +1,59 @@
+/// NULL check before some freeing functions is not needed.
+///
+/// Based on checkpatch warning
+/// "kfree(NULL) is safe this check is probably not required"
+/// and kfreeaddr.cocci by Julia Lawall.
+///
+// Copyright: (C) 2014 Fabian Frederick.  GPLv2.
+// Comments: -
+// Options: --no-includes --include-headers
+
+virtual patch
+virtual org
+virtual report
+virtual context
+
+@r2 depends on patch@
+expression E;
+@@
+- if (E != NULL)
+(
+  kfree(E);
+|
+  kzfree(E);
+|
+  debugfs_remove(E);
+|
+  debugfs_remove_recursive(E);
+|
+  usb_free_urb(E);
+|
+  kmem_cache_destroy(E);
+|
+  mempool_destroy(E);
+|
+  dma_pool_destroy(E);
+)
+
+@r depends on context || report || org @
+expression E;
+position p;
+@@
+
+* if (E != NULL)
+*  \(kfree@p\|kzfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|
+* usb_free_urb@p\|kmem_cache_destroy@p\|mempool_destroy@p\|
+* dma_pool_destroy@p\)(E);
+
+@script:python depends on org@
+p << r.p;
+@@
+
+cocci.print_main("NULL check before that freeing function is not needed", p)
+
+@script:python depends on report@
+p << r.p;
+@@
+
+msg = "WARNING: NULL check before freeing functions like kfree, 
debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe 
consider reorganizing relevant code to avoid passing NULL values."
+coccilib.report.print_report(p[0], msg)
diff --git a/scripts/coccinelle/iterators/itnull.cocci 
b/scripts/coccinelle/iterators/itnull.cocci
new file mode 100644
index 00..f58732b56a
--- /dev/null
+++ b/scripts/coccinelle/iterators/itnull.cocci
@@ -0,0 +1,94 @@
+/// Many iterators have the property that the first argument is always bound
+/// to a real list element, never NULL.
+//# False positives arise for some iterators that do not have this property,
+//# or in cases when the loop cursor is reassigned.  The latter should only
+//# happen when the matched code is on the way to a loop exit (break, goto,
+//# or return).
+///
+// Confidence: Moderate
+// Copyright: (C) 2010-2012 Nicolas Palix.  GPLv2.
+// Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6.  GPLv2.
+// Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6.  GPLv2.
+// URL: http://coccinelle.lip6.fr/
+// Comments:
+// Options: --no-includes --include-headers
+
+virtual patch
+virtual context
+virtual org
+virtual report
+
+@depends on patch@
+iterator I;
+expression x,E,E1,E2;
+statement S,S1,S2;
+@@
+
+I(x,...) { <...
+(
+- if (x == NULL && ...) S
+|
+- if (x != NULL || ...)
+  S
+|
+- (x == NULL) ||
+  E
+|
+- (x != NULL) &&
+  E
+|
+- (x == NULL && ...) ? E1 :
+  E2
+|
+- (x != NULL || ...) ?
+  E1
+- : E2
+|
+- if (x == NULL && ...) S1 else
+  S2
+|
+- if (x != NULL || ...)
+  S1
+- else S2
+|
++ BAD(
+  x == NULL
++ )
+|
++ BAD(
+  x != NULL
++ )
+)
+  ...> }
+
+@r depends on !patch exists@
+iterator I;
+expression x,E;
+position p1,p2;
+@@
+
+*I@p1(x,...)
+{ ... when != x = E
+(
+*  x@p2 == NULL
+|
+*  x@p2 != NULL
+)
+  ... when any
+}
+
+@script:python depends on org@
+p1 << r.p1;
+p2 << r.p2;
+@@
+
+cocci.print_main("iterator-bound variable",p1)
+cocci.print_secs("useless NULL test",p2)
+
+@script:python depends on report@
+p1 << r.p1;
+p2 << r.p2;
+@@
+
+msg = "ERROR: iterator variable bound on line %s cannot be NULL" % (p1[0].line)
+coccilib.report.print_report(p2[0], msg)
diff --git a/scripts/coccinelle/iterators/list_entry_update.cocci 
b/scripts/coccinelle/iterators/list_entry_update.cocci
new 

[U-Boot] [PATCH V2] armv8: ls1012a: Modify Kernel and Environment offset

2017-11-10 Thread Bhaskar Upadhaya
Kernel is now located at 0x100 instead of 0xa0
and Envirorment Variables are located at 3MB offset instead of
2MB in Flash

Signed-off-by: Bhaskar Upadhaya 
---
Changes for V2: Updated subject and removed white spaces

 include/configs/ls1012a_common.h | 4 ++--
 include/configs/ls1012afrdm.h| 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/configs/ls1012a_common.h b/include/configs/ls1012a_common.h
index d2fa50a..57cae94 100644
--- a/include/configs/ls1012a_common.h
+++ b/include/configs/ls1012a_common.h
@@ -65,7 +65,7 @@
 #define CONFIG_ENV_OVERWRITE
 
 #define CONFIG_ENV_SIZE0x4  /* 256KB */
-#define CONFIG_ENV_OFFSET  0x20/* 2MB */
+#define CONFIG_ENV_OFFSET  0x30/* 3MB */
 #define CONFIG_ENV_SECT_SIZE   0x4
 #endif
 
@@ -94,7 +94,7 @@
"kernel_addr=0x10\0"\
"fdt_high=0x\0" \
"initrd_high=0x\0"  \
-   "kernel_start=0xa0\0"   \
+   "kernel_start=0x100\0"  \
"kernel_load=0xa000\0"  \
"kernel_size=0x280\0"   \
 
diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h
index efb4c00..5b4bf28 100644
--- a/include/configs/ls1012afrdm.h
+++ b/include/configs/ls1012afrdm.h
@@ -27,7 +27,7 @@
"kernel_addr=0x10\0"\
"fdt_high=0x\0" \
"initrd_high=0x\0"  \
-   "kernel_start=0xa0\0"   \
+   "kernel_start=0x100\0"  \
"kernel_load=0x9600\0"  \
"kernel_size=0x280\0"
 
-- 
1.9.1

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


[U-Boot] [PATCH] Move Cache-As-RAM memory from area mapped to ROM in QEMU

2017-11-10 Thread Anton Gerasimov
ROM has been made read-only in qemu recently (namely commit
208fa0e43645edd0b0d8f838857dfc79daff40a8), so this patch restores
compatibility between u-boot and qemu. It is still broken for me
unless I set CONFIG_SMP=n and disable lapic (i.e. revert patch
55751ab1e5a5cfa0962d604593a7e6f33ff6 in u-boot), but these are
separate issues

Signed-off-by: Anton Gerasimov 
---
 arch/x86/cpu/qemu/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/cpu/qemu/Kconfig b/arch/x86/cpu/qemu/Kconfig
index 6808c9a6b9..f4b9922a34 100644
--- a/arch/x86/cpu/qemu/Kconfig
+++ b/arch/x86/cpu/qemu/Kconfig
@@ -11,7 +11,7 @@ if QEMU
 
 config SYS_CAR_ADDR
hex
-   default 0xd
+   default 0x1
 
 config SYS_CAR_SIZE
hex
-- 
2.14.1

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


Re: [U-Boot] Support of latest qemux86-64

2017-11-10 Thread Anton Gerasimov
Hooray, changing SYS_CAR_ADDR to 0x1 in arch/x86/cpu/qemu/Kconfig
does the trick. Bin, what do you think about it?

Best regards,
Anton Gerasimov

On 11/10/2017 06:25 PM, Anton Gerasimov wrote:
> Yes, apparently 0xdfffc is in ROM area for QEMU (0xc -- 0xe,
> defined in include/hw/loader.h). The next thing to figure out is why
> u-boot uses it as a stack area.
>
> Best regards,
> Anton Gerasimov
>
> On 11/10/2017 06:04 PM, Anton Gerasimov wrote:
>> New guess:
>>
>> in the most safe configuration of u-boot (CONFIG_SMP=n, lacpi disabled)
>> with Igor's patch applied `qemu-system-i386 -bios /path/to/uboot.rom`
>> fails on the first 'ret' instruction. GDB shows that memory at $esp
>> (0xdfffc at the entrance to board_init_f_mem) and everything around it
>> is zero despite 'call' and 'push' instructions executed. If you go one
>> commit before the breaking one it works fine, stuff gets put onto stack.
>> Could it that be that stack itself is in this 'readonly' area?
>>
>> Thanks,
>> Anton Gerasimov
>>
>> On 11/09/2017 02:58 AM, Bin Meng wrote:
>>> On Wed, Nov 8, 2017 at 9:05 PM, Anton Gerasimov
>>>  wrote:
 Adding Igor Mammedov to the loop.

>>> Really add Igor Mammedov.
>>>
>>> Igor, can you help look at this?
>>>
 On 11/08/2017 01:59 PM, Anton Gerasimov wrote:
> To whoever might be interested: I've bisected qemu and the breaking
> commit is 208fa0e43645edd0b0d8f838857dfc79daff40a8 (pc: make 'pc.rom'
> readonly when machine has PCI enabled). It's just three lines added,
> I'll paste the whole patch here. Not quite sure what can we do here 
> though.
>
>
>   diff --git a/hw/i386/pc.c b/hw/i386/pc.c
>   index 22e16031b0..59435390ba 100644
>   --- a/hw/i386/pc.c
>   +++ b/hw/i386/pc.c
>   @@ -1443,6 +1443,9 @@ void pc_memory_init(PCMachineState *pcms,
>option_rom_mr = g_malloc(sizeof(*option_rom_mr));
>memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
>   _fatal);
>   +if (pcmc->pci_enabled) {
>   +memory_region_set_readonly(option_rom_mr, true);
>   +}
>memory_region_add_subregion_overlap(rom_memory,
>PC_ROM_MIN_VGA,
>option_rom_mr,
>
>
>>> Regards,
>>> Bin


-- 
Anton Gerasimov, ATS Advanced Telematic Systems GmbH
Kantstrasse 162, 10623 Berlin
Managing Directors: Dirk Pöschl, Armin G. Schmidt
Register Court: HRB 151501 B, Amtsgericht Charlottenburg

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


[U-Boot] [PATCH v1] x86: tangier: Use official ACPI HID for FLIS IP

2017-11-10 Thread Andy Shevchenko
FLIS IP since now gets its own ACPI ID.
Drop PRP0001 workaround in favour of official ACPI HID.

Signed-off-by: Andy Shevchenko 
---
 arch/x86/include/asm/arch-tangier/acpi/southcluster.asl | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl 
b/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl
index e80ec0a9be..288b57cb80 100644
--- a/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl
+++ b/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl
@@ -264,7 +264,7 @@ Device (PCI0)
 
 Device (FLIS)
 {
-Name (_HID, "PRP0001")
+Name (_HID, "INTC1002")
 Name (_DDN, "Intel Merrifield Family-Level Interface Shim")
 Name (RBUF, ResourceTemplate()
 {
@@ -284,13 +284,6 @@ Device (FLIS)
 Return (RBUF)
 }
 
-Name (_DSD, Package () {
-ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
-Package () {
-Package () {"compatible", "intel,merrifield-pinctrl"},
-}
-})
-
 Method (_STA, 0, NotSerialized)
 {
 Return (STA_VISIBLE)
-- 
2.14.2

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


Re: [U-Boot] Support of latest qemux86-64

2017-11-10 Thread Anton Gerasimov
Yes, apparently 0xdfffc is in ROM area for QEMU (0xc -- 0xe,
defined in include/hw/loader.h). The next thing to figure out is why
u-boot uses it as a stack area.

Best regards,
Anton Gerasimov

On 11/10/2017 06:04 PM, Anton Gerasimov wrote:
> New guess:
>
> in the most safe configuration of u-boot (CONFIG_SMP=n, lacpi disabled)
> with Igor's patch applied `qemu-system-i386 -bios /path/to/uboot.rom`
> fails on the first 'ret' instruction. GDB shows that memory at $esp
> (0xdfffc at the entrance to board_init_f_mem) and everything around it
> is zero despite 'call' and 'push' instructions executed. If you go one
> commit before the breaking one it works fine, stuff gets put onto stack.
> Could it that be that stack itself is in this 'readonly' area?
>
> Thanks,
> Anton Gerasimov
>
> On 11/09/2017 02:58 AM, Bin Meng wrote:
>> On Wed, Nov 8, 2017 at 9:05 PM, Anton Gerasimov
>>  wrote:
>>> Adding Igor Mammedov to the loop.
>>>
>> Really add Igor Mammedov.
>>
>> Igor, can you help look at this?
>>
>>> On 11/08/2017 01:59 PM, Anton Gerasimov wrote:
 To whoever might be interested: I've bisected qemu and the breaking
 commit is 208fa0e43645edd0b0d8f838857dfc79daff40a8 (pc: make 'pc.rom'
 readonly when machine has PCI enabled). It's just three lines added,
 I'll paste the whole patch here. Not quite sure what can we do here though.


   diff --git a/hw/i386/pc.c b/hw/i386/pc.c
   index 22e16031b0..59435390ba 100644
   --- a/hw/i386/pc.c
   +++ b/hw/i386/pc.c
   @@ -1443,6 +1443,9 @@ void pc_memory_init(PCMachineState *pcms,
option_rom_mr = g_malloc(sizeof(*option_rom_mr));
memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
   _fatal);
   +if (pcmc->pci_enabled) {
   +memory_region_set_readonly(option_rom_mr, true);
   +}
memory_region_add_subregion_overlap(rom_memory,
PC_ROM_MIN_VGA,
option_rom_mr,


>> Regards,
>> Bin
>

-- 
Anton Gerasimov, ATS Advanced Telematic Systems GmbH
Kantstrasse 162, 10623 Berlin
Managing Directors: Dirk Pöschl, Armin G. Schmidt
Register Court: HRB 151501 B, Amtsgericht Charlottenburg

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


Re: [U-Boot] Support of latest qemux86-64

2017-11-10 Thread Anton Gerasimov
New guess:

in the most safe configuration of u-boot (CONFIG_SMP=n, lacpi disabled)
with Igor's patch applied `qemu-system-i386 -bios /path/to/uboot.rom`
fails on the first 'ret' instruction. GDB shows that memory at $esp
(0xdfffc at the entrance to board_init_f_mem) and everything around it
is zero despite 'call' and 'push' instructions executed. If you go one
commit before the breaking one it works fine, stuff gets put onto stack.
Could it that be that stack itself is in this 'readonly' area?

Thanks,
Anton Gerasimov

On 11/09/2017 02:58 AM, Bin Meng wrote:
> On Wed, Nov 8, 2017 at 9:05 PM, Anton Gerasimov
>  wrote:
>> Adding Igor Mammedov to the loop.
>>
> Really add Igor Mammedov.
>
> Igor, can you help look at this?
>
>> On 11/08/2017 01:59 PM, Anton Gerasimov wrote:
>>> To whoever might be interested: I've bisected qemu and the breaking
>>> commit is 208fa0e43645edd0b0d8f838857dfc79daff40a8 (pc: make 'pc.rom'
>>> readonly when machine has PCI enabled). It's just three lines added,
>>> I'll paste the whole patch here. Not quite sure what can we do here though.
>>>
>>>
>>>   diff --git a/hw/i386/pc.c b/hw/i386/pc.c
>>>   index 22e16031b0..59435390ba 100644
>>>   --- a/hw/i386/pc.c
>>>   +++ b/hw/i386/pc.c
>>>   @@ -1443,6 +1443,9 @@ void pc_memory_init(PCMachineState *pcms,
>>>option_rom_mr = g_malloc(sizeof(*option_rom_mr));
>>>memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
>>>   _fatal);
>>>   +if (pcmc->pci_enabled) {
>>>   +memory_region_set_readonly(option_rom_mr, true);
>>>   +}
>>>memory_region_add_subregion_overlap(rom_memory,
>>>PC_ROM_MIN_VGA,
>>>option_rom_mr,
>>>
>>>
> Regards,
> Bin


-- 
Anton Gerasimov, ATS Advanced Telematic Systems GmbH
Kantstrasse 162, 10623 Berlin
Managing Directors: Dirk Pöschl, Armin G. Schmidt
Register Court: HRB 151501 B, Amtsgericht Charlottenburg


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


[U-Boot] [PATCH v2 3/3] sunxi: README.sunxi64: Document verified-boot for a64

2017-11-10 Thread Jagan Teki
Add verified-boot documentation for sunxi a64 platform.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- New patch

 board/sunxi/README.sunxi64 | 177 +
 1 file changed, 177 insertions(+)

diff --git a/board/sunxi/README.sunxi64 b/board/sunxi/README.sunxi64
index c492f74..5a2fe69 100644
--- a/board/sunxi/README.sunxi64
+++ b/board/sunxi/README.sunxi64
@@ -160,6 +160,183 @@ Then write this image to a microSD card, replacing 
/dev/sdx with the right
 device file (see above):
 $ dd if=firmware.img of=/dev/sdx bs=8k seek=1
 
+Verified Boot
+=
+
+U-Boot supports an image verification method called "Verified Boot".
+This is a brief tutorial to utilize this feature for the Sunxi A64 platform.
+You will find details documents in the doc/uImage.FIT directory.
+
+Here, we take Orangepi Win board for example, but it should work for any
+other boards including 32 bit SoCs.
+
+1. Generate RSA key to sign
+
+  $ mkdir keys
+  $ openssl genpkey -algorithm RSA -out keys/dev.key \
+-pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:65537
+  $ openssl req -batch -new -x509 -key keys/dev.key -out keys/dev.crt
+
+Two files "dev.key" and "dev.crt" will be created.  The base name is arbitrary,
+but need to match to the "key-name-hint" property described below.
+
+2. FIT Input
+
+>8
+/dts-v1/;
+/ {
+   description = "FIT image with single Linux kernel, FDT blob";
+   #address-cells = <1>;
+
+   images {
+   kernel@0 {
+   description = "ARM64 Linux kernel";
+   data = 
/incbin/("/path/to/linux/dir/arch/arm64/boot/Image.gz");
+   type = "kernel";
+   arch = "arm64";
+   os = "linux";
+   compression = "gzip";
+   load = <0x5008>;
+   entry = <0x5008>;
+   hash@1 {
+   algo = "sha256";
+   };
+   };
+
+   fdt@0 {
+   description = "Orangepi Win/Win+ Devicetree blob";
+   data = 
/incbin/("/path/to/linux/dir/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dtb");
+   type = "flat_dt";
+   arch = "arm64";
+   compression = "none";
+   hash@1 {
+   algo = "sha256";
+   };
+   };
+   };
+
+   configurations {
+   default = "conf@0";
+
+   conf@0 {
+   description = "Boot Linux kernel, FDT blob";
+   kernel = "kernel@0";
+   fdt = "fdt@0";
+   signature@0 {
+   algo = "sha256,rsa2048";
+   key-name-hint = "dev";
+   sign-images = "kernel", "fdt";
+   };
+   };
+   };
+};
+>8
+
+You need to change the two '/incbin/' lines, depending on the location of
+your kernel image and devicetree blob.  The "load" and "entry" properties also
+need to be adjusted if you want to change the physical placement of the kernel.
+
+The "key-name-hint" must specify the key name you have created in the step 1.
+
+The FIT file name is arbitrary.  Let's say you saved it into "fit.its".
+
+3. Compile U-Boot with FIT and signature enabled
+
+To use the Verified Boot, you need to enable the following two options:
+  CONFIG_FIT
+  CONFIG_FIT_SIGNATURE
+
+  $ make orangepi_win_defconfig
+  $ make CROSS_COMPILE=aarch64-linux-gnu-
+
+4. FIT Output
+
+After building U-Boot, you will see tools/mkimage.  With this tool, you can
+create an image tree blob as follows:
+
+  $ tools/mkimage -f fit.its -k keys -K dts/dt.dtb -r -F fitImage
+
+The -k option must specify the key directory you have created in step 1.
+
+A file "fitImage" will be created.  This includes kernel, DTB,
+hash data for each of the three, and signature data.
+
+The public key needed for the run-time verification is stored in "dts/dt.dtb".
+
+5. Compile Verified U-Boot
+
+Since the "dt.dtb" has been updated in step 4, you need to re-compile the
+U-Boot.
+
+  $ make CROSS_COMPILE=aarch64-linux-gnu-
+
+The re-compiled "u-boot.bin" is appended with DTB that contains the public key.
+
+6. Flash the image
+
+Flash the "fitImage" to a storage device (SD, NAND, eMMC, or whatever) on your
+board.
+
+7. Boot verified kernel
+
+Load the fitImage to memory and run the following from the U-Boot command line.
+
+  > bootm 
+
+Here,  is the base address of the fitImage.
+
+If it is successful, you will see messages like follows:
+

[U-Boot] [PATCH v2 2/3] sunxi: arm64: Increase CONFIG_SYS_BOOTM_LEN to 32MB

2017-11-10 Thread Jagan Teki
The default value of CONFIG_SYS_BOOTM_LEN, 0x80, causes error
when uncompressing Image.gz out of FIT image.

  Uncompressing Kernel Image ... Error: inflate() returned -5
Image too large: increase CONFIG_SYS_BOOTM_LEN

and loading Image out of FIT image.
   Loading Kernel Image ... Image too large: increase CONFIG_SYS_BOOTM_LEN
Must RESET board to recover

Signed-off-by: Jagan Teki 
---
Changes for v2:
- Add in separate patch with proper commit message

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

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 4391a8c..2bdbc2a 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -34,6 +34,7 @@
 
 #ifdef CONFIG_ARM64
 #define CONFIG_BUILD_TARGET "u-boot.itb"
+#define CONFIG_SYS_BOOTM_LEN   (32 << 20)
 #endif
 
 /* Serial & console */
-- 
2.7.4

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


[U-Boot] [PATCH v2 1/3] sunxi: a64: Enable FIT Signature

2017-11-10 Thread Jagan Teki
Enable FIT_SIGNATURE for sunxi a64.

Signed-off-by: Jagan Teki 
---
Changes for v2:
- Use imply instead of select

 arch/arm/mach-sunxi/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index 09cfec6..9ee356f 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -178,6 +178,7 @@ config MACH_SUN50I
select SUNXI_DRAM_DW
select SUNXI_DRAM_DW_32BIT
select FIT
+   imply FIT_SIGNATURE
select SPL_LOAD_FIT
 
 config MACH_SUN50I_H5
-- 
2.7.4

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


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

2017-11-10 Thread Tom Rini
On Fri, Nov 10, 2017 at 07:37:21PM +0530, Jagan Teki wrote:

> Hi Tom,
> 
> Few more fixes for v2017.11, Please pull the same.
> 
> thanks!
> Jagan.
> 
> The following changes since commit 60567a320f4a55f05ae94fbb34f7aac0dd4c8fea:
> 
>   Merge git://git.denx.de/u-boot-rockchip (2017-11-10 08:19:01 -0500)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-sunxi.git master
> 
> for you to fetch changes up to 8e2c2d413c37b7fd13641730b706774c08982f0f:
> 
>   sunxi: SATA link timeout fix (2017-11-10 19:21:24 +0530)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [PATCH] fpga: allow programming fpga from FIT image for all FPGA drivers

2017-11-10 Thread Goldschmidt Simon
This drops the limit that fpga is only loaded from FIT images for Xilinx.
This is done by moving the 'partial' check from 'common/image.c' to
'drivers/fpga/xilinx.c' (the only driver supporting partial images yet)
and supplies a weak default implementation in 'drivers/fpga/fpga.c'.

Signed-off-by: Simon Goldschmidt 
---
 common/bootm.c|  2 +-
 common/image.c|  6 ++
 drivers/fpga/fpga.c   |  9 +
 drivers/fpga/xilinx.c | 13 +
 include/fpga.h|  1 +
 5 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/common/bootm.c b/common/bootm.c
index 9493a306cd..adb12137c7 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -248,7 +248,7 @@ int bootm_find_images(int flag, int argc, char * const 
argv[])
 #endif
 
 #if IMAGE_ENABLE_FIT
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_XILINX)
+#if defined(CONFIG_FPGA)
/* find bitstreams */
ret = boot_get_fpga(argc, argv, , IH_ARCH_DEFAULT,
NULL, NULL);
diff --git a/common/image.c b/common/image.c
index 06fdca129c..9fd72b9423 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1223,7 +1223,7 @@ int boot_get_setup(bootm_headers_t *images, uint8_t arch,
 }
 
 #if IMAGE_ENABLE_FIT
-#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_XILINX)
+#if defined(CONFIG_FPGA)
 int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images,
  uint8_t arch, const ulong *ld_start, ulong * const ld_len)
 {
@@ -1234,8 +1234,6 @@ int boot_get_fpga(int argc, char * const argv[], 
bootm_headers_t *images,
const char *uname, *name;
int err;
int devnum = 0; /* TODO support multi fpga platforms */
-   const fpga_desc * const desc = fpga_get_desc(devnum);
-   xilinx_desc *desc_xilinx = desc->devdesc;
 
/* Check to see if the images struct has a FIT configuration */
if (!genimg_has_config(images)) {
@@ -1280,7 +1278,7 @@ int boot_get_fpga(int argc, char * const argv[], 
bootm_headers_t *images,
return fit_img_result;
}
 
-   if (img_len >= desc_xilinx->size) {
+   if (!fpga_is_partial_data(devnum, img_len)) {
name = "full";
err = fpga_loadbitstream(devnum, (char *)img_data,
 img_len, BIT_FULL);
diff --git a/drivers/fpga/fpga.c b/drivers/fpga/fpga.c
index e0fb1b4e78..6aead27f16 100644
--- a/drivers/fpga/fpga.c
+++ b/drivers/fpga/fpga.c
@@ -171,6 +171,15 @@ int fpga_add(fpga_type devtype, void *desc)
 }
 
 /*
+ * Return 1 if the fpga data is partial.
+ * This is only required for fpga drivers that support bitstream_type.
+ */
+int __weak fpga_is_partial_data(int devnum, size_t img_len)
+{
+   return 0;
+}
+
+/*
  * Convert bitstream data and load into the fpga
  */
 int __weak fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
diff --git a/drivers/fpga/xilinx.c b/drivers/fpga/xilinx.c
index 941f30010a..3c05760969 100644
--- a/drivers/fpga/xilinx.c
+++ b/drivers/fpga/xilinx.c
@@ -24,6 +24,19 @@ static int xilinx_validate(xilinx_desc *desc, char *fn);
 
 /* - */
 
+int fpga_is_partial_data(int devnum, size_t img_len)
+{
+   const fpga_desc * const desc = fpga_get_desc(devnum);
+   xilinx_desc *desc_xilinx = desc->devdesc;
+
+   /* Check datasize against FPGA size */
+   if (img_len >= desc_xilinx->size)
+   return 0;
+
+   /* datasize is smaller, must be partial data */
+   return 1;
+}
+
 int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
   bitstream_type bstype)
 {
diff --git a/include/fpga.h b/include/fpga.h
index d768fb1417..4d6da790b7 100644
--- a/include/fpga.h
+++ b/include/fpga.h
@@ -54,6 +54,7 @@ void fpga_init(void);
 int fpga_add(fpga_type devtype, void *desc);
 int fpga_count(void);
 const fpga_desc *const fpga_get_desc(int devnum);
+int fpga_is_partial_data(int devnum, size_t img_len);
 int fpga_load(int devnum, const void *buf, size_t bsize,
  bitstream_type bstype);
 int fpga_fsload(int devnum, const void *buf, size_t size,
-- 
2.12.2.windows.2

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


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

2017-11-10 Thread Jagan Teki
Hi Tom,

Few more fixes for v2017.11, Please pull the same.

thanks!
Jagan.

The following changes since commit 60567a320f4a55f05ae94fbb34f7aac0dd4c8fea:

  Merge git://git.denx.de/u-boot-rockchip (2017-11-10 08:19:01 -0500)

are available in the git repository at:

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

for you to fetch changes up to 8e2c2d413c37b7fd13641730b706774c08982f0f:

  sunxi: SATA link timeout fix (2017-11-10 19:21:24 +0530)


Chen-Yu Tsai (1):
  net: sun8i_emac: Fix build for non-H3/H5 SoCs

Werner B??llmann (1):
  sunxi: SATA link timeout fix

 board/sunxi/board.c  | 2 ++
 drivers/net/sun8i_emac.c | 3 +++
 2 files changed, 5 insertions(+)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] sunxi: SATA link timeout fix

2017-11-10 Thread Jagan Teki
On Thu, Nov 9, 2017 at 5:56 PM, Jagan Teki  wrote:
> On Thu, Nov 9, 2017 at 5:36 PM, Maxime Ripard
>  wrote:
>> On Thu, Nov 09, 2017 at 05:12:08PM +0530, Jagan Teki wrote:
>>> On Thu, Nov 9, 2017 at 3:06 PM, Maxime Ripard
>>>  wrote:
>>> > On Thu, Nov 09, 2017 at 02:48:18PM +0530, Jagan Teki wrote:
>>> >> On Wed, Nov 8, 2017 at 5:35 PM, Peter Robinson  
>>> >> wrote:
>>> >> > On Wed, Nov 8, 2017 at 11:32 AM, Jagan Teki  
>>> >> > wrote:
>>> >> >> On Tue, Nov 7, 2017 at 5:43 PM, Jagan Teki  
>>> >> >> wrote:
>>> >> >>> On Sun, Nov 5, 2017 at 7:11 PM, Werner Böllmann
>>> >> >>>  wrote:
>>> >>  After updating u-boot from v2016.01 to 2017.09 i got a "SATA link 0 
>>> >>  timeout." on my Cubietruck board.
>>> >>  I tracked this down to this patch.
>>> >> 
>>> >>  http://git.denx.de/?p=u-boot.git;a=commitdiff_plain;h=9fbb0c3aa49f4604b0342cb527a6bd099f92eaeb.
>>> >> >>>
>>> >> >>> Look like mdelay missing while moving to board file.
>>> >> >>
>>> >> >> Can someone test this?
>>> >> >
>>> >> > I boot my Cubietruck off a SATA drive without issues with any of those
>>> >> > intervening releases but it's a SSD so there would be no spin up time
>>> >> > compared to spinning rust, I don't have a spare spinning disk to test
>>> >> > it with though.
>>> >>
>>> >> So w/o the mdelay work for you?
>>> >
>>> > I guess the point of this patch was that you need to have the delay,
>>> > but the time between the two function calls might cover it, and
>>> > apparently in some case doesn't.
>>> >
>>> > So whether it works in one particular case is entirely moot.
>>>
>>> Then, better some more debugging needed in this case.
>>
>> I'm not sure why that is needed, if we need the delay, we should add
>> it explicitly, just like this patch does.
>
> Since it works on particular case, can't we verify non-working area?
> adding delay is hard for me but look like this patch needed.

Updated commit message and Applied on u-boot-sunxi/master

-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH V2] armv8: ls1012a: Modify Kernel and Environment offset

2017-11-10 Thread Bhaskar Upadhaya
Kernel is now located at 0x100 instead of 0xa0
and Envirorment Variables are located at 3MB offset instead of
2MB in Flash

Signed-off-by: Bhaskar Upadhaya 
---
Changes for V2: Updated subject and removed white spaces
---
 include/configs/ls1012a_common.h | 4 ++--
 include/configs/ls1012afrdm.h| 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/configs/ls1012a_common.h b/include/configs/ls1012a_common.h
index d2fa50a..57cae94 100644
--- a/include/configs/ls1012a_common.h
+++ b/include/configs/ls1012a_common.h
@@ -65,7 +65,7 @@
 #define CONFIG_ENV_OVERWRITE
 
 #define CONFIG_ENV_SIZE0x4  /* 256KB */
-#define CONFIG_ENV_OFFSET  0x20/* 2MB */
+#define CONFIG_ENV_OFFSET  0x30/* 3MB */
 #define CONFIG_ENV_SECT_SIZE   0x4
 #endif
 
@@ -94,7 +94,7 @@
"kernel_addr=0x10\0"\
"fdt_high=0x\0" \
"initrd_high=0x\0"  \
-   "kernel_start=0xa0\0"   \
+   "kernel_start=0x100\0"  \
"kernel_load=0xa000\0"  \
"kernel_size=0x280\0"   \
 
diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h
index efb4c00..5b4bf28 100644
--- a/include/configs/ls1012afrdm.h
+++ b/include/configs/ls1012afrdm.h
@@ -27,7 +27,7 @@
"kernel_addr=0x10\0"\
"fdt_high=0x\0" \
"initrd_high=0x\0"  \
-   "kernel_start=0xa0\0"   \
+   "kernel_start=0x100\0"  \
"kernel_load=0x9600\0"  \
"kernel_size=0x280\0"
 
-- 
1.9.1

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


Re: [U-Boot] [PATCH] gpt: add part-uuid and part-num subcommands

2017-11-10 Thread Andrey Yurovsky
On Thu, Nov 9, 2017 at 1:55 AM, Lukasz Majewski  wrote:
> Hi Andrey,
>
>> Hi Otavio,
>>
>> On Wed, Nov 8, 2017 at 2:47 AM, Otavio Salvador
>>  wrote:
>> > On Tue, Nov 7, 2017 at 10:43 PM, your name 
>> > wrote:
>> >> From: Andrey Yurovsky 
>> >>
>> >> It is useful to be able to retrieve a partition UUID or number
>> >> given the partition label, for instance some systems use the
>> >> partition label to indicate the purpose of the partition (such as
>> >> "rootfs0" being the 0th root file system in an A/B image scheme).
>> >>
>> >> Add "gpt part-uuid" to retrieve the partition UUID for a given
>> >> label and "gpt part-num" to retrieve the partition number for a
>> >> given label along with some documentation.
>> >>
>> >> Signed-off-by: Andrey Yurovsky 
>> >
>> > Why not use the 'part' cmd? it provides it.
>>
>> Sorry, I missed the part cmd, it doesn't seem to be documented in doc/
>> and it's unclear what  means there.
>
> If I may ask - Andrey, if you are now on this "topic" - would you dare
> to add some ./doc entry for 'part' command?

Yes, I will do that.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PULL] Please pull u-boot-rockchip

2017-11-10 Thread Tom Rini
On Fri, Nov 10, 2017 at 02:16:08PM +0100, Dr. Philipp Tomsich wrote:

> Tom,
> 
> as it turns out, we have some more fixes (for documentation and a 
> board-specific
> header file) for 2017.11.
> 
> Thanks,
> Philipp.
> 
> 
> The following changes since commit 1c4043e53236d94f217e98625ea201690e85f56d:
> 
>   Merge branch 'master' of git://git.denx.de/u-boot-sunxi (2017-11-09 
> 08:11:40 -0500)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-rockchip.git master
> 
> for you to fetch changes up to 36b6e0cc3ca9deea0ea02c10e44bda8979c94637:
> 
>   rockchip: configs: vyasa: Update falcon offsets (2017-11-10 14:08:22 +0100)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [PULL] Please pull u-boot-rockchip

2017-11-10 Thread Dr. Philipp Tomsich
Tom,

as it turns out, we have some more fixes (for documentation and a board-specific
header file) for 2017.11.

Thanks,
Philipp.


The following changes since commit 1c4043e53236d94f217e98625ea201690e85f56d:

  Merge branch 'master' of git://git.denx.de/u-boot-sunxi (2017-11-09 08:11:40 
-0500)

are available in the git repository at:

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

for you to fetch changes up to 36b6e0cc3ca9deea0ea02c10e44bda8979c94637:

  rockchip: configs: vyasa: Update falcon offsets (2017-11-10 14:08:22 +0100)


Goldschmidt Simon (1):
  rockchip: doc: update U-Boot location info

Jagan Teki (2):
  rockchip: doc: Fix U-Boot proper location for falcon
  rockchip: configs: vyasa: Update falcon offsets

 doc/README.rockchip| 4 ++--
 include/configs/vyasa-rk3288.h | 8 
 2 files changed, 6 insertions(+), 6 deletions(-)

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


[U-Boot] [PATCH 1/2] arm: zynq: Do not show information from checkboard twice

2017-11-10 Thread Michal Simek
There is no reason to show information about board twice.
Remove boardinfo late calls.

Signed-off-by: Michal Simek 
---

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

diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index e6aab081e440..7247c9030755 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -291,9 +291,6 @@
 /* FIT support */
 #define CONFIG_IMAGE_FORMAT_LEGACY /* enable also legacy image format */
 
-/* FDT support */
-#define CONFIG_DISPLAY_BOARDINFO_LATE
-
 /* Extend size of kernel image for uncompression */
 #define CONFIG_SYS_BOOTM_LEN   (60 * 1024 * 1024)
 
-- 
1.9.1

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


[U-Boot] [PATCH 2/2] arm: zynq: Show information about silicon version

2017-11-10 Thread Michal Simek
Show information about silicon in bootlog.

Signed-off-by: Michal Simek 
---

 board/xilinx/zynq/board.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
index 871e9dcba07f..e59038106aa6 100644
--- a/board/xilinx/zynq/board.c
+++ b/board/xilinx/zynq/board.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -111,7 +112,15 @@ int board_late_init(void)
 #ifdef CONFIG_DISPLAY_BOARDINFO
 int checkboard(void)
 {
+   u32 version = zynq_get_silicon_version();
+
+   version <<= 1;
+   if (version > (PCW_SILICON_VERSION_3 << 1))
+   version += 1;
+
puts("Board: Xilinx Zynq\n");
+   printf("Silicon: v%d.%d\n", version >> 1, version & 1);
+
return 0;
 }
 #endif
-- 
1.9.1

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


Re: [U-Boot] [U-Boot, 2/2] rockchip: configs: vyasa: Update falcon offsets

2017-11-10 Thread Philipp Tomsich
> Update the falcon offsets for args to 16MB and kernel to 17MB
> Since the below commit updated U-Boot proper location along
> with rockchip boot image offsets
> "spl: set SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to 0x4000 for rockchip"
> (sha1: 8f4d62b403db45dfa8b1cadb9da9096c79b7df47)
> 
> Signed-off-by: Jagan Teki 
> Acked-by: Philipp Tomsich 
> Reviewed-by: Philipp Tomsich 
> ---
> Note: Fix for 2017.11
> 
>  include/configs/vyasa-rk3288.h | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] rockchip: doc: update U-Boot location info

2017-11-10 Thread Philipp Tomsich
> The U-Boot location has been moved to block 16384.
> This is 8MB, not 4MB.
> 
> Signed-off-by: Simon Goldschmidt 
> Reviewed-by: Jagan Teki 
> Acked-by: Philipp Tomsich 
> Reviewed-by: Philipp Tomsich 
> ---
>  doc/README.rockchip | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 1/2] rockchip: doc: Fix U-Boot proper location for falcon

2017-11-10 Thread Philipp Tomsich
> This patch fixed U-Boot proper location has been
> missed to update in bewlo commit
> "rockchip: doc: update U-Boot location info"
> (sha1: 73e6dbe855f357a8330cfd53ff3033303611c1ad)
> 
> Signed-off-by: Jagan Teki 
> Acked-by: Philipp Tomsich 
> Reviewed-by: Philipp Tomsich 
> ---
> Note: Fix for 2017.11
> 
>  doc/README.rockchip | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] arm: zynq: Add ps7_init for cc108

2017-11-10 Thread Michal Simek
After some generic cleanup adding ps7_init* to repository
is not big pain now.

Signed-off-by: Michal Simek 
---

 board/xilinx/zynq/zynq-cc108/ps7_init_gpl.c | 806 
 1 file changed, 806 insertions(+)
 create mode 100644 board/xilinx/zynq/zynq-cc108/ps7_init_gpl.c

diff --git a/board/xilinx/zynq/zynq-cc108/ps7_init_gpl.c 
b/board/xilinx/zynq/zynq-cc108/ps7_init_gpl.c
new file mode 100644
index ..eafb2db167b7
--- /dev/null
+++ b/board/xilinx/zynq/zynq-cc108/ps7_init_gpl.c
@@ -0,0 +1,806 @@
+/*
+ * (c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+
+static unsigned long ps7_pll_init_data_3_0[] = {
+   EMIT_MASKWRITE(0XF808, 0xU,   0xDF0DU),
+   EMIT_MASKWRITE(0XF8000110, 0x0030U,   0x000FA220U),
+   EMIT_MASKWRITE(0XF8000100, 0x0007F000U,   0x00028000U),
+   EMIT_MASKWRITE(0XF8000100, 0x0010U,   0x0010U),
+   EMIT_MASKWRITE(0XF8000100, 0x0001U,   0x0001U),
+   EMIT_MASKWRITE(0XF8000100, 0x0001U,   0xU),
+   EMIT_MASKPOLL(0XF800010C,  0x0001U),
+   EMIT_MASKWRITE(0XF8000100, 0x0010U,   0xU),
+   EMIT_MASKWRITE(0XF8000120, 0x1F003F30U,   0x1F000200U),
+   EMIT_MASKWRITE(0XF8000114, 0x0030U,   0x0012C220U),
+   EMIT_MASKWRITE(0XF8000104, 0x0007F000U,   0x0002U),
+   EMIT_MASKWRITE(0XF8000104, 0x0010U,   0x0010U),
+   EMIT_MASKWRITE(0XF8000104, 0x0001U,   0x0001U),
+   EMIT_MASKWRITE(0XF8000104, 0x0001U,   0xU),
+   EMIT_MASKPOLL(0XF800010C,  0x0002U),
+   EMIT_MASKWRITE(0XF8000104, 0x0010U,   0xU),
+   EMIT_MASKWRITE(0XF8000124, 0xFFF3U,   0x0C23U),
+   EMIT_MASKWRITE(0XF8000118, 0x0030U,   0x001452C0U),
+   EMIT_MASKWRITE(0XF8000108, 0x0007F000U,   0x0001E000U),
+   EMIT_MASKWRITE(0XF8000108, 0x0010U,   0x0010U),
+   EMIT_MASKWRITE(0XF8000108, 0x0001U,   0x0001U),
+   EMIT_MASKWRITE(0XF8000108, 0x0001U,   0xU),
+   EMIT_MASKPOLL(0XF800010C,  0x0004U),
+   EMIT_MASKWRITE(0XF8000108, 0x0010U,   0xU),
+   EMIT_MASKWRITE(0XF804, 0xU,   0x767BU),
+   EMIT_EXIT(),
+
+};
+
+static unsigned long ps7_clock_init_data_3_0[] = {
+   EMIT_MASKWRITE(0XF808, 0xU, 0xDF0DU),
+   EMIT_MASKWRITE(0XF8000128, 0x03F03F01U, 0x00302301U),
+   EMIT_MASKWRITE(0XF8000138, 0x0011U, 0x0001U),
+   EMIT_MASKWRITE(0XF8000140, 0x03F03F71U, 0x00100801U),
+   EMIT_MASKWRITE(0XF800014C, 0x3F31U, 0x0501U),
+   EMIT_MASKWRITE(0XF8000150, 0x3F33U, 0x0A02U),
+   EMIT_MASKWRITE(0XF8000154, 0x3F33U, 0x0A01U),
+   EMIT_MASKWRITE(0XF8000168, 0x3F31U, 0x0501U),
+   EMIT_MASKWRITE(0XF8000170, 0x03F03F30U, 0x00100A00U),
+   EMIT_MASKWRITE(0XF8000180, 0x03F03F30U, 0x00101400U),
+   EMIT_MASKWRITE(0XF8000190, 0x03F03F30U, 0x00101400U),
+   EMIT_MASKWRITE(0XF80001A0, 0x03F03F30U, 0x00101400U),
+   EMIT_MASKWRITE(0XF80001C4, 0x0001U, 0x0001U),
+   EMIT_MASKWRITE(0XF800012C, 0x01FFCCCDU, 0x01DC084DU),
+   EMIT_MASKWRITE(0XF804, 0xU, 0x767BU),
+   EMIT_EXIT(),
+
+};
+
+static unsigned long ps7_ddr_init_data_3_0[] = {
+   EMIT_MASKWRITE(0XF8006000, 0x0001U,   0x0080U),
+   EMIT_MASKWRITE(0XF8006004, 0x0007U,   0x1081U),
+   EMIT_MASKWRITE(0XF8006008, 0x03FFU,   0x03C0780FU),
+   EMIT_MASKWRITE(0XF800600C, 0x03FFU,   0x02001001U),
+   EMIT_MASKWRITE(0XF8006010, 0x03FFU,   0x00014001U),
+   EMIT_MASKWRITE(0XF8006014, 0x001FU,   0x0004159BU),
+   EMIT_MASKWRITE(0XF8006018, 0xF7FFU,   0x452460D2U),
+   EMIT_MASKWRITE(0XF800601C, 0xU,   0x720238E5U),
+   EMIT_MASKWRITE(0XF8006020, 0x7FDCU,   0x270872D0U),
+   EMIT_MASKWRITE(0XF8006024, 0x0FC3U,   0xU),
+   EMIT_MASKWRITE(0XF8006028, 0x3FFFU,   0x2007U),
+   EMIT_MASKWRITE(0XF800602C, 0xU,   0x0008U),
+   EMIT_MASKWRITE(0XF8006030, 0xU,   0x00040930U),
+   EMIT_MASKWRITE(0XF8006034, 0x13FF3FFFU,   0x000116D4U),
+   EMIT_MASKWRITE(0XF8006038, 0x0003U,   0xU),
+   EMIT_MASKWRITE(0XF800603C, 0x000FU,   0x0777U),
+   EMIT_MASKWRITE(0XF8006040, 0xU,   0xFFF0U),
+   EMIT_MASKWRITE(0XF8006044, 0x0FFFU,   0x0FF6U),
+   EMIT_MASKWRITE(0XF8006048, 0x0003F03FU,   0x0003C008U),
+   EMIT_MASKWRITE(0XF8006050, 0xFF0F8FFFU,   0x77010800U),
+   EMIT_MASKWRITE(0XF8006058, 0x0001U,   0xU),
+   EMIT_MASKWRITE(0XF800605C, 0xU,   0x5003U),
+   EMIT_MASKWRITE(0XF8006060, 0x17FFU,   0x003EU),
+   EMIT_MASKWRITE(0XF8006064, 0x00021FE0U,   0x0002U),
+   EMIT_MASKWRITE(0XF8006068, 0x03FFU,   0x00284141U),
+   

[U-Boot] [PATCH] arm: zynq: Use unsigned type with comparison with ARRAY_SIZE

2017-11-10 Thread Michal Simek
Sparse is return warning about this:
arch/arm/mach-zynq/slcr.c: In function 'zynq_slcr_get_mio_pin_status':
arch/arm/mach-zynq/slcr.c:185:16: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < ARRAY_SIZE(mio_periphs); i++) {
^

Signed-off-by: Michal Simek 
---

 arch/arm/mach-zynq/slcr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
index 2a207ae46c18..ba453a70248d 100644
--- a/arch/arm/mach-zynq/slcr.c
+++ b/arch/arm/mach-zynq/slcr.c
@@ -179,8 +179,9 @@ u32 zynq_slcr_get_idcode(void)
 int zynq_slcr_get_mio_pin_status(const char *periph)
 {
const struct zynq_slcr_mio_get_status *mio_ptr;
-   int val, i, j;
+   int val, j;
int mio = 0;
+   u32 i;
 
for (i = 0; i < ARRAY_SIZE(mio_periphs); i++) {
if (strcmp(periph, mio_periphs[i].peri_name) == 0) {
-- 
1.9.1

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


[U-Boot] [PATCH] arm: zynq: Remove double const qualifier

2017-11-10 Thread Michal Simek
The patch fix these warnings:
include/fpga.h:56:24: warning: type qualifiers ignored on function
return type [-Wignored-qualifiers]
 const fpga_desc *const fpga_get_desc(int devnum);
^
include/fpga.h:65:24: warning: type qualifiers ignored on function
return type [-Wignored-qualifiers]
 const fpga_desc *const fpga_validate(int devnum, const void *buf,
^
drivers/fpga/fpga.c:41:24: warning: type qualifiers ignored on function
return type [-Wignored-qualifiers]
 const fpga_desc *const fpga_get_desc(int devnum)
^
drivers/fpga/fpga.c:58:24: warning: type qualifiers ignored on function
return type [-Wignored-qualifiers]
 const fpga_desc *const fpga_validate(int devnum, const void *buf,
^
...

Signed-off-by: Michal Simek 
---

 common/image.c  | 2 +-
 drivers/fpga/fpga.c | 8 
 include/fpga.h  | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/common/image.c b/common/image.c
index 06fdca129caf..ebab94a53a01 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1234,7 +1234,7 @@ int boot_get_fpga(int argc, char * const argv[], 
bootm_headers_t *images,
const char *uname, *name;
int err;
int devnum = 0; /* TODO support multi fpga platforms */
-   const fpga_desc * const desc = fpga_get_desc(devnum);
+   const fpga_desc *desc = fpga_get_desc(devnum);
xilinx_desc *desc_xilinx = desc->devdesc;
 
/* Check to see if the images struct has a FIT configuration */
diff --git a/drivers/fpga/fpga.c b/drivers/fpga/fpga.c
index e0fb1b4e783b..af7e12e98624 100644
--- a/drivers/fpga/fpga.c
+++ b/drivers/fpga/fpga.c
@@ -38,7 +38,7 @@ static void fpga_no_sup(char *fn, char *msg)
 /* fpga_get_desc
  * map a device number to a descriptor
  */
-const fpga_desc *const fpga_get_desc(int devnum)
+const fpga_desc *fpga_get_desc(int devnum)
 {
fpga_desc *desc = (fpga_desc *)NULL;
 
@@ -55,8 +55,8 @@ const fpga_desc *const fpga_get_desc(int devnum)
  * fpga_validate
  * generic parameter checking code
  */
-const fpga_desc *const fpga_validate(int devnum, const void *buf,
-size_t bsize, char *fn)
+const fpga_desc *fpga_validate(int devnum, const void *buf,
+  size_t bsize, char *fn)
 {
const fpga_desc *desc = fpga_get_desc(devnum);
 
@@ -77,7 +77,7 @@ const fpga_desc *const fpga_validate(int devnum, const void 
*buf,
 static int fpga_dev_info(int devnum)
 {
int ret_val = FPGA_FAIL; /* assume failure */
-   const fpga_desc * const desc = fpga_get_desc(devnum);
+   const fpga_desc *desc = fpga_get_desc(devnum);
 
if (desc) {
debug("%s: Device Descriptor @ 0x%p\n",
diff --git a/include/fpga.h b/include/fpga.h
index d768fb14171a..95e44f238dda 100644
--- a/include/fpga.h
+++ b/include/fpga.h
@@ -53,7 +53,7 @@ typedef enum {
 void fpga_init(void);
 int fpga_add(fpga_type devtype, void *desc);
 int fpga_count(void);
-const fpga_desc *const fpga_get_desc(int devnum);
+const fpga_desc *fpga_get_desc(int devnum);
 int fpga_load(int devnum, const void *buf, size_t bsize,
  bitstream_type bstype);
 int fpga_fsload(int devnum, const void *buf, size_t size,
@@ -62,7 +62,7 @@ int fpga_loadbitstream(int devnum, char *fpgadata, size_t 
size,
   bitstream_type bstype);
 int fpga_dump(int devnum, const void *buf, size_t bsize);
 int fpga_info(int devnum);
-const fpga_desc *const fpga_validate(int devnum, const void *buf,
-size_t bsize, char *fn);
+const fpga_desc *fpga_validate(int devnum, const void *buf,
+  size_t bsize, char *fn);
 
 #endif /* _FPGA_H_ */
-- 
1.9.1

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


[U-Boot] sdhci - review?

2017-11-10 Thread Jorge Ramirez

On 11/07/2017 11:48 PM, Tom Rini wrote:

On Tue, Nov 07, 2017 at 08:13:02AM +0100, Jorge Ramirez wrote:

On 11/07/2017 12:28 AM, Tom Rini wrote:

Hey all,

It's release day and v2017.11-rc4 is out.  It's a week until release
day.  Please let me know if you know of any regressions, thanks!

Hi Tom,

emmc accesses are broken for dragonboard410c
I posted the fix [1] last week. will you merge it?


just changed the email subject


[1] is: https://patchwork.ozlabs.org/patch/833376/

Jaehoon, are you OK with this patch?  Thanks!



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


Re: [U-Boot] [PATCH 2/2] arm: mvebu: clearfog: update SPI flash DT description

2017-11-10 Thread Jagan Teki
On Thu, Nov 9, 2017 at 5:56 PM, Baruch Siach  wrote:
> All current ClearFog SOMs have the SPI flash populated. Enable SPI flash in
> the device tree.
>
> Add an alias to the SPI bus so that the 'sf' command can probe the flash on
> bus 1.
>
> Add the "spi-flash" compatible string to make the standard SPI flash driver
> probe the device.
>
> Signed-off-by: Baruch Siach 
> ---

Reviewed-by: Jagan Teki 

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] arm: mvebu: clearfog: Fix SPI-NOR flash access

2017-11-10 Thread Jagan Teki
On Thu, Nov 9, 2017 at 5:55 PM, Baruch Siach  wrote:
> From: Jon Nettleton 
>
> The production variant of the SPI flash used by the clearfog
> devices are based on winbond chips.  Additionally enable
> SPI_FLASH_BAR since some variants will have 16MB of flash
> that requires this to be enabled.
>
> Remove the default speed and mode; these values are taken from the
> device tree when CONFIG_DM_SPI_FLASH is enabled.
>
> Add default bus, so that 'sf' detects the SPI flash by default.
>
> Signed-off-by: Jon Nettleton 
> [baruch: remove speed/mode; add bus]
> Signed-off-by: Baruch Siach 
> ---
>  configs/clearfog_defconfig | 2 ++
>  include/configs/clearfog.h | 5 ++---
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
> index 3de204346d88..726c444f6042 100644
> --- a/configs/clearfog_defconfig
> +++ b/configs/clearfog_defconfig
> @@ -46,3 +46,5 @@ CONFIG_DM_USB=y
>  CONFIG_USB_XHCI_HCD=y
>  CONFIG_USB_XHCI_MVEBU=y
>  CONFIG_USB_STORAGE=y
> +CONFIG_SPI_FLASH_BAR=y
> +CONFIG_SPI_FLASH_MTD=y
> diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
> index 5061f6c6fd16..f6b442b9461f 100644
> --- a/include/configs/clearfog.h
> +++ b/include/configs/clearfog.h
> @@ -33,9 +33,8 @@
>  #define CONFIG_SYS_I2C_SPEED   10
>
>  /* SPI NOR flash default params, used by sf commands */
> -#define CONFIG_SF_DEFAULT_SPEED100
> -#define CONFIG_SF_DEFAULT_MODE SPI_MODE_3
> -#define CONFIG_SPI_FLASH_STMICRO
> +#define CONFIG_SF_DEFAULT_BUS  1
> +#define CONFIG_SPI_FLASH_WINBOND

Even this can move to defconfig

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] cmd: sf: remove useless pointer assignment

2017-11-10 Thread Lukasz Majewski
On Thu,  9 Nov 2017 13:49:59 +0200
Baruch Siach  wrote:

> The 'flash' pointer is assigned unconditionally a few lines below,
> and is not used before that.
> 
> Signed-off-by: Baruch Siach 
> ---
>  cmd/sf.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/cmd/sf.c b/cmd/sf.c
> index f971eec781cc..9be8a89bc84c 100644
> --- a/cmd/sf.c
> +++ b/cmd/sf.c
> @@ -126,7 +126,6 @@ static int do_spi_flash_probe(int argc, char *
> const argv[]) if (!ret) {
>   device_remove(new, DM_REMOVE_NORMAL);
>   }
> - flash = NULL;
>   ret = spi_flash_probe_bus_cs(bus, cs, speed, mode, );
>   if (ret) {
>   printf("Failed to initialize SPI flash at %u:%u
> (error %d)\n",

Reviewed-by: Lukasz Majewski 

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de


pgpBM_1_34yhF.pgp
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/2] rockchip: configs: vyasa: Update falcon offsets

2017-11-10 Thread Philipp Tomsich
> Update the falcon offsets for args to 16MB and kernel to 17MB
> Since the below commit updated U-Boot proper location along
> with rockchip boot image offsets
> "spl: set SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to 0x4000 for rockchip"
> (sha1: 8f4d62b403db45dfa8b1cadb9da9096c79b7df47)
> 
> Signed-off-by: Jagan Teki 
> ---
> Note: Fix for 2017.11
> 
>  include/configs/vyasa-rk3288.h | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

Reviewed-by: Philipp Tomsich 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 1/2] rockchip: doc: Fix U-Boot proper location for falcon

2017-11-10 Thread Philipp Tomsich
> This patch fixed U-Boot proper location has been
> missed to update in bewlo commit
> "rockchip: doc: update U-Boot location info"
> (sha1: 73e6dbe855f357a8330cfd53ff3033303611c1ad)
> 
> Signed-off-by: Jagan Teki 
> ---
> Note: Fix for 2017.11
> 
>  doc/README.rockchip | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Philipp Tomsich 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/2] rockchip: configs: vyasa: Update falcon offsets

2017-11-10 Thread Philipp Tomsich
> Update the falcon offsets for args to 16MB and kernel to 17MB
> Since the below commit updated U-Boot proper location along
> with rockchip boot image offsets
> "spl: set SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to 0x4000 for rockchip"
> (sha1: 8f4d62b403db45dfa8b1cadb9da9096c79b7df47)
> 
> Signed-off-by: Jagan Teki 
> ---
> Note: Fix for 2017.11
> 
>  include/configs/vyasa-rk3288.h | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

Acked-by: Philipp Tomsich 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 1/2] rockchip: doc: Fix U-Boot proper location for falcon

2017-11-10 Thread Philipp Tomsich
> This patch fixed U-Boot proper location has been
> missed to update in bewlo commit
> "rockchip: doc: update U-Boot location info"
> (sha1: 73e6dbe855f357a8330cfd53ff3033303611c1ad)
> 
> Signed-off-by: Jagan Teki 
> ---
> Note: Fix for 2017.11
> 
>  doc/README.rockchip | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Acked-by: Philipp Tomsich 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] rockchip: doc: update U-Boot location info

2017-11-10 Thread Philipp Tomsich
> The U-Boot location has been moved to block 16384.
> This is 8MB, not 4MB.
> 
> Signed-off-by: Simon Goldschmidt 
> Reviewed-by: Jagan Teki 
> ---
>  doc/README.rockchip | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Acked-by: Philipp Tomsich 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] rockchip: doc: update U-Boot location info

2017-11-10 Thread Philipp Tomsich
> The U-Boot location has been moved to block 16384.
> This is 8MB, not 4MB.
> 
> Signed-off-by: Simon Goldschmidt 
> Reviewed-by: Jagan Teki 
> ---
>  doc/README.rockchip | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Philipp Tomsich 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2] rockchip: configs: vyasa: Update falcon offsets

2017-11-10 Thread Jagan Teki
Update the falcon offsets for args to 16MB and kernel to 17MB
Since the below commit updated U-Boot proper location along
with rockchip boot image offsets
"spl: set SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to 0x4000 for rockchip"
(sha1: 8f4d62b403db45dfa8b1cadb9da9096c79b7df47)

Signed-off-by: Jagan Teki 
---
Note: Fix for 2017.11

 include/configs/vyasa-rk3288.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/configs/vyasa-rk3288.h b/include/configs/vyasa-rk3288.h
index 8774e42..c8c7fc7 100644
--- a/include/configs/vyasa-rk3288.h
+++ b/include/configs/vyasa-rk3288.h
@@ -31,10 +31,10 @@
 #define CONFIG_SYS_SPL_ARGS_ADDR   0x0ffe5000
 #define CONFIG_CMD_SPL_WRITE_SIZE  (128 * SZ_1K)
 
-/* Falcon Mode - MMC support: args@1MB kernel@2MB */
-#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x800   /* 1MB */
-#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 
512)
-#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR0x1000  /* 2MB */
+/* Falcon Mode - MMC support: args@16MB kernel@17MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x8000  /* 16MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 
(CONFIG_CMD_SPL_WRITE_SIZE / 512)
+#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR0x8800  /* 17MB 
*/
 #endif
 
 #endif
-- 
2.7.4

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


[U-Boot] [PATCH 1/2] rockchip: doc: Fix U-Boot proper location for falcon

2017-11-10 Thread Jagan Teki
This patch fixed U-Boot proper location has been
missed to update in bewlo commit
"rockchip: doc: update U-Boot location info"
(sha1: 73e6dbe855f357a8330cfd53ff3033303611c1ad)

Signed-off-by: Jagan Teki 
---
Note: Fix for 2017.11

 doc/README.rockchip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/README.rockchip b/doc/README.rockchip
index 9d5af3d..dffa6d5 100644
--- a/doc/README.rockchip
+++ b/doc/README.rockchip
@@ -166,7 +166,7 @@ To write an image that boots from an SD card (assumed to be 
/dev/mmcblk0):
./tools/mkimage -n rk3288 -T rksd -d ./tpl/u-boot-tpl.bin out &&
 cat ./spl/u-boot-spl-dtb.bin >> out &&
 sudo dd if=out of=/dev/mmcblk0 seek=64 &&
-sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 seek=256
+sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 seek=16384
 
 Booting from an SD card on RK3188
 =
-- 
2.7.4

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


Re: [U-Boot] [PATCH] rockchip: doc: update U-Boot location info

2017-11-10 Thread Jagan Teki
On Fri, Nov 10, 2017 at 5:08 PM, Goldschmidt Simon
 wrote:
> The U-Boot location has been moved to block 16384.
> This is 8MB, not 4MB.
>
> Signed-off-by: Simon Goldschmidt 

Reviewed-by: Jagan Teki 

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] rockchip: doc: update U-Boot location info

2017-11-10 Thread Goldschmidt Simon
The U-Boot location has been moved to block 16384.
This is 8MB, not 4MB.

Signed-off-by: Simon Goldschmidt 
---
 doc/README.rockchip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/README.rockchip b/doc/README.rockchip
index 9d5af3d53d..a7761af3e8 100644
--- a/doc/README.rockchip
+++ b/doc/README.rockchip
@@ -102,7 +102,7 @@ To write an image that boots from an SD card (assumed to be 
/dev/sdc):
sudo dd if=firefly-rk3288/u-boot-dtb.img of=/dev/sdc seek=16384
 
 This puts the Rockchip header and SPL image first and then places the U-Boot
-image at block 16384 (i.e. 4MB from the start of the SD card). This
+image at block 16384 (i.e. 8MB from the start of the SD card). This
 corresponds with this setting in U-Boot:
 
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x4000
-- 
2.12.2.windows.2

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


Re: [U-Boot] [U-Boot, 2/3] rockchip: doc: update U-Boot location info

2017-11-10 Thread Dr. Philipp Tomsich

> On 10 Nov 2017, at 12:30, Goldschmidt Simon 
>  wrote:
> 
>>> I just found this commit has calculated the size wrong. 16384 blocks should 
>>> be 8MB, not 4MB.
>> 
>> Yes, 8MB is what expected here and even Kever[1] commented the same, what is 
>> 4MB here? can you elaborate.
> 
> I know. It's only wrong in 'doc/README.rockchip' at line 105 where it says:
> 
> "image at block 16384 (i.e. 4MB from the start of the SD card)”

Please send a patch with a documentation update and I’ll see that this
gets applied quickly.

Thanks,
Phil.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/3] rockchip: doc: update U-Boot location info

2017-11-10 Thread Goldschmidt Simon
>> I just found this commit has calculated the size wrong. 16384 blocks should 
>> be 8MB, not 4MB.
> 
> Yes, 8MB is what expected here and even Kever[1] commented the same, what is 
> 4MB here? can you elaborate.

I know. It's only wrong in 'doc/README.rockchip' at line 105 where it says:

"image at block 16384 (i.e. 4MB from the start of the SD card)"


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


Re: [U-Boot] [U-Boot, 2/3] rockchip: doc: update U-Boot location info

2017-11-10 Thread Dr. Philipp Tomsich

> On 10 Nov 2017, at 12:26, Jagan Teki  wrote:
> 
> On Fri, Nov 10, 2017 at 4:48 PM, Dr. Philipp Tomsich
>  wrote:
>> Jagan,
>> 
>>> On 10 Nov 2017, at 12:12, Jagan Teki  wrote:
>>> 
>>> On Fri, Nov 10, 2017 at 3:53 PM, Dr. Philipp Tomsich
>>>  wrote:
 Kever,
 
> On 10 Nov 2017, at 08:24, Goldschmidt Simon 
>  wrote:
> 
>>> Update rockchip U-Boot location to 0x4000/16384.
 
 At least the location given in the commit message is consistent:
   (gdb) p 0x4000
   $1 = 16384
 
>>> Signed-off-by: Kever Yang 
>>> Acked-by: Philipp Tomsich 
>>> Reviewed-by: Philipp Tomsich 
>>> ---
>>> 
>>> doc/README.rockchip | 6 +++---
>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>> 
>> 
>> Applied to u-boot-rockchip, thanks!
> 
> I just found this commit has calculated the size wrong. 16384 blocks 
> should be 8MB, not 4MB.
 
 Could you take a look at this and let us know if this should be changed?
 And if it needs a change (and you want it in Monday’s release): please 
 submit a
 patch and I’ll try to generate a PR to Tom over the weekend…
>>> 
>>> This even require some README.rockchip and falcon offset changes,
>>> Sorry I really don't understand why the new features been added for
>>> release tree.
>> 
>> This is not a new feature, but merely a configuration change.
>> Plus, it ensures consistency with the (legacy) vendor U-Boot.
> 
> AFAIK, global config options sometimes new changes I've seen the
> series in ML on 02/11 which is crossed MW. ie reason I've commented.

We still have a major issue with what the rk3*_common.h files affect and
how the can generate unwanted side-effects. The goal should be to have
these further cleaned up for the future to not have these dependencies and
rather rely on each board’s DTS to configure things.

>> Note that worked fine my smoke tests, as we have the offsets configured in 
>> the
>> DTS for our boards and don’t rely on platform/chipset defaults (which will 
>> never
>> be right for all use-cases anyway)…
> 
> OK.
> 
> thanks!
> -- 
> Jagan Teki
> Free Software Engineer | www.openedev.com
> U-Boot, Linux | Upstream Maintainer
> Hyderabad, India.

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


Re: [U-Boot] [U-Boot, 2/3] rockchip: doc: update U-Boot location info

2017-11-10 Thread Jagan Teki
On Fri, Nov 10, 2017 at 4:48 PM, Dr. Philipp Tomsich
 wrote:
> Jagan,
>
>> On 10 Nov 2017, at 12:12, Jagan Teki  wrote:
>>
>> On Fri, Nov 10, 2017 at 3:53 PM, Dr. Philipp Tomsich
>>  wrote:
>>> Kever,
>>>
 On 10 Nov 2017, at 08:24, Goldschmidt Simon 
  wrote:

>> Update rockchip U-Boot location to 0x4000/16384.
>>>
>>> At least the location given in the commit message is consistent:
>>>(gdb) p 0x4000
>>>$1 = 16384
>>>
>> Signed-off-by: Kever Yang 
>> Acked-by: Philipp Tomsich 
>> Reviewed-by: Philipp Tomsich 
>> ---
>>
>> doc/README.rockchip | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>
> Applied to u-boot-rockchip, thanks!

 I just found this commit has calculated the size wrong. 16384 blocks 
 should be 8MB, not 4MB.
>>>
>>> Could you take a look at this and let us know if this should be changed?
>>> And if it needs a change (and you want it in Monday’s release): please 
>>> submit a
>>> patch and I’ll try to generate a PR to Tom over the weekend…
>>
>> This even require some README.rockchip and falcon offset changes,
>> Sorry I really don't understand why the new features been added for
>> release tree.
>
> This is not a new feature, but merely a configuration change.
> Plus, it ensures consistency with the (legacy) vendor U-Boot.

AFAIK, global config options sometimes new changes I've seen the
series in ML on 02/11 which is crossed MW. ie reason I've commented.

> Note that worked fine my smoke tests, as we have the offsets configured in the
> DTS for our boards and don’t rely on platform/chipset defaults (which will 
> never
> be right for all use-cases anyway)…

OK.

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/3] rockchip: doc: update U-Boot location info

2017-11-10 Thread Jagan Teki
On Fri, Nov 10, 2017 at 12:54 PM, Goldschmidt Simon
 wrote:
>>> Update rockchip U-Boot location to 0x4000/16384.
>>>
>>> Signed-off-by: Kever Yang 
>>> Acked-by: Philipp Tomsich 
>>> Reviewed-by: Philipp Tomsich 
>>> ---
>>>
>>>  doc/README.rockchip | 6 +++---
>>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>
>> Applied to u-boot-rockchip, thanks!
>
> I just found this commit has calculated the size wrong. 16384 blocks should 
> be 8MB, not 4MB.

Yes, 8MB is what expected here and even Kever[1] commented the same,
what is 4MB here? can you elaborate.

[1] https://patchwork.ozlabs.org/patch/833240/

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/3] rockchip: doc: update U-Boot location info

2017-11-10 Thread Dr. Philipp Tomsich
Jagan,

> On 10 Nov 2017, at 12:12, Jagan Teki  wrote:
> 
> On Fri, Nov 10, 2017 at 3:53 PM, Dr. Philipp Tomsich
>  wrote:
>> Kever,
>> 
>>> On 10 Nov 2017, at 08:24, Goldschmidt Simon 
>>>  wrote:
>>> 
> Update rockchip U-Boot location to 0x4000/16384.
>> 
>> At least the location given in the commit message is consistent:
>>(gdb) p 0x4000
>>$1 = 16384
>> 
> Signed-off-by: Kever Yang 
> Acked-by: Philipp Tomsich 
> Reviewed-by: Philipp Tomsich 
> ---
> 
> doc/README.rockchip | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
> 
 
 Applied to u-boot-rockchip, thanks!
>>> 
>>> I just found this commit has calculated the size wrong. 16384 blocks should 
>>> be 8MB, not 4MB.
>> 
>> Could you take a look at this and let us know if this should be changed?
>> And if it needs a change (and you want it in Monday’s release): please 
>> submit a
>> patch and I’ll try to generate a PR to Tom over the weekend…
> 
> This even require some README.rockchip and falcon offset changes,
> Sorry I really don't understand why the new features been added for
> release tree.

This is not a new feature, but merely a configuration change.
Plus, it ensures consistency with the (legacy) vendor U-Boot.

Note that worked fine my smoke tests, as we have the offsets configured in the
DTS for our boards and don’t rely on platform/chipset defaults (which will never
be right for all use-cases anyway)…

Regards,
Philipp.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/3] rockchip: doc: update U-Boot location info

2017-11-10 Thread Jagan Teki
On Fri, Nov 10, 2017 at 3:53 PM, Dr. Philipp Tomsich
 wrote:
> Kever,
>
>> On 10 Nov 2017, at 08:24, Goldschmidt Simon 
>>  wrote:
>>
 Update rockchip U-Boot location to 0x4000/16384.
>
> At least the location given in the commit message is consistent:
> (gdb) p 0x4000
> $1 = 16384
>
 Signed-off-by: Kever Yang 
 Acked-by: Philipp Tomsich 
 Reviewed-by: Philipp Tomsich 
 ---

 doc/README.rockchip | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

>>>
>>> Applied to u-boot-rockchip, thanks!
>>
>> I just found this commit has calculated the size wrong. 16384 blocks should 
>> be 8MB, not 4MB.
>
> Could you take a look at this and let us know if this should be changed?
> And if it needs a change (and you want it in Monday’s release): please submit 
> a
> patch and I’ll try to generate a PR to Tom over the weekend…

This even require some README.rockchip and falcon offset changes,
Sorry I really don't understand why the new features been added for
release tree.

thanks!
-- 
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] test/py: Add dependency on HUSH parser

2017-11-10 Thread Michal Simek
After adding our small zynq uboot which has hush parser off these 3 tests
start to failed. It is probably just coincidence that others are
passing without hush parser.

Signed-off-by: Michal Simek 
---

Not sure if this is the right dependency but would be great if someone
can test it too.

---
 test/py/tests/test_env.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
index b7f960c755fe..05e57c3f04c4 100644
--- a/test/py/tests/test_env.py
+++ b/test/py/tests/test_env.py
@@ -188,6 +188,7 @@ def test_env_unset_non_existent(state_test_env):
 unset_var(state_test_env, var)
 validate_empty(state_test_env, var)
 
+@pytest.mark.buildconfigspec('hush_parser')
 def test_env_set_non_existent(state_test_env):
 """Test set a non-existant variable."""
 
@@ -196,6 +197,7 @@ def test_env_set_non_existent(state_test_env):
 set_var(state_test_env, var, value)
 validate_set(state_test_env, var, value)
 
+@pytest.mark.buildconfigspec('hush_parser')
 def test_env_set_existing(state_test_env):
 """Test setting an existant variable."""
 
@@ -212,6 +214,7 @@ def test_env_unset_existing(state_test_env):
 unset_var(state_test_env, var)
 validate_empty(state_test_env, var)
 
+@pytest.mark.buildconfigspec('hush_parser')
 def test_env_expansion_spaces(state_test_env):
 """Test expanding a variable that contains a space in its value."""
 
-- 
1.9.1

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


[U-Boot] [PATCH 7/9] arm: zynq: Add ps7GetSiliconVersion() to ps7_spl_init

2017-11-10 Thread Michal Simek
Unfortunately camelcase is coming from ps7_init* format.

Signed-off-by: Michal Simek 
---

 arch/arm/mach-zynq/include/mach/ps7_init_gpl.h | 6 ++
 arch/arm/mach-zynq/ps7_spl_init.c  | 6 ++
 2 files changed, 12 insertions(+)

diff --git a/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h 
b/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h
index 4269f1fe46d4..0398ba098286 100644
--- a/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h
+++ b/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h
@@ -30,6 +30,10 @@
 #define PS7_POLL_FAILED_DMA  (4)
 #define PS7_POLL_FAILED_PLL  (5)
 
+#define PCW_SILICON_VERSION_1  0
+#define PCW_SILICON_VERSION_2  1
+#define PCW_SILICON_VERSION_3  2
+
 /* Called by spl.c */
 int ps7_init(void);
 int ps7_post_config(void);
@@ -37,4 +41,6 @@ int ps7_post_config(void);
 /* Defined in ps7_init_common.c */
 int ps7_config(unsigned long *ps7_config_init);
 
+unsigned long ps7GetSiliconVersion(void);
+
 #endif /* _ASM_ARCH_PS7_INIT_GPL_H */
diff --git a/arch/arm/mach-zynq/ps7_spl_init.c 
b/arch/arm/mach-zynq/ps7_spl_init.c
index 180099577b04..069827880d10 100644
--- a/arch/arm/mach-zynq/ps7_spl_init.c
+++ b/arch/arm/mach-zynq/ps7_spl_init.c
@@ -7,6 +7,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 __weak int ps7_init(void)
@@ -134,3 +135,8 @@ int __weak ps7_config(unsigned long *ps7_config_init)
ptr += numargs;
}
 }
+
+unsigned long __weak __maybe_unused ps7GetSiliconVersion(void)
+{
+   return zynq_get_silicon_version();
+}
-- 
1.9.1

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


[U-Boot] [PATCH 5/9] arm: zynq: Get rid of ps7_reset_apu() for syzygy board

2017-11-10 Thread Michal Simek
There is no reason to call separate function.

Signed-off-by: Michal Simek 
---

 board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c 
b/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c
index f2a757a5cfeb..5aa3951b8017 100644
--- a/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c
+++ b/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c
@@ -347,17 +347,11 @@ int ps7_post_config(void)
return ps7_config(ps7_post_config_3_0);
 }
 
-
-int ps7_reset_apu(void)
-{
-   return ps7_config(ps7_reset_apu_3_0);
-}
-
 int ps7_init(void)
 {
int ret;
 
-   ret = ps7_reset_apu();
+   ret = ps7_config(ps7_reset_apu_3_0);
if (ret != PS7_INIT_SUCCESS)
return ret;
 
-- 
1.9.1

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


[U-Boot] [PATCH 6/9] arm: zynq: Move common ps7_init* initialization to arch code

2017-11-10 Thread Michal Simek
This patch is based on work done in topic board where the first address
word also storing operation which should be done. This is reducing size
of configuration data.
This patch is not breaking an option to copy default ps7_init_gpl* files
from hdf file but it is doing preparation for ps7_init* consolidation.

The patch is also marking ps7_config as weak function.

Signed-off-by: Michal Simek 
---

 arch/arm/mach-zynq/include/mach/ps7_init_gpl.h |  28 -
 arch/arm/mach-zynq/ps7_spl_init.c  | 109 +++
 board/topic/zynq/Makefile  |   2 +-
 board/topic/zynq/ps7_init_common.c | 117 -
 board/topic/zynq/ps7_init_gpl.h|  34 --
 board/topic/zynq/zynq-topic-miami/ps7_init_gpl.c   |   2 +-
 .../topic/zynq/zynq-topic-miamilite/ps7_init_gpl.c |   2 +-
 .../topic/zynq/zynq-topic-miamiplus/ps7_init_gpl.c |   2 +-
 8 files changed, 140 insertions(+), 156 deletions(-)
 delete mode 100644 board/topic/zynq/ps7_init_common.c
 delete mode 100644 board/topic/zynq/ps7_init_gpl.h

diff --git a/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h 
b/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h
index 6e30108b23f4..4269f1fe46d4 100644
--- a/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h
+++ b/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h
@@ -1,5 +1,6 @@
 /*
- * (c) Copyright 2010-2017 Xilinx, Inc. All rights reserved.
+ * (c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
+ * (c) Copyright 2016 Topic Embedded Products.
  *
  * SPDX-License-Identifier:GPL-2.0+
  */
@@ -7,8 +8,33 @@
 #ifndef _ASM_ARCH_PS7_INIT_GPL_H
 #define _ASM_ARCH_PS7_INIT_GPL_H
 
+/* Opcode exit is 0 all the time */
+#define OPCODE_EXIT   0U
+#define OPCODE_MASKWRITE  0U
+#define OPCODE_MASKPOLL   1U
+#define OPCODE_MASKDELAY  2U
+#define OPCODE_ADDRESS_MASK (~3U)
+
+/* Sentinel */
+#define EMIT_EXIT() OPCODE_EXIT
+/* Opcode is in lower 2 bits of address, address is always 4-byte aligned */
+#define EMIT_MASKWRITE(addr, mask, val) OPCODE_MASKWRITE | addr, mask, val
+#define EMIT_MASKPOLL(addr, mask)   OPCODE_MASKPOLL | addr, mask
+#define EMIT_MASKDELAY(addr, mask)  OPCODE_MASKDELAY | addr, mask
+
+/* Returns codes of ps7_init* */
+#define PS7_INIT_SUCCESS   (0)
+#define PS7_INIT_CORRUPT   (1)
+#define PS7_INIT_TIMEOUT   (2)
+#define PS7_POLL_FAILED_DDR_INIT (3)
+#define PS7_POLL_FAILED_DMA  (4)
+#define PS7_POLL_FAILED_PLL  (5)
+
 /* Called by spl.c */
 int ps7_init(void);
 int ps7_post_config(void);
 
+/* Defined in ps7_init_common.c */
+int ps7_config(unsigned long *ps7_config_init);
+
 #endif /* _ASM_ARCH_PS7_INIT_GPL_H */
diff --git a/arch/arm/mach-zynq/ps7_spl_init.c 
b/arch/arm/mach-zynq/ps7_spl_init.c
index 6adf852578a6..180099577b04 100644
--- a/arch/arm/mach-zynq/ps7_spl_init.c
+++ b/arch/arm/mach-zynq/ps7_spl_init.c
@@ -1,5 +1,6 @@
 /*
  * (c) Copyright 2010-2017 Xilinx, Inc. All rights reserved.
+ * (c) Copyright 2016 Topic Embedded Products.
  *
  * SPDX-License-Identifier:GPL-2.0+
  */
@@ -25,3 +26,111 @@ __weak int ps7_post_config(void)
 */
return 0;
 }
+
+/* For delay calculation using global registers*/
+#define SCU_GLOBAL_TIMER_COUNT_L32 0xF8F00200
+#define SCU_GLOBAL_TIMER_COUNT_U32 0xF8F00204
+#define SCU_GLOBAL_TIMER_CONTROL   0xF8F00208
+#define SCU_GLOBAL_TIMER_AUTO_INC  0xF8F00218
+#define APU_FREQ  6
+
+#define PS7_MASK_POLL_TIME 1
+
+/* IO accessors. No memory barriers desired. */
+static inline void iowrite(unsigned long val, unsigned long addr)
+{
+   __raw_writel(val, addr);
+}
+
+static inline unsigned long ioread(unsigned long addr)
+{
+   return __raw_readl(addr);
+}
+
+/* start timer */
+static void perf_start_clock(void)
+{
+   iowrite((1 << 0) | /* Timer Enable */
+   (1 << 3) | /* Auto-increment */
+   (0 << 8), /* Pre-scale */
+   SCU_GLOBAL_TIMER_CONTROL);
+}
+
+/* Compute mask for given delay in miliseconds*/
+static int get_number_of_cycles_for_delay(unsigned int delay)
+{
+   return (APU_FREQ / (2 * 1000)) * delay;
+}
+
+/* stop timer */
+static void perf_disable_clock(void)
+{
+   iowrite(0, SCU_GLOBAL_TIMER_CONTROL);
+}
+
+/* stop timer and reset timer count regs */
+static void perf_reset_clock(void)
+{
+   perf_disable_clock();
+   iowrite(0, SCU_GLOBAL_TIMER_COUNT_L32);
+   iowrite(0, SCU_GLOBAL_TIMER_COUNT_U32);
+}
+
+static void perf_reset_and_start_timer(void)
+{
+   perf_reset_clock();
+   perf_start_clock();
+}
+
+int __weak ps7_config(unsigned long *ps7_config_init)
+{
+   unsigned long *ptr = ps7_config_init;
+   unsigned long opcode;
+   unsigned long addr;
+   unsigned long val;
+   unsigned long mask;
+   unsigned int numargs;
+   int i;
+   int delay;
+
+   for (;;) {
+   opcode = ptr[0];
+   if (opcode == OPCODE_EXIT)
+  

[U-Boot] [PATCH 8/9] arm: zynq: Convert EMIT_WRITE to EMIT_MASKWRITE

2017-11-10 Thread Michal Simek
In case that board ps7_init* files contain EMIT_WRITE convert it to
MASKWRITE because default format has to work only with last two bits.

Signed-off-by: Michal Simek 
---

 arch/arm/mach-zynq/include/mach/ps7_init_gpl.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h 
b/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h
index 0398ba098286..af1d8cb46a71 100644
--- a/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h
+++ b/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h
@@ -22,6 +22,8 @@
 #define EMIT_MASKPOLL(addr, mask)   OPCODE_MASKPOLL | addr, mask
 #define EMIT_MASKDELAY(addr, mask)  OPCODE_MASKDELAY | addr, mask
 
+#define EMIT_WRITE(addr, val)  EMIT_MASKWRITE(addr, 0, val)
+
 /* Returns codes of ps7_init* */
 #define PS7_INIT_SUCCESS   (0)
 #define PS7_INIT_CORRUPT   (1)
-- 
1.9.1

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


[U-Boot] [PATCH 9/9] arm: zynq: Convert all board to use arch ps7_init code

2017-11-10 Thread Michal Simek
Use generic implementation. It will also reduce config data size for
converted boards.

Signed-off-by: Michal Simek 
---

 .../opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c  | 120 +-
 .../opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.h  |  80 -
 board/xilinx/zynq/zynq-microzed/ps7_init_gpl.c | 173 +---
 board/xilinx/zynq/zynq-microzed/ps7_init_gpl.h | 116 --
 board/xilinx/zynq/zynq-zc702/ps7_init_gpl.c| 177 +---
 board/xilinx/zynq/zynq-zc702/ps7_init_gpl.h| 116 --
 board/xilinx/zynq/zynq-zc706/ps7_init_gpl.c| 173 +---
 board/xilinx/zynq/zynq-zc706/ps7_init_gpl.h| 116 --
 board/xilinx/zynq/zynq-zed/ps7_init_gpl.c  | 173 +---
 board/xilinx/zynq/zynq-zed/ps7_init_gpl.h  | 116 --
 board/xilinx/zynq/zynq-zybo/ps7_init_gpl.c | 178 +
 board/xilinx/zynq/zynq-zybo/ps7_init_gpl.h |  97 ---
 12 files changed, 6 insertions(+), 1629 deletions(-)
 delete mode 100644 board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.h
 delete mode 100644 board/xilinx/zynq/zynq-microzed/ps7_init_gpl.h
 delete mode 100644 board/xilinx/zynq/zynq-zc702/ps7_init_gpl.h
 delete mode 100644 board/xilinx/zynq/zynq-zc706/ps7_init_gpl.h
 delete mode 100644 board/xilinx/zynq/zynq-zed/ps7_init_gpl.h
 delete mode 100644 board/xilinx/zynq/zynq-zybo/ps7_init_gpl.h

diff --git a/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c 
b/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c
index 5aa3951b8017..3bd02f3c83ec 100644
--- a/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c
+++ b/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c
@@ -5,8 +5,7 @@
 * SPDX-License-Identifier: GPL-2.0+
  */
 
-#include "ps7_init_gpl.h"
-#include "asm/io.h"
+#include 
 
 unsigned long ps7_pll_init_data_3_0[] = {
EMIT_WRITE(0XF808, 0xDF0DU),
@@ -255,92 +254,11 @@ unsigned long ps7_post_config_3_0[] = {
EMIT_EXIT(),
 };
 
-
 unsigned long ps7_reset_apu_3_0[] = {
EMIT_MASKWRITE(0xF8000244, 0x0022U, 0x0022U),
EMIT_EXIT(),
 };
 
-#define PS7_MASK_POLL_TIME 1
-
-static inline void iowrite(unsigned long val, unsigned long addr)
-{
-   __raw_writel(val, addr);
-}
-
-static inline unsigned long ioread(unsigned long addr)
-{
-   return __raw_readl(addr);
-}
-
-int ps7_config(unsigned long *ps7_config_init)
-{
-   unsigned long *ptr = ps7_config_init;
-
-   unsigned long opcode;   /* current instruction .. */
-   unsigned long args[16]; /* no opcode has so many args ... */
-   int numargs;/* number of arguments of this instruction */
-   int j;  /* general purpose index */
-
-   unsigned long addr;
-   unsigned long val, mask;
-
-   int finish = -1;/* loop while this is negative ! */
-   int i = 0;  /* Timeout variable */
-
-   while (finish < 0) {
-   numargs = ptr[0] & 0xF;
-   opcode = ptr[0] >> 4;
-
-   for (j = 0; j < numargs; j++)
-   args[j] = ptr[j + 1];
-   ptr += numargs + 1;
-
-   switch (opcode) {
-   case OPCODE_EXIT:
-   finish = PS7_INIT_SUCCESS;
-   break;
-
-   case OPCODE_WRITE:
-   addr = args[0];
-   val = args[1];
-   iowrite(val, addr);
-   break;
-
-   case OPCODE_MASKWRITE:
-   addr = args[0];
-   mask = args[1];
-   val = args[2];
-   iowrite((val & mask) | (ioread(addr) & ~mask) , addr);
-   break;
-
-   case OPCODE_MASKPOLL:
-   addr = args[0];
-   mask = args[1];
-   i = 0;
-   while (!(ioread(addr) & mask)) {
-   if (i == PS7_MASK_POLL_TIME) {
-   finish = PS7_INIT_TIMEOUT;
-   break;
-   }
-   i++;
-   }
-   break;
-   case OPCODE_MASKDELAY:
-   addr = args[0];
-   mask = args[1];
-   int delay = get_number_of_cycles_for_delay(mask);
-   perf_reset_and_start_timer();
-   while (ioread(addr) < delay)
-   ;
-   break;
-   default:
-   finish = PS7_INIT_CORRUPT;
-   break;
-   }
-   }
-   return finish;
-}
 
 int ps7_post_config(void)
 {

[U-Boot] [PATCH 4/9] arm: zynq: Move ps7_* to separate file

2017-11-10 Thread Michal Simek
Extract ps7_* from spl code to prepare for extension.
And also return value.

Signed-off-by: Michal Simek 
---

 arch/arm/mach-zynq/Makefile|  2 +-
 arch/arm/mach-zynq/include/mach/ps7_init_gpl.h | 14 +
 arch/arm/mach-zynq/include/mach/sys_proto.h|  4 
 arch/arm/mach-zynq/ps7_spl_init.c  | 27 ++
 arch/arm/mach-zynq/spl.c   | 18 +
 5 files changed, 43 insertions(+), 22 deletions(-)
 create mode 100644 arch/arm/mach-zynq/include/mach/ps7_init_gpl.h
 create mode 100644 arch/arm/mach-zynq/ps7_spl_init.c

diff --git a/arch/arm/mach-zynq/Makefile b/arch/arm/mach-zynq/Makefile
index bf29b4d396d3..e3f0117da563 100644
--- a/arch/arm/mach-zynq/Makefile
+++ b/arch/arm/mach-zynq/Makefile
@@ -15,4 +15,4 @@ obj-y += slcr.o
 obj-y  += clk.o
 obj-y  += lowlevel_init.o
 AFLAGS_lowlevel_init.o := -mfpu=neon
-obj-$(CONFIG_SPL_BUILD)+= spl.o
+obj-$(CONFIG_SPL_BUILD)+= spl.o ps7_spl_init.o
diff --git a/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h 
b/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h
new file mode 100644
index ..6e30108b23f4
--- /dev/null
+++ b/arch/arm/mach-zynq/include/mach/ps7_init_gpl.h
@@ -0,0 +1,14 @@
+/*
+ * (c) Copyright 2010-2017 Xilinx, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _ASM_ARCH_PS7_INIT_GPL_H
+#define _ASM_ARCH_PS7_INIT_GPL_H
+
+/* Called by spl.c */
+int ps7_init(void);
+int ps7_post_config(void);
+
+#endif /* _ASM_ARCH_PS7_INIT_GPL_H */
diff --git a/arch/arm/mach-zynq/include/mach/sys_proto.h 
b/arch/arm/mach-zynq/include/mach/sys_proto.h
index 0ef688309da3..af61352dd110 100644
--- a/arch/arm/mach-zynq/include/mach/sys_proto.h
+++ b/arch/arm/mach-zynq/include/mach/sys_proto.h
@@ -20,8 +20,4 @@ extern unsigned int zynq_get_silicon_version(void);
 
 int zynq_board_read_rom_ethaddr(unsigned char *ethaddr);
 
-/* Driver extern functions */
-extern void ps7_init(void);
-int ps7_post_config(void);
-
 #endif /* _SYS_PROTO_H_ */
diff --git a/arch/arm/mach-zynq/ps7_spl_init.c 
b/arch/arm/mach-zynq/ps7_spl_init.c
new file mode 100644
index ..6adf852578a6
--- /dev/null
+++ b/arch/arm/mach-zynq/ps7_spl_init.c
@@ -0,0 +1,27 @@
+/*
+ * (c) Copyright 2010-2017 Xilinx, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+
+__weak int ps7_init(void)
+{
+   /*
+* This function is overridden by the one in
+* board/xilinx/zynq/(platform)/ps7_init_gpl.c, if it exists.
+*/
+   return 0;
+}
+
+__weak int ps7_post_config(void)
+{
+   /*
+* This function is overridden by the one in
+* board/xilinx/zynq/(platform)/ps7_init_gpl.c, if it exists.
+*/
+   return 0;
+}
diff --git a/arch/arm/mach-zynq/spl.c b/arch/arm/mach-zynq/spl.c
index e8added15567..1672fa05c26a 100644
--- a/arch/arm/mach-zynq/spl.c
+++ b/arch/arm/mach-zynq/spl.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -83,23 +84,6 @@ int spl_start_uboot(void)
 }
 #endif
 
-__weak void ps7_init(void)
-{
-   /*
-* This function is overridden by the one in
-* board/xilinx/zynq/(platform)/ps7_init_gpl.c, if it exists.
-*/
-}
-
-__weak int ps7_post_config(void)
-{
-   /*
-* This function is overridden by the one in
-* board/xilinx/zynq/(platform)/ps7_init_gpl.c, if it exists.
-*/
-   return 0;
-}
-
 void spl_board_prepare_for_boot(void)
 {
ps7_post_config();
-- 
1.9.1

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


[U-Boot] [PATCH 3/9] arm: zynq: Remove ps7_debug code

2017-11-10 Thread Michal Simek
SPL is not calling this code that's why it is dead code and can be
removed.

Signed-off-by: Michal Simek 
---

 .../opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c  |  10 --
 .../opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.h  |   1 -
 board/xilinx/zynq/zynq-microzed/ps7_init_gpl.c | 112 
 board/xilinx/zynq/zynq-microzed/ps7_init_gpl.h |   1 -
 board/xilinx/zynq/zynq-zc702/ps7_init_gpl.c| 112 
 board/xilinx/zynq/zynq-zc702/ps7_init_gpl.h|   1 -
 board/xilinx/zynq/zynq-zc706/ps7_init_gpl.c| 112 
 board/xilinx/zynq/zynq-zc706/ps7_init_gpl.h|   1 -
 board/xilinx/zynq/zynq-zed/ps7_init_gpl.c  | 112 
 board/xilinx/zynq/zynq-zed/ps7_init_gpl.h  |   1 -
 board/xilinx/zynq/zynq-zybo/ps7_init_gpl.c | 114 -
 board/xilinx/zynq/zynq-zybo/ps7_init_gpl.h |   1 -
 12 files changed, 578 deletions(-)

diff --git a/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c 
b/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c
index 7ae04758b7d5..f2a757a5cfeb 100644
--- a/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c
+++ b/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c
@@ -255,12 +255,6 @@ unsigned long ps7_post_config_3_0[] = {
EMIT_EXIT(),
 };
 
-unsigned long ps7_debug_3_0[] = {
-   EMIT_WRITE(0XF8898FB0, 0xC5ACCE55U),
-   EMIT_WRITE(0XF8899FB0, 0xC5ACCE55U),
-   EMIT_WRITE(0XF8809FB0, 0xC5ACCE55U),
-   EMIT_EXIT(),
-};
 
 unsigned long ps7_reset_apu_3_0[] = {
EMIT_MASKWRITE(0xF8000244, 0x0022U, 0x0022U),
@@ -353,10 +347,6 @@ int ps7_post_config(void)
return ps7_config(ps7_post_config_3_0);
 }
 
-int ps7_debug(void)
-{
-   return ps7_config(ps7_debug_3_0);
-}
 
 int ps7_reset_apu(void)
 {
diff --git a/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.h 
b/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.h
index 158c25f3ae9b..ca90bbc5 100644
--- a/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.h
+++ b/board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.h
@@ -69,7 +69,6 @@ extern "C" {
 int ps7_config(unsigned long *);
 int ps7_init(void);
 int ps7_post_config(void);
-int ps7_debug(void);
 
 void perf_start_clock(void);
 void perf_disable_clock(void);
diff --git a/board/xilinx/zynq/zynq-microzed/ps7_init_gpl.c 
b/board/xilinx/zynq/zynq-microzed/ps7_init_gpl.c
index eb290023a1eb..58c31b8a50cf 100644
--- a/board/xilinx/zynq/zynq-microzed/ps7_init_gpl.c
+++ b/board/xilinx/zynq/zynq-microzed/ps7_init_gpl.c
@@ -4121,37 +4121,6 @@ unsigned long ps7_post_config_3_0[] = {
 //
 };
 
-unsigned long ps7_debug_3_0[] = {
-// START: top
-// .. START: CROSS TRIGGER CONFIGURATIONS
-// .. .. START: UNLOCKING CTI REGISTERS
-// .. .. KEY = 0XC5ACCE55
-// .. .. ==> 0XF8898FB0[31:0] = 0xC5ACCE55U
-// .. .. ==> MASK : 0xUVAL : 0xC5ACCE55U
-// .. ..
-EMIT_MASKWRITE(0XF8898FB0, 0xU ,0xC5ACCE55U),
-// .. .. KEY = 0XC5ACCE55
-// .. .. ==> 0XF8899FB0[31:0] = 0xC5ACCE55U
-// .. .. ==> MASK : 0xUVAL : 0xC5ACCE55U
-// .. ..
-EMIT_MASKWRITE(0XF8899FB0, 0xU ,0xC5ACCE55U),
-// .. .. KEY = 0XC5ACCE55
-// .. .. ==> 0XF8809FB0[31:0] = 0xC5ACCE55U
-// .. .. ==> MASK : 0xUVAL : 0xC5ACCE55U
-// .. ..
-EMIT_MASKWRITE(0XF8809FB0, 0xU ,0xC5ACCE55U),
-// .. .. FINISH: UNLOCKING CTI REGISTERS
-// .. .. START: ENABLING CTI MODULES AND CHANNELS
-// .. .. FINISH: ENABLING CTI MODULES AND CHANNELS
-// .. .. START: MAPPING CPU0, CPU1 AND FTM EVENTS TO CTM CHANNELS
-// .. .. FINISH: MAPPING CPU0, CPU1 AND FTM EVENTS TO CTM CHANNELS
-// .. FINISH: CROSS TRIGGER CONFIGURATIONS
-// FINISH: top
-//
-EMIT_EXIT(),
-
-//
-};
 
 unsigned long ps7_pll_init_data_2_0[] = {
 // START: top
@@ -8419,37 +8388,6 @@ unsigned long ps7_post_config_2_0[] = {
 //
 };
 
-unsigned long ps7_debug_2_0[] = {
-// START: top
-// .. START: CROSS TRIGGER CONFIGURATIONS
-// .. .. START: UNLOCKING CTI REGISTERS
-// .. .. KEY = 0XC5ACCE55
-// .. .. ==> 0XF8898FB0[31:0] = 0xC5ACCE55U
-// .. .. ==> MASK : 0xUVAL : 0xC5ACCE55U
-// .. ..
-EMIT_MASKWRITE(0XF8898FB0, 0xU ,0xC5ACCE55U),
-// .. .. KEY = 0XC5ACCE55
-// .. .. ==> 0XF8899FB0[31:0] = 0xC5ACCE55U
-// .. .. ==> MASK : 0xUVAL : 0xC5ACCE55U
-// .. ..
-EMIT_MASKWRITE(0XF8899FB0, 0xU ,0xC5ACCE55U),
-// .. .. KEY = 0XC5ACCE55
-// .. .. ==> 0XF8809FB0[31:0] = 0xC5ACCE55U
-// .. .. ==> MASK : 0xUVAL : 0xC5ACCE55U
-// .. ..
-EMIT_MASKWRITE(0XF8809FB0, 0xU ,0xC5ACCE55U),
-// .. .. FINISH: UNLOCKING CTI REGISTERS
-// .. .. START: ENABLING CTI MODULES AND CHANNELS
-// .. .. FINISH: ENABLING CTI MODULES AND CHANNELS
-// .. .. START: MAPPING CPU0, CPU1 AND FTM 

[U-Boot] [PATCH 2/9] arm: zynq: Enable debug uart on zc706

2017-11-10 Thread Michal Simek
Enable debug uart by default.

Signed-off-by: Michal Simek 
---

 configs/zynq_zc706_defconfig | 5 +
 1 file changed, 5 insertions(+)

diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig
index bc6fe3a30695..52999debc115 100644
--- a/configs/zynq_zc706_defconfig
+++ b/configs/zynq_zc706_defconfig
@@ -3,6 +3,7 @@ CONFIG_SYS_CONFIG_NAME="zynq_zc70x"
 CONFIG_ARCH_ZYNQ=y
 CONFIG_SYS_TEXT_BASE=0x400
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc706"
+CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
@@ -51,6 +52,10 @@ CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_ZYNQ_GEM=y
+CONFIG_DEBUG_UART_ZYNQ=y
+CONFIG_DEBUG_UART_BASE=0xe0001000
+CONFIG_DEBUG_UART_CLOCK=5000
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ZYNQ_SERIAL=y
 CONFIG_ZYNQ_QSPI=y
 CONFIG_USB=y
-- 
1.9.1

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


[U-Boot] [PATCH 1/9] arm: zynq: Add missing ps7_post_config declaration

2017-11-10 Thread Michal Simek
Add missing declaration to header.

Warning log:
arch/arm/mach-zynq/spl.c:94:12: warning: symbol 'ps7_post_config' was
not declared. Should it be static?

Signed-off-by: Michal Simek 
---

 arch/arm/mach-zynq/include/mach/sys_proto.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-zynq/include/mach/sys_proto.h 
b/arch/arm/mach-zynq/include/mach/sys_proto.h
index 67238e7fbcfd..0ef688309da3 100644
--- a/arch/arm/mach-zynq/include/mach/sys_proto.h
+++ b/arch/arm/mach-zynq/include/mach/sys_proto.h
@@ -22,5 +22,6 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr);
 
 /* Driver extern functions */
 extern void ps7_init(void);
+int ps7_post_config(void);
 
 #endif /* _SYS_PROTO_H_ */
-- 
1.9.1

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


[U-Boot] [PATCH 0/9] arm: zynq: ps7* consolidation

2017-11-10 Thread Michal Simek
Hi,

this series is trying to cleanup ps7_init* file that we don't need to
have the same copy of the same functions in different locations.
This work is done based on solution from Topic.nl for miami boards
where format was changed a little bit to save one word in config data
segment.
At the same time older method of simply copying files to particular
folder is still working.
Please test this in your board to make sure I didn't break anything.
I have tested it on zybo/zc702/zc706.

Thanks,
Michal


Michal Simek (9):
  arm: zynq: Add missing ps7_post_config declaration
  arm: zynq: Enable debug uart on zc706
  arm: zynq: Remove ps7_debug code
  arm: zynq: Move ps7_* to separate file
  arm: zynq: Get rid of ps7_reset_apu() for syzygy board
  arm: zynq: Move common ps7_init* initialization to arch code
  arm: zynq: Add ps7GetSiliconVersion() to ps7_spl_init
  arm: zynq: Convert EMIT_WRITE to EMIT_MASKWRITE
  arm: zynq: Convert all board to use arch ps7_init code

 arch/arm/mach-zynq/Makefile|   2 +-
 .../arm/mach-zynq/include/mach}/ps7_init_gpl.h |  14 +
 arch/arm/mach-zynq/include/mach/sys_proto.h|   3 -
 .../arm/mach-zynq/ps7_spl_init.c   |  31 ++-
 arch/arm/mach-zynq/spl.c   |  18 +-
 .../opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.c  | 138 +-
 .../opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.h  |  81 --
 board/topic/zynq/Makefile  |   2 +-
 board/topic/zynq/zynq-topic-miami/ps7_init_gpl.c   |   2 +-
 .../topic/zynq/zynq-topic-miamilite/ps7_init_gpl.c |   2 +-
 .../topic/zynq/zynq-topic-miamiplus/ps7_init_gpl.c |   2 +-
 board/xilinx/zynq/zynq-microzed/ps7_init_gpl.c | 285 +---
 board/xilinx/zynq/zynq-microzed/ps7_init_gpl.h | 117 -
 board/xilinx/zynq/zynq-zc702/ps7_init_gpl.c| 289 +---
 board/xilinx/zynq/zynq-zc702/ps7_init_gpl.h| 117 -
 board/xilinx/zynq/zynq-zc706/ps7_init_gpl.c| 285 +---
 board/xilinx/zynq/zynq-zc706/ps7_init_gpl.h| 117 -
 board/xilinx/zynq/zynq-zed/ps7_init_gpl.c  | 285 +---
 board/xilinx/zynq/zynq-zed/ps7_init_gpl.h  | 117 -
 board/xilinx/zynq/zynq-zybo/ps7_init_gpl.c | 292 +
 board/xilinx/zynq/zynq-zybo/ps7_init_gpl.h |  98 ---
 configs/zynq_zc706_defconfig   |   5 +
 22 files changed, 60 insertions(+), 2242 deletions(-)
 rename {board/topic/zynq => arch/arm/mach-zynq/include/mach}/ps7_init_gpl.h 
(75%)
 rename board/topic/zynq/ps7_init_common.c => arch/arm/mach-zynq/ps7_spl_init.c 
(78%)
 delete mode 100644 board/opalkelly/zynq/zynq-syzygy-hub/ps7_init_gpl.h
 delete mode 100644 board/xilinx/zynq/zynq-microzed/ps7_init_gpl.h
 delete mode 100644 board/xilinx/zynq/zynq-zc702/ps7_init_gpl.h
 delete mode 100644 board/xilinx/zynq/zynq-zc706/ps7_init_gpl.h
 delete mode 100644 board/xilinx/zynq/zynq-zed/ps7_init_gpl.h
 delete mode 100644 board/xilinx/zynq/zynq-zybo/ps7_init_gpl.h

-- 
1.9.1

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


Re: [U-Boot] [U-Boot, 2/3] rockchip: doc: update U-Boot location info

2017-11-10 Thread Dr. Philipp Tomsich
Kever,

> On 10 Nov 2017, at 08:24, Goldschmidt Simon 
>  wrote:
> 
>>> Update rockchip U-Boot location to 0x4000/16384.

At least the location given in the commit message is consistent:
(gdb) p 0x4000
$1 = 16384

>>> Signed-off-by: Kever Yang 
>>> Acked-by: Philipp Tomsich 
>>> Reviewed-by: Philipp Tomsich 
>>> ---
>>> 
>>> doc/README.rockchip | 6 +++---
>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>> 
>> 
>> Applied to u-boot-rockchip, thanks!
> 
> I just found this commit has calculated the size wrong. 16384 blocks should 
> be 8MB, not 4MB.

Could you take a look at this and let us know if this should be changed?
And if it needs a change (and you want it in Monday’s release): please submit a
patch and I’ll try to generate a PR to Tom over the weekend…

Thanks,
Philipp.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] common: Generic file system firmware loader

2017-11-10 Thread Marek Vasut
On 11/10/2017 10:05 AM, Chee, Tien Fong wrote:
> On Kha, 2017-11-09 at 11:31 +0100, Marek Vasut wrote:
>> On 11/09/2017 11:00 AM, Lukasz Majewski wrote:
>>>
>>> On Thu, 9 Nov 2017 08:05:18 +0100
>>> Marek Vasut  wrote:
>>>

 On 11/09/2017 07:04 AM, Chee, Tien Fong wrote:
>
> On Sel, 2017-11-07 at 10:34 +0100, Marek Vasut wrote:  
>>
>> On 11/07/2017 10:03 AM, Chee, Tien Fong wrote:  
>>>
>>>
>>> On Isn, 2017-11-06 at 11:56 +0100, Marek Vasut wrote:  


 On 11/06/2017 05:15 AM, Chee, Tien Fong wrote:  
>
>
>
> On Ahd, 2017-11-05 at 17:43 +0100, Marek Vasut wrote:  
>>
>>
>>
>> On 11/02/2017 09:20 AM, Chee, Tien Fong wrote:  
>>>
>>>
>>>
>>>
>>> On Rab, 2017-11-01 at 10:26 +0100, Marek Vasut
>>> wrote:  




 On 11/01/2017 10:18 AM, tien.fong.c...@intel.com
 wrote:  
>
>
>
>
>
> From: Tien Fong Chee 
>
> Generic firmware loader framework contains some
> common
> functionality
> which is factored out from splash loader. It is
> reusable by
> any
> specific driver file system firmware loader.
> Specific
> driver
> file
> system
> firmware loader handling can be defined with
> both weak
> function
> fsloader_preprocess and fs_loading.
>
> Signed-off-by: Tien Fong Chee  ntel.com  
>>
>>  
> ---
>  common/Makefile   |   1 +
>  common/load_fs.c  | 217
> +++
> +++
>  include/load_fs.h |  38 ++
>  3 files changed, 256 insertions(+)
>  create mode 100644 common/load_fs.c
>  create mode 100644 include/load_fs.h  
 [...]
  
>
>
>
>
>
> +int flash_select_fs_dev(struct flash_location
> *location)  
 Why does everything have flash_ prefix ?
  
>>> I can remove the flash_ prefix, this generic FS
>>> loader
>>> should
>>> support
>>> for all filesystem instead of flash.
>>>  




 I also mentioned the API should copy the linux
 firmware
 loader
 API.
  
>>> If i'm not mistaken, you are referring firmware
>>> loader API
>>> in
>>> this
>>> link https://github.com/torvalds/linux/blob/f007cad
>>> 159e99fa
>>> 2acd
>>> 3b2e
>>> 9364
>>> fbb32ad28b971/drivers/base/firmware_class.c#L1264.
>>>  
> I would like to confirm with you whether we are talking
> to the
> same
> API
> above?  
 https://www.kernel.org/doc/html/v4.13/driver-api/firmware
 /index.h
 tml

 first link on google btw . You might be able to avoid the
 firmware
 structure.
  
>>> After assessment, i found that Linux loader is not suitable
>>> for
>>> fpga
>>> loader as fpga loader need
>>> 1) Able to program FPGA image in SPL chunk bu chunk with
>>> small
>>> memory
>>> allocatted.
>>> 2) Name of FPGA image defined in DTS, and path of FPGA
>>> image in
>>> FAT and
>>> UBI partition.
>>>
>>> Linux loader is strongly designed based on Linux
>>> environment,
>>> always
>>> assume having RFF, env support(which SPL don't have), sysfs
>>> and
>>> udev
>>> feature.  
>> Sigh, you can just have some additional function call to
>> fetch
>> smaller
>> chunks from a file, I don't think it's that hard of a problem
>> ...
>>  
> We already have that function to support smaller chunks, and it
> also
> work for single large image when enough memory is available in
> ver 1
> series of fpga loadfs.
>
> Since the Linux loader API is totally not suitable for fpga
> loadfs,
> and also nothing i can leverage from there for fpga loadfs,
> could
> you please consider to accept implementation for this series
> patches or implementation for fpga loadfs series ver1?  
 You mean going back to completely custom non-generic altera-only
 ad-hoc interface ? I'd like to hear opinion of the others on CC
 ...

>>> I must admit that I don't know the exact Altera API for loading
>>> their

Re: [U-Boot] [PATCH 1/2] common: Generic file system firmware loader

2017-11-10 Thread Chee, Tien Fong
On Kha, 2017-11-09 at 11:31 +0100, Marek Vasut wrote:
> On 11/09/2017 11:00 AM, Lukasz Majewski wrote:
> > 
> > On Thu, 9 Nov 2017 08:05:18 +0100
> > Marek Vasut  wrote:
> > 
> > > 
> > > On 11/09/2017 07:04 AM, Chee, Tien Fong wrote:
> > > > 
> > > > On Sel, 2017-11-07 at 10:34 +0100, Marek Vasut wrote:  
> > > > > 
> > > > > On 11/07/2017 10:03 AM, Chee, Tien Fong wrote:  
> > > > > > 
> > > > > > 
> > > > > > On Isn, 2017-11-06 at 11:56 +0100, Marek Vasut wrote:  
> > > > > > > 
> > > > > > > 
> > > > > > > On 11/06/2017 05:15 AM, Chee, Tien Fong wrote:  
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > On Ahd, 2017-11-05 at 17:43 +0100, Marek Vasut wrote:  
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > On 11/02/2017 09:20 AM, Chee, Tien Fong wrote:  
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > On Rab, 2017-11-01 at 10:26 +0100, Marek Vasut
> > > > > > > > > > wrote:  
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > On 11/01/2017 10:18 AM, tien.fong.c...@intel.com
> > > > > > > > > > > wrote:  
> > > > > > > > > > > > 
> > > > > > > > > > > > 
> > > > > > > > > > > > 
> > > > > > > > > > > > 
> > > > > > > > > > > > 
> > > > > > > > > > > > From: Tien Fong Chee 
> > > > > > > > > > > > 
> > > > > > > > > > > > Generic firmware loader framework contains some
> > > > > > > > > > > > common
> > > > > > > > > > > > functionality
> > > > > > > > > > > > which is factored out from splash loader. It is
> > > > > > > > > > > > reusable by
> > > > > > > > > > > > any
> > > > > > > > > > > > specific driver file system firmware loader.
> > > > > > > > > > > > Specific
> > > > > > > > > > > > driver
> > > > > > > > > > > > file
> > > > > > > > > > > > system
> > > > > > > > > > > > firmware loader handling can be defined with
> > > > > > > > > > > > both weak
> > > > > > > > > > > > function
> > > > > > > > > > > > fsloader_preprocess and fs_loading.
> > > > > > > > > > > > 
> > > > > > > > > > > > Signed-off-by: Tien Fong Chee  > > > > > > > > > > > ntel.com  
> > > > > > > > > > > > > 
> > > > > > > > > > > > >  
> > > > > > > > > > > > ---
> > > > > > > > > > > >  common/Makefile   |   1 +
> > > > > > > > > > > >  common/load_fs.c  | 217
> > > > > > > > > > > > +++
> > > > > > > > > > > > +++
> > > > > > > > > > > >  include/load_fs.h |  38 ++
> > > > > > > > > > > >  3 files changed, 256 insertions(+)
> > > > > > > > > > > >  create mode 100644 common/load_fs.c
> > > > > > > > > > > >  create mode 100644 include/load_fs.h  
> > > > > > > > > > > [...]
> > > > > > > > > > >  
> > > > > > > > > > > > 
> > > > > > > > > > > > 
> > > > > > > > > > > > 
> > > > > > > > > > > > 
> > > > > > > > > > > > 
> > > > > > > > > > > > +int flash_select_fs_dev(struct flash_location
> > > > > > > > > > > > *location)  
> > > > > > > > > > > Why does everything have flash_ prefix ?
> > > > > > > > > > >  
> > > > > > > > > > I can remove the flash_ prefix, this generic FS
> > > > > > > > > > loader
> > > > > > > > > > should
> > > > > > > > > > support
> > > > > > > > > > for all filesystem instead of flash.
> > > > > > > > > >  
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > I also mentioned the API should copy the linux
> > > > > > > > > > > firmware
> > > > > > > > > > > loader
> > > > > > > > > > > API.
> > > > > > > > > > >  
> > > > > > > > > > If i'm not mistaken, you are referring firmware
> > > > > > > > > > loader API
> > > > > > > > > > in
> > > > > > > > > > this
> > > > > > > > > > link https://github.com/torvalds/linux/blob/f007cad
> > > > > > > > > > 159e99fa
> > > > > > > > > > 2acd
> > > > > > > > > > 3b2e
> > > > > > > > > > 9364
> > > > > > > > > > fbb32ad28b971/drivers/base/firmware_class.c#L1264.
> > > > > > > > > >  
> > > > > > > > I would like to confirm with you whether we are talking
> > > > > > > > to the
> > > > > > > > same
> > > > > > > > API
> > > > > > > > above?  
> > > > > > > https://www.kernel.org/doc/html/v4.13/driver-api/firmware
> > > > > > > /index.h
> > > > > > > tml
> > > > > > > 
> > > > > > > first link on google btw . You might be able to avoid the
> > > > > > > firmware
> > > > > > > structure.
> > > > > > >  
> > > > > > After assessment, i found that Linux loader is not suitable
> > > > > > for
> > > > > > fpga
> > > > > > loader as fpga loader need
> > > > > > 1) Able to program FPGA image in SPL chunk bu chunk with
> > > > > > small
> > > > > > memory
> > > > > > allocatted.
> > > > > > 2) Name of FPGA image defined in DTS, and path of FPGA
> > > > > > image in
> > > > > > FAT and
> > > > > > UBI partition.
> > > > > > 
> > > > > > Linux loader is strongly designed based on Linux
> > > > > > environment,
> > > > > > always
> >