[U-Boot] [PATCH] net: Remove Xilinx ll_temac driver

2018-02-15 Thread Michal Simek
ll_temac driver was used by Xilinx Microblaze big endian and
Xilinx ppc405/ppc440 SoCs.

ppc support was removed by: "powerpc: remove 4xx support"
(sha1: 98f705c9cefdfdba62c069821bbba10273a0a8ed)
and Microblaze BE is not tested for a long time that's why this driver
can be removed because none is going to updated it to DM anyway.

Signed-off-by: Michal Simek 
---

Travis build in progress
https://travis-ci.org/michalsimek/u-boot/builds/342228152

---
 drivers/net/Makefile   |   2 -
 drivers/net/xilinx_ll_temac.c  | 394 -
 drivers/net/xilinx_ll_temac.h  | 307 -
 drivers/net/xilinx_ll_temac_fifo.c | 139 -
 drivers/net/xilinx_ll_temac_fifo.h | 118 ---
 drivers/net/xilinx_ll_temac_mdio.c | 177 -
 drivers/net/xilinx_ll_temac_mdio.h |  50 -
 drivers/net/xilinx_ll_temac_sdma.c | 307 -
 drivers/net/xilinx_ll_temac_sdma.h | 266 -
 include/netdev.h   |  10 -
 scripts/config_whitelist.txt   |   1 -
 11 files changed, 1771 deletions(-)
 delete mode 100644 drivers/net/xilinx_ll_temac.c
 delete mode 100644 drivers/net/xilinx_ll_temac.h
 delete mode 100644 drivers/net/xilinx_ll_temac_fifo.c
 delete mode 100644 drivers/net/xilinx_ll_temac_fifo.h
 delete mode 100644 drivers/net/xilinx_ll_temac_mdio.c
 delete mode 100644 drivers/net/xilinx_ll_temac_mdio.h
 delete mode 100644 drivers/net/xilinx_ll_temac_sdma.c
 delete mode 100644 drivers/net/xilinx_ll_temac_sdma.h

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index ac5443c752c2..4a16c62bac09 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -66,8 +66,6 @@ obj-$(CONFIG_ULI526X) += uli526x.o
 obj-$(CONFIG_VSC7385_ENET) += vsc7385.o
 obj-$(CONFIG_XILINX_AXIEMAC) += xilinx_axi_emac.o
 obj-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
-obj-$(CONFIG_XILINX_LL_TEMAC) += xilinx_ll_temac.o xilinx_ll_temac_mdio.o \
-   xilinx_ll_temac_fifo.o xilinx_ll_temac_sdma.o
 obj-$(CONFIG_ZYNQ_GEM) += zynq_gem.o
 obj-$(CONFIG_FSL_MC_ENET) += fsl-mc/
 obj-$(CONFIG_FSL_MC_ENET) += ldpaa_eth/
diff --git a/drivers/net/xilinx_ll_temac.c b/drivers/net/xilinx_ll_temac.c
deleted file mode 100644
index 1e7e2e49af9c..
--- a/drivers/net/xilinx_ll_temac.c
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Xilinx xps_ll_temac ethernet driver for u-boot
- *
- * supports SDMA or FIFO access and MDIO bus communication
- *
- * Copyright (C) 2011 - 2012 Stephan Linz 
- * Copyright (C) 2008 - 2011 Michal Simek 
- * Copyright (C) 2008 - 2011 PetaLogix
- *
- * Based on Yoshio Kashiwagi kashiw...@co-nss.co.jp driver
- * Copyright (C) 2008 Nissin Systems Co.,Ltd.
- * March 2008 created
- *
- * SPDX-License-Identifier:GPL-2.0+
- *
- * [0]: http://www.xilinx.com/support/documentation
- *
- * [S]:[0]/ip_documentation/xps_ll_temac.pdf
- * [A]:[0]/application_notes/xapp1041.pdf
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "xilinx_ll_temac.h"
-#include "xilinx_ll_temac_fifo.h"
-#include "xilinx_ll_temac_sdma.h"
-#include "xilinx_ll_temac_mdio.h"
-
-#if !defined(CONFIG_MII)
-# error "LL_TEMAC requires MII -- missing CONFIG_MII"
-#endif
-
-#if !defined(CONFIG_PHYLIB)
-# error "LL_TEMAC requires PHYLIB -- missing CONFIG_PHYLIB"
-#endif
-
-struct ll_temac_info {
-   int flags;
-   unsigned long   base_addr;
-   unsigned long   ctrl_addr;
-   char*devname;
-   unsigned intphyaddr;
-   char*mdio_busname;
-};
-
-/* Ethernet interface ready status */
-int ll_temac_check_status(struct temac_reg *regs, u32 mask)
-{
-   unsigned timeout = 50;  /* 1usec * 50 = 50usec */
-
-   /*
-* Quote from LL TEMAC documentation: The bits in the RDY
-* register are asserted when there is no access in progress.
-* When an access is in progress, a bit corresponding to the
-* type of access is automatically de-asserted. The bit is
-* automatically re-asserted when the access is complete.
-*/
-   while (timeout && (!(in_be32(>rdy) & mask))) {
-   timeout--;
-   udelay(1);
-   }
-
-   if (!timeout) {
-   printf("%s: Timeout on 0x%08x @%p\n", __func__,
-   mask, >rdy);
-   return 1;
-   }
-
-   return 0;
-}
-
-/*
- * Indirect write to ll_temac.
- *
- * 
http://www.xilinx.com/support/documentation/ip_documentation/xps_ll_temac.pdf
- * page 23, second paragraph, The use of CTL0 register or CTL1 register
- */
-int ll_temac_indirect_set(struct temac_reg *regs, u16 regn, u32 reg_data)
-{
-   out_be32(>lsw, (reg_data & MLSW_MASK));
-   out_be32(>ctl, CTL_WEN | (regn & CTL_ADDR_MASK));
-
-   if (ll_temac_check_status(regs, 

[U-Boot] [PATCH] arm64: zynqmp: Add support to load an app at EL1

2018-02-15 Thread Michal Simek
From: Nitin Jain 

This patch is adding support to switch to EL1 while loading an EL1
application with u-boot running at EL above EL1 in aarch64 mode.

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

 board/xilinx/zynqmp/zynqmp.c | 17 +
 include/command.h|  2 ++
 2 files changed, 19 insertions(+)

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index ff0b3c75f533..b9825ddaa881 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -316,6 +316,23 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
return 0;
 }
 
+unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
+char * const argv[])
+{
+   int ret = 0;
+
+   if (current_el() > 1) {
+   smp_kick_all_cpus();
+   dcache_disable();
+   armv8_switch_to_el1(0x0, 0, 0, 0, (unsigned long)entry,
+   ES_TO_AARCH64);
+   } else {
+   printf("FAIL: current EL is not above EL1\n");
+   ret = EINVAL;
+   }
+   return ret;
+}
+
 #if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE)
 int dram_init_banksize(void)
 {
diff --git a/include/command.h b/include/command.h
index 767cabb3df09..56499b8ad5ca 100644
--- a/include/command.h
+++ b/include/command.h
@@ -111,6 +111,8 @@ extern int common_diskboot(cmd_tbl_t *cmdtp, const char 
*intf, int argc,
 extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 extern int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
argv[]);
 
+extern unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
+   char * const argv[]);
 /*
  * Error codes that commands return to cmd_process(). We use the standard 0
  * and 1 for success and failure, but add one more case - failure with a
-- 
1.9.1

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


Re: [U-Boot] [RESEND PATCH 2/2] net: designware: add clock support

2018-02-15 Thread Jonathan Gray
On Wed, Nov 29, 2017 at 09:06:11AM +0100, patrice.chot...@st.com wrote:
> From: Patrice Chotard 
> 
> This implementation manages several clocks, disable and
> free all of them in case of error during probe and in remove
> callback.
> 
> Signed-off-by: Patrice Chotard 
> ---
>  drivers/net/designware.c | 43 +++
>  drivers/net/designware.h |  4 
>  2 files changed, 47 insertions(+)

RK3288 Ethernet on the ASUS Tinker Board fails to probe with master
(32fe36574ea5e6ea55313e16547b98a984af7767) but worked with 2018.01.

ba1f966725223c605ed504b09446c52a3f201c2b is the first bad commit
commit ba1f966725223c605ed504b09446c52a3f201c2b
Author: Patrice Chotard 
Date:   Wed Nov 29 09:06:11 2017 +0100

net: designware: add clock support

This implementation manages several clocks, disable and
free all of them in case of error during probe and in remove
callback.

Signed-off-by: Patrice Chotard 
Reviewed-by: Simon Glass 
Acked-by: Joe Hershberger 

:04 04 6f1002af4c0f3ed7ab6f2418d4f2de00bbe454a7 
e18d2a6c24cbfd055c89fa250946bf85199fff90 M  drivers

U-Boot 2018.03-rc2-00047-gc1531533c5 (Feb 16 2018 - 15:38:39 +1100)

Model: Tinker-RK3288
DRAM:  2 GiB
MMC:   dwmmc@ff0c: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment

Failed (-5)
In:serial
Out:   serial
Err:   serial
Model: Tinker-RK3288
Net:   failed to enable clock 0
No ethernet found.
Hit any key to stop autoboot:  0
=> dm tree
 Class  Probed  Driver  Name

 root   [ + ]   root_drive  root_driver
 clk[   ]   fixed_rate  |-- oscillator
 mmc[ + ]   rockchip_r  |-- dwmmc@ff0c
 blk[ + ]   mmc_blk |   `-- dw...@ff0c.blk
 adc[ + ]   rockchip_s  |-- saradc@ff10
 i2c[   ]   i2c_rockch  |-- i2c@ff17
 serial [   ]   ns16550_se  |-- serial@ff18
 serial [   ]   ns16550_se  |-- serial@ff19
 serial [ + ]   ns16550_se  |-- serial@ff69
 serial [   ]   ns16550_se  |-- serial@ff1b
 serial [   ]   ns16550_se  |-- serial@ff1c
 eth[   ]   gmac_rockc  |-- ethernet@ff29
 usb[   ]   dwc2_usb|-- usb@ff54
 usb[   ]   dwc2_usb|-- usb@ff58
 ram[   ]   rockchip_r  |-- dmc@ff61
 i2c[ + ]   i2c_rockch  |-- i2c@ff65
 pmic   [ + ]   rk8xx pmic  |   `-- pmic@1b
 regulator  [   ]   rk8xx_buck  |   |-- DCDC_REG1
 regulator  [   ]   rk8xx_buck  |   |-- DCDC_REG2
 regulator  [   ]   rk8xx_buck  |   |-- DCDC_REG3
 regulator  [   ]   rk8xx_buck  |   |-- DCDC_REG4
 regulator  [   ]   rk8xx_ldo   |   |-- LDO_REG1
 regulator  [   ]   rk8xx_ldo   |   |-- LDO_REG2
 regulator  [   ]   rk8xx_ldo   |   |-- LDO_REG3
 regulator  [   ]   rk8xx_ldo   |   |-- LDO_REG4
 regulator  [ + ]   rk8xx_ldo   |   |-- LDO_REG5
 regulator  [   ]   rk8xx_ldo   |   |-- LDO_REG6
 regulator  [   ]   rk8xx_ldo   |   |-- LDO_REG7
 regulator  [   ]   rk8xx_ldo   |   |-- LDO_REG8
 regulator  [   ]   rk8xx_swit  |   |-- SWITCH_REG1
 regulator  [   ]   rk8xx_swit  |   `-- SWITCH_REG2
 i2c[ + ]   i2c_rockch  |-- i2c@ff66
 i2c_eeprom [ + ]   i2c_eeprom  |   `-- m24c08@50
 pwm[   ]   rk_pwm  |-- pwm@ff68
 pwm[   ]   rk_pwm  |-- pwm@ff680010
 syscon [ + ]   rk3288_sys  |-- power-management@ff73
 syscon [   ]   rk3288_sys  |-- syscon@ff74
 clk[ + ]   rockchip_r  |-- clock-controller@ff76
 sysreset   [   ]   rockchip_s  |   `-- sysreset
 syscon [ + ]   rk3288_sys  |-- syscon@ff77
 syscon [   ]   rk3288_sys  |-- syscon@ffac
 pinctrl[ + ]   rockchip_r  |-- pinctrl
 gpio   [   ]   gpio_rockc  |   |-- gpio0@ff75
 gpio   [   ]   gpio_rockc  |   |-- gpio1@ff78
 gpio   [   ]   gpio_rockc  |   |-- gpio2@ff79
 gpio   [   ]   gpio_rockc  |   |-- gpio3@ff7a
 gpio   [ + ]   gpio_rockc  |   |-- gpio4@ff7b
 gpio   [   ]   gpio_rockc  |   |-- gpio5@ff7c
 gpio   [   ]   gpio_rockc  |   |-- gpio6@ff7d
 gpio   [ + ]   gpio_rockc  |   |-- gpio7@ff7e
 gpio   [   ]   gpio_rockc  |   |-- gpio8@ff7f
 pinconfig  [   ]   pinconfig   |   |-- pcfg-pull-up
 pinconfig  [   ]   pinconfig   |   |-- pcfg-pull-down
 pinconfig  [   ]   pinconfig   |   |-- pcfg-pull-none
 pinconfig  [   ]   pinconfig   |   |-- pcfg-pull-none-12ma
 pinconfig  [ + ]   pinconfig   |   |-- sleep
 pinconfig  [ + ]   pinconfig   |   |   |-- global-pwroff
 pinconfig  [   ]   pinconfig   |   |   |-- ddrio-pwroff
 pinconfig  [   ]   pinconfig   |   |   |-- ddr0-retention
 pinconfig  [   ]   pinconfig   |   |   `-- ddr1-retention
 pinconfig  [ + ]   pinconfig   |   |-- i2c0
 pinconfig  [ + ]   pinconfig   | 

Re: [U-Boot] How to test new bootloaders on Jetson TX1? - ATF

2018-02-15 Thread Varun Wadekar
Yes. That's a custom SMC we have for some non-L4T uses. It has not been 
upstreamed yet.

You can add dummy handling in tegra_sip_calls.c to move forward.


From: Andreas Färber 
Sent: Thursday, February 15, 2018 7:04 PM
To: Varun Wadekar
Cc: Tom Warren; Jonathan Hunter; linux-te...@vger.kernel.org; U-Boot; Alexander 
Graf; Mian Yousaf Kaukab
Subject: Re: How to test new bootloaders on Jetson TX1? - ATF

Hi Varun,

Am 15.02.2018 um 17:57 schrieb Varun Wadekar:
> Andreas, can you try the TOS packaging script available in our public repo?
>
> http://nv-tegra.nvidia.com/gitweb/?p=3rdparty/ote_partner/tlk.git;a=blob;f=tools/gen_tos_part_img.py;h=47828f7028e56a6cffb9b773502b13dc431a015e;hb=HEAD

Great, that script does work. It is lacking usage output, but looking at
the code, its arguments were self-documenting.

> Please let me know if this does not work for you.
>
> For the upstream ATF code, our downstream has not caught up with upstream 
> yet, so I am not sure if upstream would directly work for TX1. But its 
> definitely worth a try.

I tried R28.1 flash.sh -k TOS with my ATF v1.4 with Spectre backports,
without SPD. BL31 appears to initialize okay, but later something runs
into an unhandled SMC 0x8215 - things then go south and it doesn't
reach the Nvidia U-Boot. Serial log attached.

According to
https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/arm-sip-service.rst
that SMC function ID falls into the SiP range, so indeed something
Nvidia-specific missing in v1.4?

Regards,
Andreas

https://build.opensuse.org/package/show/hardware:boot/arm-trusted-firmware-tegra210

--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] How to test new bootloaders on Jetson TX1? - ATF

2018-02-15 Thread Andreas Färber
Hi Varun,

Am 15.02.2018 um 17:57 schrieb Varun Wadekar:
> Andreas, can you try the TOS packaging script available in our public repo?
> 
> http://nv-tegra.nvidia.com/gitweb/?p=3rdparty/ote_partner/tlk.git;a=blob;f=tools/gen_tos_part_img.py;h=47828f7028e56a6cffb9b773502b13dc431a015e;hb=HEAD

Great, that script does work. It is lacking usage output, but looking at
the code, its arguments were self-documenting.

> Please let me know if this does not work for you.
> 
> For the upstream ATF code, our downstream has not caught up with upstream 
> yet, so I am not sure if upstream would directly work for TX1. But its 
> definitely worth a try.

I tried R28.1 flash.sh -k TOS with my ATF v1.4 with Spectre backports,
without SPD. BL31 appears to initialize okay, but later something runs
into an unhandled SMC 0x8215 - things then go south and it doesn't
reach the Nvidia U-Boot. Serial log attached.

According to
https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/arm-sip-service.rst
that SMC function ID falls into the SiP range, so indeed something
Nvidia-specific missing in v1.4?

Regards,
Andreas

https://build.opensuse.org/package/show/hardware:boot/arm-trusted-firmware-tegra210

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
[.120] [TegraBoot] (version 00.00.2014.50-mobile-d44d4bf0)
[.125] Processing in cold boot mode Bootloader 2
[.130] A02 Bootrom Patch rev = 63
[.133] Power-up reason: reset button
[.137] No Battery Present
[.139] RamCode = 0
[.142] Platform has Ddr4 type ram
[.145] max77620 disabling SD1 Remote Sense
[.149] Setting Ddr voltage to 1125mv
[.153] Serial Number of Pmic Max77663: 0x1417b9
[.161] Entering ramdump check
[.164] Get RamDumpCarveOut = 0xff23f000
[.168] RamDumpCarveOut=0xff23f000,  RamDumperFlag=0x0
[.173] Last reboot was clean, booting normally!
[.178] Sdram initialization is successful 
[.182] SecureOs Carveout Base=0xff80 Size=0x0080
[.187] GSC1 Carveout Base=0xff70 Size=0x0010
[.192] GSC2 Carveout Base=0xff60 Size=0x0010
[.197] GSC3 Carveout Base=0xff50 Size=0x0010
[.203] GSC4 Carveout Base=0xff40 Size=0x0010
[.208] GSC5 Carveout Base=0xff30 Size=0x0010
[.213] BpmpFw Carveout Base=0xff2c Size=0x0004
[.218] Lp0 Carveout Base=0xff2bf000 Size=0x1000
[.234] RamDump Carveout Base=0xff23f000 Size=0x0008
[.239] Platform-DebugCarveout: 0
[.242] Nck Carveout Base=0xff03f000 Size=0x0020
[.247] Non secure mode, and RB not enabled.
[.277] Using GPT Primary to query partitions 
[.282] Loading Tboot-CPU binary
[.331] Verifying bootloader in OdmNonSecureSBK mode
[.341] Bootloader load address is 0xa000, entry address is 0xa258
[.348] Bootloader downloaded successfully.
[.352] Downloaded Tboot-CPU binary to 0xa258
[.357] MAX77620_GPIO1 Configured.
[.361] MAX77620_GPIO5 Configured.
[.364] CPU power rail is up
[.367] CPU clock enabled
[.371] Performing RAM repair
[.374] Updating A64 Warmreset Address to 0xa2e9
[.402] Bootloader DTB Load Address: 0x8300
[.430] Kernel DTB Load Address: 0x8310
[.435] Loading cboot binary
[.529] Verifying bootloader in OdmNonSecureSBK mode
[.567] Bootloader load address is 0x92c0, entry address is 0x92c00258
[.574] Bootloader downloaded successfully.
[.578] GPT: Partition NOT found ! 
[.582] Find Partition via GPT Failed
[.585] Find Partition via PT Failed
[.589] function NvTbootGetBinaryOffsets: 0x1 error
[.594] Error in NvTbootLoadBinary: 0x1 !
[.598] Next binary entry address: 0x92c00258 
[.602] BoardId: 2180
[.607] dram memory type is 3
[.611] WB0 init successful
[.637] Bpmp FW successfully loaded
[.640] Set NvDecSticky Bits
[.644] GSC1 address : ff70
[.647] GSC2 address ff63fffc value c0edbbcc
[.652] GSC2 address : ff60
[.656] GSC3 address : ff50
[.659] GSC4 address : ff40
[.663] GSC5 address : ff30
[.666] GSC MC Settings done
[.670] TOS old plaintext Image length 41168
[.675] *** Secure OS image signature not verified ***
[.681] Loading and Validation of Secure OS Successful
[.686] NvTbootPackSdramParams: start. 
[.691] NvTbootPackSdramParams: done. 
[.694] Tegraboot started after 98254 us
[.698] Basic modules init took 290274 us
[.702] Sec Bootdevice Read Time = 216 ms, Read Size = 9488 KB
[.708] Sec Bootdevice Write Time = -1940251271 ms, Write Size = -68719477 KB
[.715] Next stage binary read took 23772 us
[.720] Carveout took 207065 us
[.723] CPU initialization took 92193 us
[.727] Total time taken by TegraBoot 613304 us

[.731] Starting CPU & Halting co-processor 

64INFO:Configuring TrustZone DRAM Memory Carveout
INFO:BL3-1: 

Re: [U-Boot] [PATCH 1/8] Merge CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMIT

2018-02-15 Thread Heinrich Schuchardt
On 02/11/2018 08:08 PM, Lukasz Majewski wrote:
> On Sun, 11 Feb 2018 12:06:46 +
> Alex Kiernan  wrote:
> 
>> CONFIG_BOOTCOUNT was only used in mx53ppd, merge it with
>> CONFIG_BOOTCOUNT_LIMIT
>>
>> Signed-off-by: Alex Kiernan 
>> ---
>>
>>  configs/mx53ppd_defconfig | 1 -
>>  drivers/bootcount/Kconfig | 9 +
>>  2 files changed, 1 insertion(+), 9 deletions(-)
>>
>> diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
>> index b83cf72..d6a1c6a 100644
>> --- a/configs/mx53ppd_defconfig
>> +++ b/configs/mx53ppd_defconfig
>> @@ -20,7 +20,6 @@ CONFIG_CMD_EXT4=y
>>  CONFIG_CMD_EXT4_WRITE=y
>>  CONFIG_CMD_FAT=y
>>  CONFIG_CMD_FS_GENERIC=y
>> -CONFIG_BOOTCOUNT=y
>>  CONFIG_BOOTCOUNT_LIMIT=y
>>  CONFIG_BOOTCOUNT_EXT=y
>>  CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5"
>> diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
>> index d82289f..da2ccab 100644
>> --- a/drivers/bootcount/Kconfig
>> +++ b/drivers/bootcount/Kconfig
>> @@ -4,13 +4,6 @@
>>  
>>  menu "Boot count support"
>>  
>> -config BOOTCOUNT
>> -bool "Enable Boot count support"
>> -help
>> -  Enable boot count support, which provides the ability to
>> store the
>> -  number of times the board has booted on a number of
>> different
>> -  persistent storage mediums.
>> -
>>  config BOOTCOUNT_LIMIT
>>  bool "Enable support for checking boot count limit"
>>  help
>> @@ -23,7 +16,7 @@ config SYS_BOOTCOUNT_SINGLEWORD
>>This option enables packing boot count magic value and
>> boot count into single word (32 bits).
>>  
>> -if BOOTCOUNT
>> +if BOOTCOUNT_LIMIT
>>  
>>  config BOOTCOUNT_EXT
>>  bool "Boot counter on EXT filesystem"

Please, have a look at SYS_BOOTCOUNT_SINGLEWORD.
It is only used in drivers/bootcount/bootcount.c.
drivers/bootcount/bootcount.c is only compiled if BOOTCOUNT_LIMIT is
enabled.

So with your patch it should depend on BOOTCOUNT_LIMIT.

Regards

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


Re: [U-Boot] How to test new bootloaders on Jetson TX1?

2018-02-15 Thread Stephen Warren

On 02/14/2018 06:51 PM, Andreas Färber wrote:

Hello,

I would like to test the latest version of U-Boot on the Jetson TX1.

Unfortunately U-Boot is lacking a README that would explain how to do that:

> ...

Here is some consolidated background on U-Boot on TX1:

In all cases, U-Boot uses a built-in DTB for its own driver 
initialization and other operation.


In T124 and earlier, it was possible to have a completely OSS boot 
process. So, U-Boot could be the only bootloader. In this case, part of 
U-Boot (the SPL) would run on the ARM7/AVP/COP, and part on the main CPU 
(CCPLEX). Details of all that are at:


https://http.download.nvidia.com/tegra-public-appnotes/index.html

With T210, the boot logic that runs on the ARM7/AVP/BPMP-Lite became 
more complex, so we elected to drop the U-Boot SPL and re-use the NVIDIA 
binary bootloader for the AVP/BPMP-Lite portion to avoid re-implementing 
it, leaving U-Boot to run solely on the CCPLEX, and dropping usage of 
U-Boot SPL.


In L4T r24 and earlier, U-Boot was 99.9% of the boot code that ran at 
EL2 or lower on the CCPLEX (ATF - ARM Trusted Firmware - would run at 
EL3). In this case, the other 0.1% of the code running at EL2 runs 
before U-Boot and passes to U-Boot some parameter block with details 
such as memory size, carveouts, etc. The L4T r24 T210 port of U-Boot 
parses this parameter block to determine RAM size, carveout size, etc., 
so is closely tied to this boot model. The upstream T210 port (as of 
today at least) ignores the parameter block, determines RAM size from HW 
registers, and hard-codes some overly-large carveout size to avoid 
trampling any carveout. In this r24 boot model, U-Boot (L4T downstream 
or upstream) loads a DTB from disk, does a little manipulation of it 
(e.g. fills in RAM size, kernel command-line), and passes it a kernel 
that it loads from disk.


With L4T r24, you can use the script bootloader/exec-uboot.sh to load 
and run a new U-Boot over the USB port's recovery protocol, without 
writing anything to flash. This is what my automated upstream U-Boot 
tester does for usptream branches for T210.


I won't discuss L4T r25/r26 since they weren't broadly distributed and 
had slightly different boot models, and discussing them would just be 
confusing.


With L4T r28, we aligned the T210 and T186 boot models. Now, cboot (an 
NVIDIA binary bootloader) always runs on the CCPLEX at EL2 (ATF still 
runs EL3) and performs most general system setup. cboot loads the 
"kernel" from a dedicated partition (which contains no filesystem). This 
kernel could actually be a Linux kernel, but L4T typically places U-Boot 
into this partition and hence chain-loads it. In this model, U-Boot 
receives a DTB from cboot, which is parsed by U-Boot to determine RAM 
size, carveout size, etc. For L4T, U-Boot passes this same DTB on to 
whatever kernel it loads and boots (with a couple minor modifications 
such as over-writing RAM size and kernel command-line). The advantage of 
passing on the DTB is that any DTB edits performed by cboot don't need 
to be re-implemnted by U-Boot. For upstream, people typically (always?) 
have U-Boot load a different DTB to pass to the kernel, since the DTB 
that cboot uses-and-passes-on must use some downstream-specific DT 
bindings/schema that are not appropriate to pass to an upstream kernel 
that uses upstream DT bindings. Only downstream L4T r28 U-Boot supports 
this boot model; upstream U-Boot is not written to accept and parse a 
DTB at runtime. You can control whether U-Boot passes on the DTB or 
loads a new one by (a) extlinux.conf: include a DTB statement or not, 
(b) in other scripts, by either loading a DTB in the script and passing 
that address to booti or passing the address of the cboot-supplied DTB 
to booti; U-Boot sets a variable to point to the cboot-supplied DTB 
making this easy. When running L4T r28, if you want update U-Boot, 
you'll need to flash the kernel partition (T210: LNX, T186: kernel) 
since that's where U-Boot is stored. Obviously L4T's r28 U-Boot release 
works with this model. I'd actually expect upstream to do so too, 
although that combination isn't actually tested; my automated upstream 
U-Boot tester still uses L4T r24 since that boot process is what the 
upstream T210 port was originally developed against. This may change if 
we switch upstream U-Boot to the new boot style.


With L4T r28, there is no bootloader/exec-uboot.sh script, so you must 
write any updated U-Boot to flash in order to test it.


For T186, this new boot model was all we ever supported; cboot is always 
used, U-Boot if uses is stored in the kernel partition, and upstream 
T186 U-Boot only supports the new L4T r28 boot model.


ATF and optionally a secure OS are part of "tos.img" in the L4T release, 
which gets flashed to the TOS partition on T210 and secure-os partition 
on T186. As Varun mentioned, there's a header format for this partition 
and you can use the script he linked in order to generate the 

Re: [U-Boot] [PATCH 0/2] Add fix for Pine64 gigabit throughput issues

2018-02-15 Thread Kyle Evans
On Thu, Feb 15, 2018 at 3:32 PM, André Przywara  wrote:
> Hi,
>
> thanks for picking this up!
>
> (CC:ing Icenowy, who was engaged in a Linux fix for this issue last year
> [2][3]. It's Chinese New Year though, so not sure how quickly she will
> answer).
>
> On 14/02/18 23:02, kev...@freebsd.org wrote:
>> The Pine64 has a known issue on gigabit links (see [1]); some boards suffer
>> significant packet loss on Gigabit links.
>
> Do you have a faulty board at hand? What is the actual effect in U-Boot?
> IIRC the bug "just" causes a slower connection in Gigabit mode, I am not
> sure we care so much in U-Boot? Or is it actually packages dropped,
> which is much more annoying without TCP covering up for this?

I do. =) My board in particular sees 60-70% packet loss without this,
making netboot incredibly unreliable.

>
>> This patch sets the magical bits
>> in CONFREG on the RTL8211E PHY to turn off the internal delay and do some 
>> other
>> undocumented stuff.
>
> So if I remember the discussion correctly, this workaround affects the
> performance of the "good" boards. Have you checked this?
> There was a discussion last year [2][3] about how to fix this in Linux,
> which definitely involved some DT property (ideally in the PHY node).
> This would allow people to turn this on and off depending on their
> particular board.
> I am not sure this discussion lead anywhere, though, it might be a good
> idea to warm this up again.
>

Unfortunately, I do not have a good board to test with, so I've no
idea what it ends up doing to performance. for them.

I think rgmii-txid is actually not right for this. As an aside, I've
pulled this value from [1]. The value they ended up going with (as
seen in this patch and in [1]) turns off both TXID and RXID (IIRC,
from the realtek documentation for this PHY), leaving us with just
plain ol' "rgmii" with no internal delay at all. [1] also applies it
unconditionally for pine64.

[1] 
https://github.com/longsleep/linux-pine64/commit/ffe3ca5be7682bbeb0fdadede29acd4a3c888015
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 0/2] Add fix for Pine64 gigabit throughput issues

2018-02-15 Thread André Przywara
Hi,

thanks for picking this up!

(CC:ing Icenowy, who was engaged in a Linux fix for this issue last year
[2][3]. It's Chinese New Year though, so not sure how quickly she will
answer).

On 14/02/18 23:02, kev...@freebsd.org wrote:
> The Pine64 has a known issue on gigabit links (see [1]); some boards suffer
> significant packet loss on Gigabit links.

Do you have a faulty board at hand? What is the actual effect in U-Boot?
IIRC the bug "just" causes a slower connection in Gigabit mode, I am not
sure we care so much in U-Boot? Or is it actually packages dropped,
which is much more annoying without TCP covering up for this?

> This patch sets the magical bits
> in CONFREG on the RTL8211E PHY to turn off the internal delay and do some 
> other
> undocumented stuff.

So if I remember the discussion correctly, this workaround affects the
performance of the "good" boards. Have you checked this?
There was a discussion last year [2][3] about how to fix this in Linux,
which definitely involved some DT property (ideally in the PHY node).
This would allow people to turn this on and off depending on their
particular board.
I am not sure this discussion lead anywhere, though, it might be a good
idea to warm this up again.

Cheers,
Andre.

[2] https://marc.info/?l=devicetree=149281711105621
[3] https://marc.info/?l=linux-netdev=150337466923103

> [1] https://forum.pine64.org/showthread.php?tid=835=19704#pid19704
> 
> Kyle Evans (2):
>   net: phy: Add PHY_RTL8211E_PINE64_GIGABIT_FIX for realtek phys
>   Configs: Use the newly added PHY_RTL8211E_PINE64_GIGABIT_FIX
> 
>  configs/pine64_plus_defconfig |  2 ++
>  drivers/net/phy/Kconfig   | 10 ++
>  drivers/net/phy/realtek.c | 34 ++
>  3 files changed, 46 insertions(+)
> 

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


Re: [U-Boot] [PATCH] mmc: Fix uninitialised priv member

2018-02-15 Thread Sam Protsenko
On 9 February 2018 at 17:24, Alex Kiernan  wrote:
> When using omap_hsmmc without the device model then the allocation
> of mmc->priv ends up uninitialised.
>
> Signed-off-by: Alex Kiernan 

Reviewed-by: Sam Protsenko 

A good one, thanks!

> ---
> I've a board (AM335xx based) which boots fine with 2018-01, with
> 2018-03-rc1 (actually 1811a92) it fails in the MLO:
>
>   U-Boot SPL 2018.03-rc1-00222-g128a503-dirty (Feb 09 2018 - 11:51:50 +)
>   Trying to boot from MMC2
>   omap_hsmmc_send_cmd : DMA timeout: No status update
>   mmc_init: -110, time 1026
>   spl: mmc init failed with error: -110
>   SPL: failed to boot from all boot devices
>   ### ERROR ### Please RESET the board ###
>
> Bisecting it out, it's this commit:
>
>   f0d53e8 mmc: omap_hsmmc: Add support for DMA (ADMA2)
>
>  drivers/mmc/omap_hsmmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
> index b12d6d9..c6b3f25 100644
> --- a/drivers/mmc/omap_hsmmc.c
> +++ b/drivers/mmc/omap_hsmmc.c
> @@ -918,7 +918,7 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, 
> uint f_max, int cd_gpio,
> struct mmc_config *cfg;
> uint host_caps_val;
>
> -   priv = malloc(sizeof(*priv));
> +   priv = calloc(1, sizeof(*priv));
> if (priv == NULL)
> return -1;
>
> --
> 2.7.4
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] mmc: Fix uninitialised priv member

2018-02-15 Thread Robert Nelson
On Fri, Feb 9, 2018 at 9:24 AM, Alex Kiernan  wrote:
> When using omap_hsmmc without the device model then the allocation
> of mmc->priv ends up uninitialised.
>
> Signed-off-by: Alex Kiernan 

Awesome!

This fixes: am335x_boneblack_defconfig

Tested-by: Robert Nelson 

Regards,

-- 
Robert Nelson
https://rcn-ee.com/
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] serial: Make full device search optional

2018-02-15 Thread Alexander Graf


On 15.02.18 18:02, Derald Woods wrote:
> 
> 
> On Feb 15, 2018 9:00 AM, "Alexander Graf"  > wrote:
> 
> 
> 
> On 13.02.18 01:00, Derald Woods wrote:
> > On Mon, Feb 5, 2018 at 7:13 AM, Derald Woods
> 
> >  >> wrote:
> >
> >     On Mon, Feb 5, 2018 at 3:42 AM, Alexander Graf  
> >     >>wrote:
> >
> >
> >
> >         On 05.02.18 01:39, Derald Woods wrote:
> >         > On Tue, Jan 30, 2018 at 7:34 AM, Alexander Graf
>   >
> >         > 
>  >         >
> >         >     On 01/30/2018 02:09 PM, Derald Woods wrote:
> >         >
> >         >         On Jan 30, 2018 3:17 AM, "Alexander Graf"
>   >
> >         >         
> >>
> >         
> >
> >         >         
>  wrote:
> >         >
> >         >             On 01/30/2018 12:41 AM, Derald D. Woods wrote:
> >         >
> >         >                 On Mon, Jan 29, 2018 at 07:46:09AM
> -0600, Derald Woods
> >         >         wrote:
> >         >
> >         >                     On Jan 29, 2018 6:57 AM, "Alexander
> Graf"
> >         >         
> >  
> >         >>
> >         >                       >
> 
> >          wrote:
> >         >
> >         >                     Commit 608b0c4ad4e5ec0c ("serial:
> Use next serial device
> >         >                     if probing fails")
> >         >                     added code to search for more serial
> devices if the
> >         >                     default one was not
> >         >                     probed correctly.
> >         >
> >         >                     Unfortunately, that breaks
> omap3_evm. So while
> >         >                     investigating why that is
> >         >                     the case, let's disable the full
> search for everyone but
> >         >                     bcm283x where it
> >         >                     is needed.
> >         >
> >         >                     Fixes: 608b0c4ad4e5ec0c ("serial:
> Use next serial device
> >         >                     if probing fails")
> >         >                     Reported-by: Derald D. Woods
> >         >            >
> >          
> >          >>
> >         >                      
> >          >
> >         >            
> >         >                     Signed-off-by: Alexander Graf
>   >
> >         >         
> >>
> >         >                      
> >         >
> 
> >         
> >         >
> >         >                     ---
> >         >
> >         >                     Derald, could you please test this patch
> >         and verify it
> >         >                     does indeed unbreak
> >         >                    

Re: [U-Boot] Please pull ARC changes

2018-02-15 Thread Tom Rini
On Thu, Feb 15, 2018 at 12:53:52PM +, Alexey Brodkin wrote:

> Hi Tom,
> 
> This is just a quite subtle fix that allows to use Elf32 toolchain
> for building U-Boot so I do believe it qualifies for the next RC and
> some technical background below.
> 
> For quite some time we used to use uClibc toolchain for building U-Boot
> just because it was our default toolchain. But when I tried to use
> pre-built toolchain from kernel.org for example this one:
> https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/7.3.0/x86_64-gcc-7.3.0-nolibc_arc-elf.tar.gz
> 
> I bumped into a trivial problem which is solved now.
> That said recent kernel.org toolchains could be used for ARC once
> buildman switches to them.
> 
> Anyways...
> 
> The following changes since commit 0c502b6c176281a096a23803e517b19e964485f1:
> 
>   configs: Resync with savedefconfig (2018-02-14 21:34:50 -0500)
> 
> are available in the Git repository at:
> 
>   git://git.denx.de/u-boot-arc.git 
> 
> for you to fetch changes up to d53b128df40d8b2f5dd87cac194163fca2bc17ed:
> 
>   arc: Fix final linkage with Elf32 tools (2018-02-15 15:44:47 +0300)
> 

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 v3] imx: spl: Partially revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Fabio Estevam
Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak spl_boot_mode()
function") breaks the boot on several i.MX6 boards,
such as cuboxi and wandboard:

U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33 +1300)
Trying to boot from MMC1
Failed to mount ext2 filesystem...
spl_load_image_ext: ext4fs mount err - 0

Partially revert it so that we can boot U-Boot again on these
i.MX6 platforms.

Reported-by: Jonathan Gray 
Signed-off-by: Fabio Estevam 
---
Changes since v2:
- Do a partiall revert instead of full revert (Lukasz)

 arch/arm/mach-imx/spl.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index a9079fc..b2521b2 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -132,6 +132,29 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, 
const char *name)
 }
 #endif
 
+#if defined(CONFIG_SPL_MMC_SUPPORT)
+/* called from spl_mmc to see type of boot mode for storage (RAW or FAT) */
+u32 spl_boot_mode(const u32 boot_device)
+{
+   switch (spl_boot_device()) {
+   /* for MMC return either RAW or FAT mode */
+   case BOOT_DEVICE_MMC1:
+   case BOOT_DEVICE_MMC2:
+#if defined(CONFIG_SPL_FAT_SUPPORT)
+   return MMCSD_MODE_FS;
+#elif defined(CONFIG_SUPPORT_EMMC_BOOT)
+   return MMCSD_MODE_EMMCBOOT;
+#else
+   return MMCSD_MODE_RAW;
+#endif
+   break;
+   default:
+   puts("spl: ERROR:  unsupported device\n");
+   hang();
+   }
+}
+#endif
+
 #if defined(CONFIG_SECURE_BOOT)
 
 /*
-- 
2.7.4

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


[U-Boot] [PATCH v2] fdt: Fixup only valid memory banks

2018-02-15 Thread Thierry Reding
From: Thierry Reding 

Memory banks with address 0 and size 0 are empty and should not be
passed to the OS via device tree.

Acked-by: Stephen Warren 
Signed-off-by: Thierry Reding 
---
Changes in v2:
- check whether or not any banks need to be fixed up after filtering out
  invalid ones (Stephen Warren)
- use braces around multiple-line body of for loop, even if not strictly
  necessary (Stephen Warren)
---
 common/fdt_support.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index 17623a1728f6..da0c12e9c1bc 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -418,7 +418,7 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 
*address, u64 *size,
 int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
 {
int err, nodeoffset;
-   int len;
+   int len, i;
u8 tmp[MEMORY_BANKS_MAX * 16]; /* Up to 64-bit address + 64-bit size */
 
if (banks > MEMORY_BANKS_MAX) {
@@ -447,6 +447,13 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 
size[], int banks)
return err;
}
 
+   for (i = 0; i < banks; i++) {
+   if (start[i] == 0 && size[i] == 0)
+   break;
+   }
+
+   banks = i;
+
if (!banks)
return 0;
 
-- 
2.15.1

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


Re: [U-Boot] [PATCH v2] Revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Marek Vasut
On 02/15/2018 06:09 PM, Stefano Babic wrote:
> Hi Lukasz,
> 
> On 15/02/2018 15:58, Lukasz Majewski wrote:
>> Hi Tom,
>>
>>> On Thu, Feb 15, 2018 at 03:33:29PM +0100, Lukasz Majewski wrote:
 Hi Fabio,
   
> This reverts commit d695d6627803dbb78a226e04b0436a01633a9936.
>
> Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak
> spl_boot_mode() function") breaks the boot on several i.MX6
> boards, such as cuboxi and wandboard:
>
> U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33
> +1300) Trying to boot from MMC1
> Failed to mount ext2 filesystem...
> spl_load_image_ext: ext4fs mount err - 0
>
> Revert it so that we can boot U-Boot again.  

 This is IMHO throwing the baby with the batch  
>>>
>>> I kind of feel we need to revert this too, sorry.  I'm also worried
>>> that we've broken some of the other platforms that also have funky
>>> if-else expected logic, and we'll be at the point soon where we have
>>> enough platforms that need to override the spl_boot_mode func with
>>> what they had before that it's not a huge win.
>>>
>>
>> Just my 2 cents.
>>
> 
> I add my two cents, too.
> 
> 
>> 1. IMHO 2 months release cycle is too short, regarding the peace of
>> development; we move Kconfig, perform DM conversion, and deal with
>> legacy code
> 
> +1
> 
> I have always the feeling to be late and, if shortening the release
> cycle has advantages, the side-effect is that each release must take
> care of some new improvement without breaking past because, yes, it is a
> release.
> 
> I understand that two months matches the Linux release cycle

It does not, Linux has 70 days per cycle, 2.5 months. But is has
significantly more contributors and maintainers.

, but I
> agree with Lukasz that we need more time to stabilize a release, taking
> into account the goals we have (DM,...). And most of use are not working
> full time at the bootloader, that makes thing worst.
> 
> Even if distros release cycle is independent from U-Boot / Kernel, I do
> not know how many people take advantage of fast releasing. The most used
> embedded buildsystems (Buildroot / Linux) have a most relaxed release
> cycle and usually a Yocto

... project reference release ...

> release have just a U-Boot version.

Right.

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


[U-Boot] [PATCH] sunxi: video: lcdc: fix HSYNC and VSYNC polarity

2018-02-15 Thread Giulio Benetti
Differently from other Lcd signals, HSYNC and VSYNC signals
result inverted if their bits are cleared to 0.

Invert their settings of IO_POL register.

Signed-off-by: Giulio Benetti 
---
 drivers/video/sunxi/lcdc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/sunxi/lcdc.c b/drivers/video/sunxi/lcdc.c
index 4cb86fb..007057c 100644
--- a/drivers/video/sunxi/lcdc.c
+++ b/drivers/video/sunxi/lcdc.c
@@ -132,9 +132,9 @@ void lcdc_tcon0_mode_set(struct sunxi_lcdc_reg * const lcdc,
}
 
val = SUNXI_LCDC_TCON0_IO_POL_DCLK_PHASE(dclk_phase);
-   if (mode->flags & DISPLAY_FLAGS_HSYNC_LOW)
+   if (mode->flags & DISPLAY_FLAGS_HSYNC_HIGH)
val |= SUNXI_LCDC_TCON_HSYNC_MASK;
-   if (mode->flags & DISPLAY_FLAGS_VSYNC_LOW)
+   if (mode->flags & DISPLAY_FLAGS_VSYNC_HIGH)
val |= SUNXI_LCDC_TCON_VSYNC_MASK;
 
 #ifdef CONFIG_VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH
-- 
2.7.4

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


Re: [U-Boot] [PATCH v2] usb: host: xhci-omap: Remove redundant board_usb_init and board_usb_cleanup functions

2018-02-15 Thread Uri Mashiach



On 02/15/2018 01:42 PM, Faiz Abbas wrote:

board_usb_init()/_cleanup() should be in board files and don't have
a place in the xhci-omap driver. Weak versions for
board_usb_init()/_cleanup() already exist in common/usb.c
(for host mode) and drivers/usb/gadget/g_dnl.c (for gadget mode).

Therefore, remove init and cleanup functions from xhci-omap and
implement them in the board files.

Signed-off-by: Faiz Abbas 
Reviewed-by: Marek Vasut 
Reviewed-by: Bin Meng 


Tested-by: Uri Mashiach 


---
v2: Added init and cleanup implementations for boards which
were relying on the weak implementation.

Uri please test the compulab boards.

  board/compulab/cl-som-am57x/cl-som-am57x.c | 13 +
  board/compulab/cm_t43/cm_t43.c | 14 ++
  board/ti/am43xx/board.c|  4 ++--
  board/ti/am57xx/board.c|  4 ++--
  board/ti/dra7xx/evm.c  |  4 ++--
  drivers/usb/host/xhci-omap.c   | 22 --
  6 files changed, 33 insertions(+), 28 deletions(-)

diff --git a/board/compulab/cl-som-am57x/cl-som-am57x.c 
b/board/compulab/cl-som-am57x/cl-som-am57x.c
index 389eebb..d7dc8a4 100644
--- a/board/compulab/cl-som-am57x/cl-som-am57x.c
+++ b/board/compulab/cl-som-am57x/cl-som-am57x.c
@@ -16,6 +16,7 @@
  #include 
  #include "../common/common.h"
  #include "../common/eeprom.h"
+#include 
  
  DECLARE_GLOBAL_DATA_PTR;
  
@@ -64,3 +65,15 @@ u32 get_board_rev(void)

  {
return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
  }
+
+int board_usb_init(int index, enum usb_init_type init)
+{
+   enable_usb_clocks(index);
+   return 0;
+}
+
+int board_usb_cleanup(int index, enum usb_init_type init)
+{
+   disable_usb_clocks(index);
+   return 0;
+}
diff --git a/board/compulab/cm_t43/cm_t43.c b/board/compulab/cm_t43/cm_t43.c
index 0d5da6f..bdbea4f 100644
--- a/board/compulab/cm_t43/cm_t43.c
+++ b/board/compulab/cm_t43/cm_t43.c
@@ -14,6 +14,8 @@
  #include 
  #include 
  #include "board.h"
+#include 
+#include 
  
  DECLARE_GLOBAL_DATA_PTR;
  
@@ -50,6 +52,18 @@ int board_init(void)

return 0;
  }
  
+int board_usb_init(int index, enum usb_init_type init)

+{
+   enable_usb_clocks(index);
+   return 0;
+}
+
+int board_usb_cleanup(int index, enum usb_init_type init)
+{
+   disable_usb_clocks(index);
+   return 0;
+}
+
  #ifdef CONFIG_DRIVER_TI_CPSW
  
  static void cpsw_control(int enabled)

diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
index 16150ad..715960a 100644
--- a/board/ti/am43xx/board.c
+++ b/board/ti/am43xx/board.c
@@ -687,7 +687,7 @@ int usb_gadget_handle_interrupts(int index)
  #endif /* CONFIG_USB_DWC3 */
  
  #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)

-int omap_xhci_board_usb_init(int index, enum usb_init_type init)
+int board_usb_init(int index, enum usb_init_type init)
  {
enable_usb_clocks(index);
  #ifdef CONFIG_USB_DWC3
@@ -718,7 +718,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type 
init)
return 0;
  }
  
-int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)

+int board_usb_cleanup(int index, enum usb_init_type init)
  {
  #ifdef CONFIG_USB_DWC3
switch (index) {
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index 1128784..c3f60f6 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -867,7 +867,7 @@ int usb_gadget_handle_interrupts(int index)
  #endif /* CONFIG_USB_DWC3 */
  
  #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)

-int omap_xhci_board_usb_init(int index, enum usb_init_type init)
+int board_usb_init(int index, enum usb_init_type init)
  {
enable_usb_clocks(index);
switch (index) {
@@ -901,7 +901,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type 
init)
return 0;
  }
  
-int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)

+int board_usb_cleanup(int index, enum usb_init_type init)
  {
  #ifdef CONFIG_USB_DWC3
switch (index) {
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index 6ecf971..519475e 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -907,7 +907,7 @@ static struct ti_usb_phy_device usb_phy2_device = {
.index = 1,
  };
  
-int omap_xhci_board_usb_init(int index, enum usb_init_type init)

+int board_usb_init(int index, enum usb_init_type init)
  {
enable_usb_clocks(index);
switch (index) {
@@ -944,7 +944,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type 
init)
return 0;
  }
  
-int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)

+int board_usb_cleanup(int index, enum usb_init_type init)
  {
switch (index) {
case 0:
diff --git a/drivers/usb/host/xhci-omap.c b/drivers/usb/host/xhci-omap.c
index d6c5744..b814500 100644
--- a/drivers/usb/host/xhci-omap.c
+++ 

Re: [U-Boot] [PATCH v1 2/2] mmc: fix bug in mmc_startup_v4()

2018-02-15 Thread Sam Protsenko
Hi Tom,

Can we merge this fix, please? We are having troubles with X15 board
in Linaro lab due to this bug... Would be great to have this patch in
v2018.03. I know, relying on master branch is not good, but it is what
it is, I'll talk with guys if we can change the policy.

Thanks!

On 14 February 2018 at 17:02, Sam Protsenko  wrote:
> On 9 February 2018 at 13:09, Jean-Jacques Hiblot  wrote:
>> The correspondence between mmc versions as used in u-boot and the version
>> numbers reported in register EXT_CSD_REV is wrong for versions above and
>> including MMC_VERSION_4_41. All those versions were shifted by one:
>> real 4.5 hardware appeared to be MMC_VERSION_5_0.
>>
>> Fix this by adding the missing version in the correspondence table.
>>
>> Reported-by: eil Eilmsteiner Heribert 
>> Signed-off-by: Jean-Jacques Hiblot 
>>
>> ---
>>
>>  drivers/mmc/mmc.c | 1 +
>>  include/mmc.h | 1 +
>>  2 files changed, 2 insertions(+)
>>
>> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
>> index 31614dd..99e2a75 100644
>> --- a/drivers/mmc/mmc.c
>> +++ b/drivers/mmc/mmc.c
>> @@ -1950,6 +1950,7 @@ static int mmc_startup_v4(struct mmc *mmc)
>> MMC_VERSION_4_1,
>> MMC_VERSION_4_2,
>> MMC_VERSION_4_3,
>> +   MMC_VERSION_4_4,
>> MMC_VERSION_4_41,
>> MMC_VERSION_4_5,
>> MMC_VERSION_5_0,
>> diff --git a/include/mmc.h b/include/mmc.h
>> index a46eaed..86f885b 100644
>> --- a/include/mmc.h
>> +++ b/include/mmc.h
>> @@ -54,6 +54,7 @@
>>  #define MMC_VERSION_4_1MAKE_MMC_VERSION(4, 1, 0)
>>  #define MMC_VERSION_4_2MAKE_MMC_VERSION(4, 2, 0)
>>  #define MMC_VERSION_4_3MAKE_MMC_VERSION(4, 3, 0)
>> +#define MMC_VERSION_4_4MAKE_MMC_VERSION(4, 4, 0)
>>  #define MMC_VERSION_4_41   MAKE_MMC_VERSION(4, 4, 1)
>>  #define MMC_VERSION_4_5MAKE_MMC_VERSION(4, 5, 0)
>>  #define MMC_VERSION_5_0MAKE_MMC_VERSION(5, 0, 0)
>> --
>> 1.9.1
>>
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> https://lists.denx.de/listinfo/u-boot
>
> Reviewed-by: Sam Protsenko 
>
> This patch fixes eMMC on AM57x EVM / X15 boards, which was broken in
> 58a6fb7b0496 ("mmc: reworked version lookup in mmc_startup_v4")
> commit.
>
> Thanks.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] Revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Stefano Babic
Hi Lukasz,

On 15/02/2018 15:58, Lukasz Majewski wrote:
> Hi Tom,
> 
>> On Thu, Feb 15, 2018 at 03:33:29PM +0100, Lukasz Majewski wrote:
>>> Hi Fabio,
>>>   
 This reverts commit d695d6627803dbb78a226e04b0436a01633a9936.

 Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak
 spl_boot_mode() function") breaks the boot on several i.MX6
 boards, such as cuboxi and wandboard:

 U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33
 +1300) Trying to boot from MMC1
 Failed to mount ext2 filesystem...
 spl_load_image_ext: ext4fs mount err - 0

 Revert it so that we can boot U-Boot again.  
>>>
>>> This is IMHO throwing the baby with the batch  
>>
>> I kind of feel we need to revert this too, sorry.  I'm also worried
>> that we've broken some of the other platforms that also have funky
>> if-else expected logic, and we'll be at the point soon where we have
>> enough platforms that need to override the spl_boot_mode func with
>> what they had before that it's not a huge win.
>>
> 
> Just my 2 cents.
> 

I add my two cents, too.


> 1. IMHO 2 months release cycle is too short, regarding the peace of
> development; we move Kconfig, perform DM conversion, and deal with
> legacy code

+1

I have always the feeling to be late and, if shortening the release
cycle has advantages, the side-effect is that each release must take
care of some new improvement without breaking past because, yes, it is a
release.

I understand that two months matches the Linux release cycle, but I
agree with Lukasz that we need more time to stabilize a release, taking
into account the goals we have (DM,...). And most of use are not working
full time at the bootloader, that makes thing worst.

Even if distros release cycle is independent from U-Boot / Kernel, I do
not know how many people take advantage of fast releasing. The most used
embedded buildsystems (Buildroot / Linux) have a most relaxed release
cycle and usually a Yocto release have just a U-Boot version.

> 
> 2. As we removed the obsolete / not maitained archs. We also need to
> scrutinize the "core" u-boot code (which is often 10+ years old).
> 
> 
> As this patch showed - spotting some "implicit" errors - which cannot be
> found with travis CI build tests consumes some time.
> What is even more strange - this code from the very beginnig was
> developmed on iMX6 board 
> 
> 
> We JUST need MORE time to stabilize thing..
> 

+1

Best regards,
Stefano


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


Re: [U-Boot] [PATCH] serial: Make full device search optional

2018-02-15 Thread Derald Woods
On Feb 15, 2018 9:00 AM, "Alexander Graf"  wrote:



On 13.02.18 01:00, Derald Woods wrote:
> On Mon, Feb 5, 2018 at 7:13 AM, Derald Woods  > wrote:
>
> On Mon, Feb 5, 2018 at 3:42 AM, Alexander Graf  >wrote:
>
>
>
> On 05.02.18 01:39, Derald Woods wrote:
> > On Tue, Jan 30, 2018 at 7:34 AM, Alexander Graf 
> > >> wrote:
> >
> > On 01/30/2018 02:09 PM, Derald Woods wrote:
> >
> > On Jan 30, 2018 3:17 AM, "Alexander Graf" 
> > >
> 
> >  >
> > On 01/30/2018 12:41 AM, Derald D. Woods wrote:
> >
> > On Mon, Jan 29, 2018 at 07:46:09AM -0600,
Derald Woods
> > wrote:
> >
> > On Jan 29, 2018 6:57 AM, "Alexander Graf"
> >   >
> > 
  >
> > Commit 608b0c4ad4e5ec0c ("serial: Use next
serial device
> > if probing fails")
> > added code to search for more serial
devices if the
> > default one was not
> > probed correctly.
> >
> > Unfortunately, that breaks omap3_evm. So
while
> > investigating why that is
> > the case, let's disable the full search for
everyone but
> > bcm283x where it
> > is needed.
> >
> > Fixes: 608b0c4ad4e5ec0c ("serial: Use next
serial device
> > if probing fails")
> > Reported-by: Derald D. Woods
> >   >
> >  
> > >>
> > Signed-off-by: Alexander Graf 
> > >
> >     >
> > ---
> >
> > Derald, could you please test this patch
> and verify it
> > does indeed unbreak
> > omap3_evm?
> >
> > The omap3_evm boots now with this patch applied
on
> > master. If
> > I enable
> > SERIAL_SEARCH_ALL, it does not boot. I always
> build cleanly
> > using the
> > default config only. On failure, there is no
> console
> > input/output and
> > the board unresponsive.
> >
> >
> > So SPL is already broken? Can you try a known
> working SPL with
> > SERIAL_SEARCH_ALL=y U-Boot payload on top? Does
> that work?
> >
> >
> > I will give that path a try and see what I can
> discover. Again,
> > it will be later today or tomorrow before I can get to
> this.
> > This is why I asked what should the board code
> actually look
> > like. As the omap3_evm is ahead of some other OMAP34XX
> boards
> > currently, a good working example would be helpful. If
> omap3_evm
> > becomes the example, let's make it a good one.
> >
> >
> > If you want to make it a good example, don't disable
> > CONFIG_EFI_LOADER :).
> >
> > But really, the only major difference I saw between beagle
> and evm
> > was the fact that evm used DM in SPL. I patched that up
> locally (had
> > to remove ext support as the binary became too big
> otherwise), but
> > that didn't show the issue either. So we'll have to wait
> on your test
> > ​s.
> 

Re: [U-Boot] How to test new bootloaders on Jetson TX1?

2018-02-15 Thread Varun Wadekar
Andreas, can you try the TOS packaging script available in our public repo?

http://nv-tegra.nvidia.com/gitweb/?p=3rdparty/ote_partner/tlk.git;a=blob;f=tools/gen_tos_part_img.py;h=47828f7028e56a6cffb9b773502b13dc431a015e;hb=HEAD

Please let me know if this does not work for you.

For the upstream ATF code, our downstream has not caught up with upstream yet, 
so I am not sure if upstream would directly work for TX1. But its definitely 
worth a try.

-Original Message-
From: Tom Warren 
Sent: Thursday, February 15, 2018 7:44 AM
To: Jonathan Hunter ; Andreas Färber 
Cc: linux-te...@vger.kernel.org; U-Boot ; Alexander Graf 
; Mian Yousaf Kaukab ; Varun Wadekar 

Subject: RE: How to test new bootloaders on Jetson TX1?



-Original Message-
From: Jonathan Hunter 
Sent: Thursday, February 15, 2018 8:39 AM
To: Andreas Färber 
Cc: linux-te...@vger.kernel.org; U-Boot ; Alexander Graf 
; Mian Yousaf Kaukab ; Tom Warren 
; Varun Wadekar 
Subject: Re: How to test new bootloaders on Jetson TX1?


On 15/02/18 15:12, Andreas Färber wrote:
> Hi Jon,
> 
> Am 15.02.2018 um 15:01 schrieb Jon Hunter:
>> On 15/02/18 12:32, Andreas Färber wrote:
>>> Am 15.02.2018 um 10:22 schrieb Jon Hunter:
 On 15/02/18 01:51, Andreas Färber wrote:
> I would like to test the latest version of U-Boot on the Jetson TX1.
>>> [...]
> Here's what I have tried:
>
> $ sudo ./flash.sh p2371-2180-devkit mmcblk0p1
 This should work. Which u-boot binary are you copying and where are 
 you copying it?

 I copy the u-boot-dtb.bin over u-boot.bin in the L4T directory 
 Linux_for_Tegra/bootloader/t186ref/p2771-/500/u-boot.bin.
>>>
>>> I downloaded the .rpm from
>>> https://build.opensuse.org/package/show/hardware:boot/u-boot-p2371-2
>>> 180 extracting all of u-boot, u-boot.bin, u-boot.dtb and 
>>> u-boot-dtb.bin to bootloader/t210ref/p2371-2180/ - and as described 
>>> it makes a difference in that it then ceases to boot to a U-Boot 
>>> prompt.
>>
>> Sorry, looks like I mixed TX1 and TX2. I see you are using TX1. 
>> However, I believe you are still booting the wrong u-boot file.
>>
>> If you look at the p2371-2180-devkit.conf you will see that it has ...
>>
>>  DFLT_KERNEL_IMAGE="bootloader/${target_board}/p2371-2180/u-boot.bin
>>
>> For using the upstream u-boot, we need to use the u-boot-dtb.bin and 
>> not the u-boot.bin. So you can either ...
>>
>> 1. Update the p2371-2180-devkit.conf to use the u-boot-dtb.bin that 
>> you copied.
>> 2. Move the u-boot-dtb.bin from your rpm to 
>> bootloader/t210ref/p2371-2180/u-boot.bin.
> 
> Both in the Nvidia tarball and in our upstream based package builds, 
> u-boot.bin and u-boot-dtb.bin are identical. Since some time 
> u-boot-dtb.bin gets copied over as u-boot.bin for consistency upstream.

Good to know!

> Should this work with the vanilla upstream files, or do they need any 
> headers or signatures or something?

Yes should work fine with vanilla upstream.

> Do any of you have that upstream version booting successfully, or 
> might it be an upstream U-Boot regression? I was so far assuming it's 
> a user error, so haven't tried bisecting yet.

I am using "U-Boot 2017.03". However, I realise that I am currently based upon 
L4T rel24.2.1 (as rel28.1 was not available when I started using L4T for 
testing upstream). I hope it would not matter, but you never know. I plan to 
move to rel28.2 once it is released. If we think it is a problem with rel28.1 I 
should be able to test my side.

[Tom] Current (R28.x) U-Boot requires CBoot to load - we no longer use NVTBoot 
as we did in R24.x.  Hence, upstream U-Boot needs some modifications to be able 
to be loaded by CBoot instead of NVTBoot.  I haven't done that work yet 
(patches to convert upstream Denx U-Boot source for T210/T186 to use CBoot as 
the loader - don't know how I'll structure it so old (NVTBoot) bootflow will 
still work as well as the new (CBoot) bootflow).  I've got it on my plate, but 
other priorities have prevented me from working on it. I'll try to get it into 
the queue.  Until then, you won't be able to load/run upstream U-Boot using the 
boot flow in R28.x. Sorry.


Cheers
Jon

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


Re: [U-Boot] [PATCH v2 00/13] LS1012A PFE driver patch series

2018-02-15 Thread Calvin Johnson
Hi York,

> -Original Message-
> From: York Sun
> Sent: Thursday, February 15, 2018 9:19 PM
> To: Calvin Johnson ; u-boot@lists.denx.de
> Cc: joe.hershber...@ni.com; Anji Jagarlmudi 
> Subject: Re: [PATCH v2 00/13] LS1012A PFE driver patch series
> 
> On 02/15/2018 06:10 AM, Calvin Johnson wrote:
> > Hi,
> >
> > This patch series introduces U-Boot support for NXP's LS1012A Packet
> > Forwarding Engine (pfe_eth). LS1012A uses hardware packet forwarding
> > engine to provide high performance Ethernet interfaces. The device
> > includes two Ethernet ports.
> >
> > Changes in v2 series:
> > 1. PFE patches submitted on top of this base patch are now merged to
> > this patch.
> > 2. Platform changes are segregated into different patches.
> > 3. Network enabled on 2g5rdb platform
> > 4. Moved from legacy to new driver model.
> >
> > Calvin Johnson (12):
> >   drivers: net: phy: Fix aquantia compilation with DM
> >   drivers: net: pfe_eth: LS1012A PFE driver introduction
> >   drivers: net: pfe_eth: provide pfe commands
> >   drivers: net: pfe_eth: LS1012A PFE headers
> >   board: freescale: ls1012aqds: enable network support on ls1012aqds
> >   board: freescale: ls1012afrdm: enable network support on ls1012afrdm
> >   board: freescale: ls1012ardb: enable network support on ls1012ardb
> >   board: freescale: ls1012a2g5rdb: enable network support on
> > ls1012a2g5rdb
> >   armv8: fsl-lsch2: add pfe macros and update ccsr_scfg structure
> >   armv8: fsl-lsch2: configure pfe's DDR and HDBUS interfaces and ECC
> >   armv8: layerscape: csu: enable ns access to PFE registers
> >   configs: ls1012a: add pfe configuration for LS1012A
> >
> > Prabhakar Kushwaha (1):
> >   armv8: fsl-layerscape: Add support of GPIO structure
> 
> Calvin,
> 
> I think you should update your copyright year. Is it right to add
> 2015-2016 copyright year? Did you have these files then?

I think most of the pfe driver files, except for board files were present 
during that period. 

However, I would wait for Anji to respond on this. Based on his response
I can update copyright year if required.

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


[U-Boot] [PATCHv1] mx53ppd: Change UART clock divider for high baudrate

2018-02-15 Thread Sebastian Reichel
From: Rick Bronson 

Allow higher UART baud rates for communications to ACHC at 13.5 MBaud
Done in u-boot since it changes a divider common to all UARTs, including
the console. If it were done in Linux we would get garbled characters
during the handoff from u-boot to the kernel.

Signed-off-by: Sebastian Reichel 
---
 arch/arm/mach-imx/mx5/lowlevel_init.S | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-imx/mx5/lowlevel_init.S 
b/arch/arm/mach-imx/mx5/lowlevel_init.S
index f5bc6728b7c2..ee4c3afd2fed 100644
--- a/arch/arm/mach-imx/mx5/lowlevel_init.S
+++ b/arch/arm/mach-imx/mx5/lowlevel_init.S
@@ -319,11 +319,13 @@ setup_pll_func:
ldr r1, =0x00016154
str r1, [r0, #CLKCTL_CBCMR]
 
+#if !defined(CONFIG_TARGET_MX53PPD)
/*change uart clk parent to pll2*/
ldr r1, [r0, #CLKCTL_CSCMR1]
and r1, r1, #0xfcff
orr r1, r1, #0x0100
str r1, [r0, #CLKCTL_CSCMR1]
+#endif
 
/* make sure change is effective */
 1:  ldr r1, [r0, #CLKCTL_CDHIPR]
@@ -350,7 +352,9 @@ setup_pll_func:
/* make uart div=6 */
ldr r1, [r0, #CLKCTL_CSCDR1]
and r1, r1, #0xffc0
+#if !defined(CONFIG_TARGET_MX53PPD)
orr r1, r1, #0x0a
+#endif
str r1, [r0, #CLKCTL_CSCDR1]
 
/* Restore the default values in the Gate registers */
-- 
2.15.1

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


[U-Boot] [PATCH] Revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Fabio Estevam
This reverts commit d695d6627803dbb78a226e04b0436a01633a9936.

Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak spl_boot_mode()
function") breaks the build on several i.MX6 boards,
such as cuboxi and wandboard:

U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33 +1300)
Trying to boot from MMC1
Failed to mount ext2 filesystem...
spl_load_image_ext: ext4fs mount err - 0

Revert it so that we can boot U-Boot again.

Reported-by: Jonathan Gray 
Signed-off-by: Fabio Estevam 
---
 arch/arm/cpu/arm1136/mx35/generic.c   | 21 +
 arch/arm/cpu/armv7/ls102xa/spl.c  | 17 +
 arch/arm/cpu/armv8/fsl-layerscape/spl.c   | 17 +
 arch/arm/cpu/armv8/zynqmp/spl.c   | 14 ++
 arch/arm/mach-at91/spl.c  | 15 +++
 arch/arm/mach-davinci/spl.c   |  5 +
 arch/arm/mach-imx/spl.c   | 23 +++
 arch/arm/mach-mvebu/spl.c |  7 +++
 arch/arm/mach-rockchip/rk3188-board-spl.c |  5 +
 arch/arm/mach-rockchip/rk3288-board-spl.c |  5 +
 arch/arm/mach-rockchip/rk3368-board-spl.c |  5 +
 arch/arm/mach-rockchip/rk3399-board-spl.c |  5 +
 arch/arm/mach-socfpga/spl.c   | 11 +++
 arch/arm/mach-sunxi/board.c   |  6 ++
 arch/arm/mach-zynq/spl.c  |  7 +++
 common/spl/spl_mmc.c  | 11 ---
 16 files changed, 163 insertions(+), 11 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx35/generic.c 
b/arch/arm/cpu/arm1136/mx35/generic.c
index 4dcfc72..5297d62 100644
--- a/arch/arm/cpu/arm1136/mx35/generic.c
+++ b/arch/arm/cpu/arm1136/mx35/generic.c
@@ -524,3 +524,24 @@ u32 spl_boot_device(void)
 
return BOOT_DEVICE_NONE;
 }
+
+#ifdef CONFIG_SPL_BUILD
+u32 spl_boot_mode(const u32 boot_device)
+{
+   switch (spl_boot_device()) {
+   case BOOT_DEVICE_MMC1:
+#ifdef CONFIG_SPL_FAT_SUPPORT
+   return MMCSD_MODE_FS;
+#else
+   return MMCSD_MODE_RAW;
+#endif
+   break;
+   case BOOT_DEVICE_NAND:
+   return 0;
+   break;
+   default:
+   puts("spl: ERROR:  unsupported device\n");
+   hang();
+   }
+}
+#endif
diff --git a/arch/arm/cpu/armv7/ls102xa/spl.c b/arch/arm/cpu/armv7/ls102xa/spl.c
index 1e4a164..1246eed 100644
--- a/arch/arm/cpu/armv7/ls102xa/spl.c
+++ b/arch/arm/cpu/armv7/ls102xa/spl.c
@@ -14,3 +14,20 @@ u32 spl_boot_device(void)
 #endif
return BOOT_DEVICE_NAND;
 }
+
+u32 spl_boot_mode(const u32 boot_device)
+{
+   switch (spl_boot_device()) {
+   case BOOT_DEVICE_MMC1:
+#ifdef CONFIG_SPL_FAT_SUPPORT
+   return MMCSD_MODE_FS;
+#else
+   return MMCSD_MODE_RAW;
+#endif
+   case BOOT_DEVICE_NAND:
+   return 0;
+   default:
+   puts("spl: error: unsupported device\n");
+   hang();
+   }
+}
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c 
b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
index 3a74040..4093d15 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
@@ -26,6 +26,23 @@ u32 spl_boot_device(void)
return 0;
 }
 
+u32 spl_boot_mode(const u32 boot_device)
+{
+   switch (spl_boot_device()) {
+   case BOOT_DEVICE_MMC1:
+#ifdef CONFIG_SPL_FAT_SUPPORT
+   return MMCSD_MODE_FS;
+#else
+   return MMCSD_MODE_RAW;
+#endif
+   case BOOT_DEVICE_NAND:
+   return 0;
+   default:
+   puts("spl: error: unsupported device\n");
+   hang();
+   }
+}
+
 #ifdef CONFIG_SPL_BUILD
 
 void spl_board_init(void)
diff --git a/arch/arm/cpu/armv8/zynqmp/spl.c b/arch/arm/cpu/armv8/zynqmp/spl.c
index 0bfa5c1..bc7313a 100644
--- a/arch/arm/cpu/armv8/zynqmp/spl.c
+++ b/arch/arm/cpu/armv8/zynqmp/spl.c
@@ -115,6 +115,20 @@ u32 spl_boot_device(void)
return 0;
 }
 
+u32 spl_boot_mode(const u32 boot_device)
+{
+   switch (boot_device) {
+   case BOOT_DEVICE_RAM:
+   return 0;
+   case BOOT_DEVICE_MMC1:
+   case BOOT_DEVICE_MMC2:
+   return MMCSD_MODE_FS;
+   default:
+   puts("spl: error: unsupported device\n");
+   hang();
+   }
+}
+
 #ifdef CONFIG_SPL_OS_BOOT
 int spl_start_uboot(void)
 {
diff --git a/arch/arm/mach-at91/spl.c b/arch/arm/mach-at91/spl.c
index 91add92..7e7e24b 100644
--- a/arch/arm/mach-at91/spl.c
+++ b/arch/arm/mach-at91/spl.c
@@ -87,3 +87,18 @@ u32 spl_boot_device(void)
return BOOT_DEVICE_NONE;
 }
 #endif
+
+u32 spl_boot_mode(const u32 boot_device)
+{
+   switch (boot_device) {
+#if defined(CONFIG_SYS_USE_MMC) || defined(CONFIG_SD_BOOT)
+   case BOOT_DEVICE_MMC1:
+   case BOOT_DEVICE_MMC2:
+   return MMCSD_MODE_FS;
+   break;
+#endif
+   case BOOT_DEVICE_NONE:
+   default:
+   

[U-Boot] [PATCH v2] Revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Fabio Estevam
This reverts commit d695d6627803dbb78a226e04b0436a01633a9936.

Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak spl_boot_mode()
function") breaks the boot on several i.MX6 boards,
such as cuboxi and wandboard:

U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33 +1300)
Trying to boot from MMC1
Failed to mount ext2 filesystem...
spl_load_image_ext: ext4fs mount err - 0

Revert it so that we can boot U-Boot again.

Reported-by: Jonathan Gray 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Fix typo in commit log: "breaks the boot" instead of "breaks the build"

 arch/arm/cpu/arm1136/mx35/generic.c   | 21 +
 arch/arm/cpu/armv7/ls102xa/spl.c  | 17 +
 arch/arm/cpu/armv8/fsl-layerscape/spl.c   | 17 +
 arch/arm/cpu/armv8/zynqmp/spl.c   | 14 ++
 arch/arm/mach-at91/spl.c  | 15 +++
 arch/arm/mach-davinci/spl.c   |  5 +
 arch/arm/mach-imx/spl.c   | 23 +++
 arch/arm/mach-mvebu/spl.c |  7 +++
 arch/arm/mach-rockchip/rk3188-board-spl.c |  5 +
 arch/arm/mach-rockchip/rk3288-board-spl.c |  5 +
 arch/arm/mach-rockchip/rk3368-board-spl.c |  5 +
 arch/arm/mach-rockchip/rk3399-board-spl.c |  5 +
 arch/arm/mach-socfpga/spl.c   | 11 +++
 arch/arm/mach-sunxi/board.c   |  6 ++
 arch/arm/mach-zynq/spl.c  |  7 +++
 common/spl/spl_mmc.c  | 11 ---
 16 files changed, 163 insertions(+), 11 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx35/generic.c 
b/arch/arm/cpu/arm1136/mx35/generic.c
index 4dcfc72..5297d62 100644
--- a/arch/arm/cpu/arm1136/mx35/generic.c
+++ b/arch/arm/cpu/arm1136/mx35/generic.c
@@ -524,3 +524,24 @@ u32 spl_boot_device(void)
 
return BOOT_DEVICE_NONE;
 }
+
+#ifdef CONFIG_SPL_BUILD
+u32 spl_boot_mode(const u32 boot_device)
+{
+   switch (spl_boot_device()) {
+   case BOOT_DEVICE_MMC1:
+#ifdef CONFIG_SPL_FAT_SUPPORT
+   return MMCSD_MODE_FS;
+#else
+   return MMCSD_MODE_RAW;
+#endif
+   break;
+   case BOOT_DEVICE_NAND:
+   return 0;
+   break;
+   default:
+   puts("spl: ERROR:  unsupported device\n");
+   hang();
+   }
+}
+#endif
diff --git a/arch/arm/cpu/armv7/ls102xa/spl.c b/arch/arm/cpu/armv7/ls102xa/spl.c
index 1e4a164..1246eed 100644
--- a/arch/arm/cpu/armv7/ls102xa/spl.c
+++ b/arch/arm/cpu/armv7/ls102xa/spl.c
@@ -14,3 +14,20 @@ u32 spl_boot_device(void)
 #endif
return BOOT_DEVICE_NAND;
 }
+
+u32 spl_boot_mode(const u32 boot_device)
+{
+   switch (spl_boot_device()) {
+   case BOOT_DEVICE_MMC1:
+#ifdef CONFIG_SPL_FAT_SUPPORT
+   return MMCSD_MODE_FS;
+#else
+   return MMCSD_MODE_RAW;
+#endif
+   case BOOT_DEVICE_NAND:
+   return 0;
+   default:
+   puts("spl: error: unsupported device\n");
+   hang();
+   }
+}
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c 
b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
index 3a74040..4093d15 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
@@ -26,6 +26,23 @@ u32 spl_boot_device(void)
return 0;
 }
 
+u32 spl_boot_mode(const u32 boot_device)
+{
+   switch (spl_boot_device()) {
+   case BOOT_DEVICE_MMC1:
+#ifdef CONFIG_SPL_FAT_SUPPORT
+   return MMCSD_MODE_FS;
+#else
+   return MMCSD_MODE_RAW;
+#endif
+   case BOOT_DEVICE_NAND:
+   return 0;
+   default:
+   puts("spl: error: unsupported device\n");
+   hang();
+   }
+}
+
 #ifdef CONFIG_SPL_BUILD
 
 void spl_board_init(void)
diff --git a/arch/arm/cpu/armv8/zynqmp/spl.c b/arch/arm/cpu/armv8/zynqmp/spl.c
index 0bfa5c1..bc7313a 100644
--- a/arch/arm/cpu/armv8/zynqmp/spl.c
+++ b/arch/arm/cpu/armv8/zynqmp/spl.c
@@ -115,6 +115,20 @@ u32 spl_boot_device(void)
return 0;
 }
 
+u32 spl_boot_mode(const u32 boot_device)
+{
+   switch (boot_device) {
+   case BOOT_DEVICE_RAM:
+   return 0;
+   case BOOT_DEVICE_MMC1:
+   case BOOT_DEVICE_MMC2:
+   return MMCSD_MODE_FS;
+   default:
+   puts("spl: error: unsupported device\n");
+   hang();
+   }
+}
+
 #ifdef CONFIG_SPL_OS_BOOT
 int spl_start_uboot(void)
 {
diff --git a/arch/arm/mach-at91/spl.c b/arch/arm/mach-at91/spl.c
index 91add92..7e7e24b 100644
--- a/arch/arm/mach-at91/spl.c
+++ b/arch/arm/mach-at91/spl.c
@@ -87,3 +87,18 @@ u32 spl_boot_device(void)
return BOOT_DEVICE_NONE;
 }
 #endif
+
+u32 spl_boot_mode(const u32 boot_device)
+{
+   switch (boot_device) {
+#if defined(CONFIG_SYS_USE_MMC) || defined(CONFIG_SD_BOOT)
+   case BOOT_DEVICE_MMC1:
+   case BOOT_DEVICE_MMC2:
+   return MMCSD_MODE_FS;
+   

Re: [U-Boot] [PATCH v2 00/13] LS1012A PFE driver patch series

2018-02-15 Thread York Sun
On 02/15/2018 06:10 AM, Calvin Johnson wrote:
> Hi,
>  
> This patch series introduces U-Boot support for NXP's LS1012A Packet
> Forwarding Engine (pfe_eth). LS1012A uses hardware packet forwarding
> engine to provide high performance Ethernet interfaces. The device
> includes two Ethernet ports.
>  
> Changes in v2 series:
> 1. PFE patches submitted on top of this base patch are now merged to
> this patch.
> 2. Platform changes are segregated into different patches.
> 3. Network enabled on 2g5rdb platform
> 4. Moved from legacy to new driver model.
> 
> Calvin Johnson (12):
>   drivers: net: phy: Fix aquantia compilation with DM
>   drivers: net: pfe_eth: LS1012A PFE driver introduction
>   drivers: net: pfe_eth: provide pfe commands
>   drivers: net: pfe_eth: LS1012A PFE headers
>   board: freescale: ls1012aqds: enable network support on ls1012aqds
>   board: freescale: ls1012afrdm: enable network support on ls1012afrdm
>   board: freescale: ls1012ardb: enable network support on ls1012ardb
>   board: freescale: ls1012a2g5rdb: enable network support on
> ls1012a2g5rdb
>   armv8: fsl-lsch2: add pfe macros and update ccsr_scfg structure
>   armv8: fsl-lsch2: configure pfe's DDR and HDBUS interfaces and ECC
>   armv8: layerscape: csu: enable ns access to PFE registers
>   configs: ls1012a: add pfe configuration for LS1012A
> 
> Prabhakar Kushwaha (1):
>   armv8: fsl-layerscape: Add support of GPIO structure

Calvin,

I think you should update your copyright year. Is it right to add
2015-2016 copyright year? Did you have these files then?

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


Re: [U-Boot] How to test new bootloaders on Jetson TX1?

2018-02-15 Thread Tom Warren


-Original Message-
From: Jonathan Hunter 
Sent: Thursday, February 15, 2018 8:39 AM
To: Andreas Färber 
Cc: linux-te...@vger.kernel.org; U-Boot ; Alexander Graf 
; Mian Yousaf Kaukab ; Tom Warren 
; Varun Wadekar 
Subject: Re: How to test new bootloaders on Jetson TX1?


On 15/02/18 15:12, Andreas Färber wrote:
> Hi Jon,
> 
> Am 15.02.2018 um 15:01 schrieb Jon Hunter:
>> On 15/02/18 12:32, Andreas Färber wrote:
>>> Am 15.02.2018 um 10:22 schrieb Jon Hunter:
 On 15/02/18 01:51, Andreas Färber wrote:
> I would like to test the latest version of U-Boot on the Jetson TX1.
>>> [...]
> Here's what I have tried:
>
> $ sudo ./flash.sh p2371-2180-devkit mmcblk0p1
 This should work. Which u-boot binary are you copying and where are 
 you copying it?

 I copy the u-boot-dtb.bin over u-boot.bin in the L4T directory 
 Linux_for_Tegra/bootloader/t186ref/p2771-/500/u-boot.bin.
>>>
>>> I downloaded the .rpm from
>>> https://build.opensuse.org/package/show/hardware:boot/u-boot-p2371-2
>>> 180 extracting all of u-boot, u-boot.bin, u-boot.dtb and 
>>> u-boot-dtb.bin to bootloader/t210ref/p2371-2180/ - and as described 
>>> it makes a difference in that it then ceases to boot to a U-Boot 
>>> prompt.
>>
>> Sorry, looks like I mixed TX1 and TX2. I see you are using TX1. 
>> However, I believe you are still booting the wrong u-boot file.
>>
>> If you look at the p2371-2180-devkit.conf you will see that it has ...
>>
>>  DFLT_KERNEL_IMAGE="bootloader/${target_board}/p2371-2180/u-boot.bin
>>
>> For using the upstream u-boot, we need to use the u-boot-dtb.bin and 
>> not the u-boot.bin. So you can either ...
>>
>> 1. Update the p2371-2180-devkit.conf to use the u-boot-dtb.bin that 
>> you copied.
>> 2. Move the u-boot-dtb.bin from your rpm to 
>> bootloader/t210ref/p2371-2180/u-boot.bin.
> 
> Both in the Nvidia tarball and in our upstream based package builds, 
> u-boot.bin and u-boot-dtb.bin are identical. Since some time 
> u-boot-dtb.bin gets copied over as u-boot.bin for consistency upstream.

Good to know!

> Should this work with the vanilla upstream files, or do they need any 
> headers or signatures or something?

Yes should work fine with vanilla upstream.

> Do any of you have that upstream version booting successfully, or 
> might it be an upstream U-Boot regression? I was so far assuming it's 
> a user error, so haven't tried bisecting yet.

I am using "U-Boot 2017.03". However, I realise that I am currently based upon 
L4T rel24.2.1 (as rel28.1 was not available when I started using L4T for 
testing upstream). I hope it would not matter, but you never know. I plan to 
move to rel28.2 once it is released. If we think it is a problem with rel28.1 I 
should be able to test my side.

[Tom] Current (R28.x) U-Boot requires CBoot to load - we no longer use NVTBoot 
as we did in R24.x.  Hence, upstream U-Boot needs some modifications to be able 
to be loaded by CBoot instead of NVTBoot.  I haven't done that work yet 
(patches to convert upstream Denx U-Boot source for T210/T186 to use CBoot as 
the loader - don't know how I'll structure it so old (NVTBoot) bootflow will 
still work as well as the new (CBoot) bootflow).  I've got it on my plate, but 
other priorities have prevented me from working on it. I'll try to get it into 
the queue.  Until then, you won't be able to load/run upstream U-Boot using the 
boot flow in R28.x. Sorry.


Cheers
Jon

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


Re: [U-Boot] How to test new bootloaders on Jetson TX1?

2018-02-15 Thread Jon Hunter

On 15/02/18 15:12, Andreas Färber wrote:
> Hi Jon,
> 
> Am 15.02.2018 um 15:01 schrieb Jon Hunter:
>> On 15/02/18 12:32, Andreas Färber wrote:
>>> Am 15.02.2018 um 10:22 schrieb Jon Hunter:
 On 15/02/18 01:51, Andreas Färber wrote:
> I would like to test the latest version of U-Boot on the Jetson TX1.
>>> [...]
> Here's what I have tried:
>
> $ sudo ./flash.sh p2371-2180-devkit mmcblk0p1
 This should work. Which u-boot binary are you copying and where are you
 copying it?

 I copy the u-boot-dtb.bin over u-boot.bin in the L4T directory
 Linux_for_Tegra/bootloader/t186ref/p2771-/500/u-boot.bin.
>>>
>>> I downloaded the .rpm from
>>> https://build.opensuse.org/package/show/hardware:boot/u-boot-p2371-2180
>>> extracting all of u-boot, u-boot.bin, u-boot.dtb and u-boot-dtb.bin to
>>> bootloader/t210ref/p2371-2180/ - and as described it makes a difference
>>> in that it then ceases to boot to a U-Boot prompt.
>>
>> Sorry, looks like I mixed TX1 and TX2. I see you are using TX1. However,
>> I believe you are still booting the wrong u-boot file.
>>
>> If you look at the p2371-2180-devkit.conf you will see that it has ...
>>
>>  DFLT_KERNEL_IMAGE="bootloader/${target_board}/p2371-2180/u-boot.bin
>>
>> For using the upstream u-boot, we need to use the u-boot-dtb.bin and not
>> the u-boot.bin. So you can either ...
>>
>> 1. Update the p2371-2180-devkit.conf to use the u-boot-dtb.bin that you
>> copied.
>> 2. Move the u-boot-dtb.bin from your rpm to
>> bootloader/t210ref/p2371-2180/u-boot.bin.
> 
> Both in the Nvidia tarball and in our upstream based package builds,
> u-boot.bin and u-boot-dtb.bin are identical. Since some time
> u-boot-dtb.bin gets copied over as u-boot.bin for consistency upstream.

Good to know!

> Should this work with the vanilla upstream files, or do they need any
> headers or signatures or something?

Yes should work fine with vanilla upstream.

> Do any of you have that upstream version booting successfully, or might
> it be an upstream U-Boot regression? I was so far assuming it's a user
> error, so haven't tried bisecting yet.

I am using "U-Boot 2017.03". However, I realise that I am currently
based upon L4T rel24.2.1 (as rel28.1 was not available when I started
using L4T for testing upstream). I hope it would not matter, but you
never know. I plan to move to rel28.2 once it is released. If we think
it is a problem with rel28.1 I should be able to test my side.

Cheers
Jon

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


Re: [U-Boot] How to test new bootloaders on Jetson TX1?

2018-02-15 Thread Andreas Färber
Hi Jon,

Am 15.02.2018 um 15:01 schrieb Jon Hunter:
> On 15/02/18 12:32, Andreas Färber wrote:
>> Am 15.02.2018 um 10:22 schrieb Jon Hunter:
>>> On 15/02/18 01:51, Andreas Färber wrote:
 I would like to test the latest version of U-Boot on the Jetson TX1.
>> [...]
 Here's what I have tried:

 $ sudo ./flash.sh p2371-2180-devkit mmcblk0p1
>>> This should work. Which u-boot binary are you copying and where are you
>>> copying it?
>>>
>>> I copy the u-boot-dtb.bin over u-boot.bin in the L4T directory
>>> Linux_for_Tegra/bootloader/t186ref/p2771-/500/u-boot.bin.
>>
>> I downloaded the .rpm from
>> https://build.opensuse.org/package/show/hardware:boot/u-boot-p2371-2180
>> extracting all of u-boot, u-boot.bin, u-boot.dtb and u-boot-dtb.bin to
>> bootloader/t210ref/p2371-2180/ - and as described it makes a difference
>> in that it then ceases to boot to a U-Boot prompt.
> 
> Sorry, looks like I mixed TX1 and TX2. I see you are using TX1. However,
> I believe you are still booting the wrong u-boot file.
> 
> If you look at the p2371-2180-devkit.conf you will see that it has ...
> 
>  DFLT_KERNEL_IMAGE="bootloader/${target_board}/p2371-2180/u-boot.bin
> 
> For using the upstream u-boot, we need to use the u-boot-dtb.bin and not
> the u-boot.bin. So you can either ...
> 
> 1. Update the p2371-2180-devkit.conf to use the u-boot-dtb.bin that you
> copied.
> 2. Move the u-boot-dtb.bin from your rpm to
> bootloader/t210ref/p2371-2180/u-boot.bin.

Both in the Nvidia tarball and in our upstream based package builds,
u-boot.bin and u-boot-dtb.bin are identical. Since some time
u-boot-dtb.bin gets copied over as u-boot.bin for consistency upstream.

Should this work with the vanilla upstream files, or do they need any
headers or signatures or something?

Do any of you have that upstream version booting successfully, or might
it be an upstream U-Boot regression? I was so far assuming it's a user
error, so haven't tried bisecting yet.

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] RPi: Add myself as board maintainer

2018-02-15 Thread Tom Rini
On Thu, Feb 15, 2018 at 03:50:54PM +0100, Alexander Graf wrote:

> Commit 958d55f26ce ("MAINTAINERS: Take over BCM2835 maintainership") put
> me in as maintainer for the RPi soc, but forgot to update the board
> MAINTAINERS file.
> 
> Add me there too.
> 
> Signed-off-by: Alexander Graf 

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


Re: [U-Boot] [U-Boot, 1/2] Convert CONFIG_BOOTCOUNT_LIMIT to Kconfig

2018-02-15 Thread Tom Rini
On Fri, Feb 09, 2018 at 11:50:57PM +0100, Lukasz Majewski wrote:

> This converts the following to Kconfig:
>CONFIG_BOOTCOUNT_LIMIT
> 
> Signed-off-by: Lukasz Majewski 
> Tested-by: Alex Kiernan 
> Reviewed-by: Hannes Schmelzer 
> Acked-by: Hannes Schmelzer 

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


Re: [U-Boot] [PATCH] efi_stub: Fix GDT_NOTSYS check

2018-02-15 Thread Alexander Graf


On 12.02.18 07:26, Bin Meng wrote:
> Hi Alexander,
> 
> On Tue, Dec 5, 2017 at 7:20 AM, Bin Meng  wrote:
>> On Mon, Dec 4, 2017 at 11:33 PM, Alexander Graf  wrote:
>>> The get_codeseg32() wants to know if a passed in descriptor has
>>> flag GDT_NOTSYS set (desc & GDT_NOTSYS), not whether desc and
>>> GDT_NOTSYS are not != 0 (desk && GDT_NOTSYS).
>>>
>>> This is an obvious typo. Fix it up.
>>>
>>> Signed-off-by: Alexander Graf 
>>> ---
>>>  lib/efi/efi_stub.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>
>> Reviewed-by: Bin Meng 
> 
> Looks this one is applied nowhere?

lib/efi is something you maintain, no?

I only want to run U-Boot as UEFI firmware, I don't particularly care
about running U-Boot as UEFI payload :).


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


Re: [U-Boot] [PATCH] RPi: Add myself as board maintainer

2018-02-15 Thread Tom Rini
On Thu, Feb 15, 2018 at 04:01:21PM +0100, Alexander Graf wrote:
> 
> 
> On 15.02.18 15:58, Stefano Babic wrote:
> > On 15/02/2018 15:50, Alexander Graf wrote:
> >> Commit 958d55f26ce ("MAINTAINERS: Take over BCM2835 maintainership") put
> >> me in as maintainer for the RPi soc, but forgot to update the board
> >> MAINTIANERS file.
> >^^^
> > MAINTAINERS
> 
> Magic fingers... :)
> 
> Tom, can you fix that up while applying please?

Yeah, will do.

-- 
Tom


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


Re: [U-Boot] [PATCH v8 2/4] cmd: ubifs: Move ubifs_initialized checking into cmd_ubifs_umount()

2018-02-15 Thread Marek Vasut
On 02/05/2018 08:06 AM, tien.fong.c...@intel.com wrote:
> From: Tien Fong Chee 
> 
> cmd_ubifs_umount() function would be called directly instead of involving
> whole command machinery in generic firmware loader, so checking on
> ubifs_initialized status need to be done in cmd_ubifs_umount() without
> breaking original functionality design.
> 
> Signed-off-by: Tien Fong Chee 
> 64db5518baa2ea1a8a0e81cc485d760b850c7052

Reviewed-by: Marek Vasut 

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


Re: [U-Boot] [PATCH] RPi: Add myself as board maintainer

2018-02-15 Thread Alexander Graf


On 15.02.18 15:58, Stefano Babic wrote:
> On 15/02/2018 15:50, Alexander Graf wrote:
>> Commit 958d55f26ce ("MAINTAINERS: Take over BCM2835 maintainership") put
>> me in as maintainer for the RPi soc, but forgot to update the board
>> MAINTIANERS file.
>^^^
>   MAINTAINERS

Magic fingers... :)

Tom, can you fix that up while applying please?


Thanks!

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


Re: [U-Boot] [PATCH v2] Revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Fabio Estevam
Hi Lukasz,

On Thu, Feb 15, 2018 at 12:58 PM, Lukasz Majewski  wrote:

> As this patch showed - spotting some "implicit" errors - which cannot be
> found with travis CI build tests consumes some time.

Travis CI build test is great, but we also need boot tests to catch
issues like this.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v8 1/4] spl: Remove static declaration on spl_mmc_find_device function

2018-02-15 Thread Marek Vasut
On 02/05/2018 08:06 AM, tien.fong.c...@intel.com wrote:
> From: Tien Fong Chee 
> 
> This patch removes the static declation on spl_mmc_find_device_function
> so this function is accessible by the caller from other file. This patch
> is required for later patch.
> 
> Signed-off-by: Tien Fong Chee 
> Reviewed-by: Tom Rini 
> ---

Reviewed-by: Marek Vasut 

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


Re: [U-Boot] [PATCH v8 3/4] cmd: ubifs: Factor out some checking codes into cmd_ubifs_mount()

2018-02-15 Thread Marek Vasut
On 02/05/2018 08:06 AM, tien.fong.c...@intel.com wrote:
> From: Tien Fong Chee 
> 
> cmd_ubifs_mount() function would be called directly instead of
> involving whole command machinery for mounting ubifs in
> generic firmware loader, so some checking codes need to be factored out
> into cmd_ubifs_mount() without breaking original functionality design.
> 
> Signed-off-by: Tien Fong Chee 

[...]

> diff --git a/include/ubi_uboot.h b/include/ubi_uboot.h
> index 827dbfc..fb300e8 100644
> --- a/include/ubi_uboot.h
> +++ b/include/ubi_uboot.h
> @@ -76,5 +76,6 @@ extern int ubi_volume_read(char *volume, char *buf, size_t 
> size);
>  
>  extern struct ubi_device *ubi_devices[];
>  int cmd_ubifs_umount(void);
> +int cmd_ubifs_mount(char *vol_name);

Swap these two -- mount first and umount seconds.

With that
Reviewed-by: Marek Vasut 

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


Re: [U-Boot] [PATCH] serial: Make full device search optional

2018-02-15 Thread Alexander Graf


On 13.02.18 01:00, Derald Woods wrote:
> On Mon, Feb 5, 2018 at 7:13 AM, Derald Woods  > wrote:
> 
> On Mon, Feb 5, 2018 at 3:42 AM, Alexander Graf  >wrote:
> 
> 
> 
> On 05.02.18 01:39, Derald Woods wrote:
> > On Tue, Jan 30, 2018 at 7:34 AM, Alexander Graf  
> > >> wrote:
> >
> >     On 01/30/2018 02:09 PM, Derald Woods wrote:
> >
> >         On Jan 30, 2018 3:17 AM, "Alexander Graf"  
> >         >
> 
> >          >
> >             On 01/30/2018 12:41 AM, Derald D. Woods wrote:
> >
> >                 On Mon, Jan 29, 2018 at 07:46:09AM -0600, Derald 
> Woods
> >         wrote:
> >
> >                     On Jan 29, 2018 6:57 AM, "Alexander Graf"
> >           >
> >                      
>   >
> >                     Commit 608b0c4ad4e5ec0c ("serial: Use next 
> serial device
> >                     if probing fails")
> >                     added code to search for more serial devices if 
> the
> >                     default one was not
> >                     probed correctly.
> >
> >                     Unfortunately, that breaks omap3_evm. So while
> >                     investigating why that is
> >                     the case, let's disable the full search for 
> everyone but
> >                     bcm283x where it
> >                     is needed.
> >
> >                     Fixes: 608b0c4ad4e5ec0c ("serial: Use next 
> serial device
> >                     if probing fails")
> >                     Reported-by: Derald D. Woods
> >          
>  >
> >                      
> >           >                     Signed-off-by: Alexander Graf  
> >         >
> >                         >
> >                     ---
> >
> >                     Derald, could you please test this patch
> and verify it
> >                     does indeed unbreak
> >                     omap3_evm?
> >
> >                 The omap3_evm boots now with this patch applied on
> >         master. If
> >                 I enable
> >                 SERIAL_SEARCH_ALL, it does not boot. I always
> build cleanly
> >                 using the
> >                 default config only. On failure, there is no
> console
> >                 input/output and
> >                 the board unresponsive.
> >
> >
> >             So SPL is already broken? Can you try a known
> working SPL with
> >             SERIAL_SEARCH_ALL=y U-Boot payload on top? Does
> that work?
> >
> >
> >         I will give that path a try and see what I can
> discover. Again,
> >         it will be later today or tomorrow before I can get to
> this.
> >         This is why I asked what should the board code
> actually look
> >         like. As the omap3_evm is ahead of some other OMAP34XX
> boards
> >         currently, a good working example would be helpful. If
> omap3_evm
> >         becomes the example, let's make it a good one.
> >
> >
> >     If you want to make it a good example, don't disable
> >     CONFIG_EFI_LOADER :).
> >
> >     But really, the only major difference I saw between beagle
> and evm
> >     was the fact that evm used DM in SPL. I patched that up
> locally (had
> >     to remove ext support as the binary became too big
> otherwise), but
> >     that didn't show the issue either. So 

Re: [U-Boot] [PATCH] RPi: Add myself as board maintainer

2018-02-15 Thread Stefano Babic
On 15/02/2018 15:50, Alexander Graf wrote:
> Commit 958d55f26ce ("MAINTAINERS: Take over BCM2835 maintainership") put
> me in as maintainer for the RPi soc, but forgot to update the board
> MAINTIANERS file.
   ^^^
MAINTAINERS

Stefano

> 
> Add me there too.
> 
> Signed-off-by: Alexander Graf 
> ---
>  board/raspberrypi/rpi/MAINTAINERS | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/board/raspberrypi/rpi/MAINTAINERS 
> b/board/raspberrypi/rpi/MAINTAINERS
> index a7eb3654bb..cce1a7ad76 100644
> --- a/board/raspberrypi/rpi/MAINTAINERS
> +++ b/board/raspberrypi/rpi/MAINTAINERS
> @@ -1,6 +1,6 @@
>  RPI BOARD
> -#M:  Stephen Warren 
> -S:   Orphaned (Since 2017-07)
> +M:   Alexander Graf 
> +S:   Maintained
>  F:   board/raspberrypi/rpi/
>  F:   include/configs/rpi.h
>  F:   configs/rpi_*defconfig
> 


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


Re: [U-Boot] [PATCH v2] Revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Lukasz Majewski
Hi Tom,

> On Thu, Feb 15, 2018 at 03:33:29PM +0100, Lukasz Majewski wrote:
> > Hi Fabio,
> >   
> > > This reverts commit d695d6627803dbb78a226e04b0436a01633a9936.
> > > 
> > > Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak
> > > spl_boot_mode() function") breaks the boot on several i.MX6
> > > boards, such as cuboxi and wandboard:
> > > 
> > > U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33
> > > +1300) Trying to boot from MMC1
> > > Failed to mount ext2 filesystem...
> > > spl_load_image_ext: ext4fs mount err - 0
> > > 
> > > Revert it so that we can boot U-Boot again.  
> > 
> > This is IMHO throwing the baby with the batch  
> 
> I kind of feel we need to revert this too, sorry.  I'm also worried
> that we've broken some of the other platforms that also have funky
> if-else expected logic, and we'll be at the point soon where we have
> enough platforms that need to override the spl_boot_mode func with
> what they had before that it's not a huge win.
> 

Just my 2 cents.

1. IMHO 2 months release cycle is too short, regarding the peace of
development; we move Kconfig, perform DM conversion, and deal with
legacy code

2. As we removed the obsolete / not maitained archs. We also need to
scrutinize the "core" u-boot code (which is often 10+ years old).


As this patch showed - spotting some "implicit" errors - which cannot be
found with travis CI build tests consumes some time.
What is even more strange - this code from the very beginnig was
developmed on iMX6 board 


We JUST need MORE time to stabilize thing..


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


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


Re: [U-Boot] [PATCH v8 4/4] common: Generic firmware loader for file system

2018-02-15 Thread Marek Vasut
On 02/05/2018 08:06 AM, tien.fong.c...@intel.com wrote:
> From: Tien Fong Chee 
> 
> This is file system generic loader which can be used to load
> the file image from the storage into target such as memory.
> The consumer driver would then use this loader to program whatever,
> ie. the FPGA device.
> 
> Signed-off-by: Tien Fong Chee 
> Reviewed-by: Lothar Waßmann 
[...]

> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#ifdef CONFIG_SPL

Are the ifdefs needed ?

> +#include 
> +#endif
> +#include 
> +#ifdef CONFIG_CMD_UBIFS
> +#include 
> +#include 
> +#endif
> +#include 
> +
> +struct firmware_priv {
> + const char *name;   /* Filename */
> + u32 offset; /* Offset of reading a file */
> +};
> +
> +static struct device_location default_locations[] = {
> + {
> + .name = "mmc",
> + .devpart = "0:1",
> + },
> + {
> + .name = "usb",
> + .devpart = "0:1",
> + },
> + {
> + .name = "sata",
> + .devpart = "0:1",
> + },

How can this load from UBI if it's not listed here ?

> +};
> +
> +/* USB build is not supported yet in SPL */
> +#ifndef CONFIG_SPL_BUILD
> +#ifdef CONFIG_USB_STORAGE
> +static int init_usb(void)
> +{
> + int err;
> +
> + err = usb_init();
> + if (err)
> + return err;
> +
> +#ifndef CONFIG_DM_USB
> + err = usb_stor_scan(1);

mode = 0 I think, we don't need this verbose output.

> + if (err)
> + return err;
> +#endif
> +
> + return err;
> +}
> +#else
> +static int init_usb(void)
> +{
> + debug("Error: Cannot load flash image: no USB support\n");
> + return -ENOSYS;
> +}
> +#endif
> +#endif
> +
> +#ifdef CONFIG_SATA
> +static int init_storage_sata(void)
> +{
> + return sata_probe(0);

Shouldn't the sata device number be pulled from devpart in
default_locations table ?

> +}
> +#else
> +static int init_storage_sata(void)
> +{
> + debug("Error: Cannot load image: no SATA support\n");
> + return -ENOSYS;
> +}
> +#endif
> +
> +#ifdef CONFIG_CMD_UBIFS
> +static int mount_ubifs(struct device_location *location)
> +{
> + int ret;
> + char cmd[32];
> +
> + if (ret = ubi_part(location->mtdpart, NULL)) {
> + debug("Cannot find mtd partition %s\n", location->mtdpart);
> + return ret;
> + }
> +
> + return cmd_ubifs_mount(location->ubivol);
> +}
> +
> +static int umount_ubifs(void)
> +{
> + return cmd_ubifs_umount();
> +}
> +#else
> +static int mount_ubifs(struct device_location *location)
> +{
> + debug("Error: Cannot load image: no UBIFS support\n");
> + return -ENOSYS;
> +}
> +#endif
> +
> +#if defined(CONFIG_SPL_MMC_SUPPORT) && defined(CONFIG_SPL_BUILD)
> +__weak int init_mmc(void)
> +{
> + /* Just for the case MMC is not yet initialized */
> + struct mmc *mmc = NULL;
> + int err;
> +
> +#ifdef CONFIG_SPL
> + spl_mmc_find_device(, spl_boot_device());
> +#else
> + debug("#define CONFIG_SPL is required or overrriding %s\n",
> +   __func__);

This can be a compile-time error, maybe ?

> + return -ENOENT;
> +#endif
> +
> + err = mmc_init(mmc);
> + if (err) {
> + debug("spl: mmc init failed with error: %d\n", err);
> + return err;
> + }
> +
> + return err;
> +}
> +#else
> +__weak int init_mmc(void)
> +{
> + /* Expect somewhere already initialize MMC */
> + return 0;
> +}
> +#endif

[...]

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


[U-Boot] [PATCH] RPi: Add myself as board maintainer

2018-02-15 Thread Alexander Graf
Commit 958d55f26ce ("MAINTAINERS: Take over BCM2835 maintainership") put
me in as maintainer for the RPi soc, but forgot to update the board
MAINTIANERS file.

Add me there too.

Signed-off-by: Alexander Graf 
---
 board/raspberrypi/rpi/MAINTAINERS | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/raspberrypi/rpi/MAINTAINERS 
b/board/raspberrypi/rpi/MAINTAINERS
index a7eb3654bb..cce1a7ad76 100644
--- a/board/raspberrypi/rpi/MAINTAINERS
+++ b/board/raspberrypi/rpi/MAINTAINERS
@@ -1,6 +1,6 @@
 RPI BOARD
-#M:Stephen Warren 
-S: Orphaned (Since 2017-07)
+M: Alexander Graf 
+S: Maintained
 F: board/raspberrypi/rpi/
 F: include/configs/rpi.h
 F: configs/rpi_*defconfig
-- 
2.12.3

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


Re: [U-Boot] [PATCH v2] Revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Marek Vasut
On 02/15/2018 03:44 PM, Tom Rini wrote:
> On Thu, Feb 15, 2018 at 03:33:29PM +0100, Lukasz Majewski wrote:
>> Hi Fabio,
>>
>>> This reverts commit d695d6627803dbb78a226e04b0436a01633a9936.
>>>
>>> Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak spl_boot_mode()
>>> function") breaks the boot on several i.MX6 boards,
>>> such as cuboxi and wandboard:
>>>
>>> U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33
>>> +1300) Trying to boot from MMC1
>>> Failed to mount ext2 filesystem...
>>> spl_load_image_ext: ext4fs mount err - 0
>>>
>>> Revert it so that we can boot U-Boot again.
>>
>> This is IMHO throwing the baby with the batch
> 
> I kind of feel we need to revert this too, sorry.  I'm also worried that
> we've broken some of the other platforms that also have funky if-else
> expected logic, and we'll be at the point soon where we have enough
> platforms that need to override the spl_boot_mode func with what they
> had before that it's not a huge win.

Maybe we should go with the ordering option instead ? But that'd
probably be something for 2018.05 .

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


Re: [U-Boot] [PATCH v2] Revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Tom Rini
On Thu, Feb 15, 2018 at 03:33:29PM +0100, Lukasz Majewski wrote:
> Hi Fabio,
> 
> > This reverts commit d695d6627803dbb78a226e04b0436a01633a9936.
> > 
> > Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak spl_boot_mode()
> > function") breaks the boot on several i.MX6 boards,
> > such as cuboxi and wandboard:
> > 
> > U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33
> > +1300) Trying to boot from MMC1
> > Failed to mount ext2 filesystem...
> > spl_load_image_ext: ext4fs mount err - 0
> > 
> > Revert it so that we can boot U-Boot again.
> 
> This is IMHO throwing the baby with the batch

I kind of feel we need to revert this too, sorry.  I'm also worried that
we've broken some of the other platforms that also have funky if-else
expected logic, and we'll be at the point soon where we have enough
platforms that need to override the spl_boot_mode func with what they
had before that it's not a huge win.

-- 
Tom


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


Re: [U-Boot] [PATCH v2] Revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Fabio Estevam
Hi Lukasz,

On Thu, Feb 15, 2018 at 12:33 PM, Lukasz Majewski  wrote:

> 2. If you agree - I can prepare the code to put imx code there they
> were before this patch (to override the __weak function).
> In that way we would got the cleanup for other archs in.

As we are in rc2 I prefer if we go with the imx partial revert.

Just sent a v3 as suggested.

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


Re: [U-Boot] [PATCH v2] Revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Lukasz Majewski
Hi Stefano,

> Hi Heiko,
> 
> On 15/02/2018 13:14, Fabio Estevam wrote:
> > This reverts commit d695d6627803dbb78a226e04b0436a01633a9936.
> > 
> > Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak
> > spl_boot_mode() function") breaks the boot on several i.MX6 boards,
> > such as cuboxi and wandboard:
> > 
> > U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33
> > +1300) Trying to boot from MMC1
> > Failed to mount ext2 filesystem...
> > spl_load_image_ext: ext4fs mount err - 0
> > 
> > Revert it so that we can boot U-Boot again.
> >   
> 
> Can this the cause of the issue on the wandboard you told me
> yesterday ? Wasn't it due to CONFIG_SPL_EXT_SUPPORT ?

Yes, exactly - those boards have CONFIG_SPL_EXT_SUPPORT defined, but
want to first use RAW booting (normally as default) and then boot
from EXT.

This is somewhat priority inversion.

I've explained it in detail in the other reply to this issue and in 
http://patchwork.ozlabs.org/patch/868854/


> 
> Just to collect and understand myself if issues are connected...
> 
> Best regards,
> Stefano
> 
> > Reported-by: Jonathan Gray 
> > Signed-off-by: Fabio Estevam 
> > ---
> > Changes since v1:
> > - Fix typo in commit log: "breaks the boot" instead of "breaks the
> > build"
> > 
> >  arch/arm/cpu/arm1136/mx35/generic.c   | 21
> > + arch/arm/cpu/armv7/ls102xa/spl.c  |
> > 17 + arch/arm/cpu/armv8/fsl-layerscape/spl.c   | 17
> > + arch/arm/cpu/armv8/zynqmp/spl.c   | 14
> > ++ arch/arm/mach-at91/spl.c  | 15
> > +++ arch/arm/mach-davinci/spl.c   |  5 +
> >  arch/arm/mach-imx/spl.c   | 23
> > +++ arch/arm/mach-mvebu/spl.c
> > |  7 +++ arch/arm/mach-rockchip/rk3188-board-spl.c |  5 +
> >  arch/arm/mach-rockchip/rk3288-board-spl.c |  5 +
> >  arch/arm/mach-rockchip/rk3368-board-spl.c |  5 +
> >  arch/arm/mach-rockchip/rk3399-board-spl.c |  5 +
> >  arch/arm/mach-socfpga/spl.c   | 11 +++
> >  arch/arm/mach-sunxi/board.c   |  6 ++
> >  arch/arm/mach-zynq/spl.c  |  7 +++
> >  common/spl/spl_mmc.c  | 11 ---
> >  16 files changed, 163 insertions(+), 11 deletions(-)
> > 
> > diff --git a/arch/arm/cpu/arm1136/mx35/generic.c
> > b/arch/arm/cpu/arm1136/mx35/generic.c index 4dcfc72..5297d62 100644
> > --- a/arch/arm/cpu/arm1136/mx35/generic.c
> > +++ b/arch/arm/cpu/arm1136/mx35/generic.c
> > @@ -524,3 +524,24 @@ u32 spl_boot_device(void)
> >  
> > return BOOT_DEVICE_NONE;
> >  }
> > +
> > +#ifdef CONFIG_SPL_BUILD
> > +u32 spl_boot_mode(const u32 boot_device)
> > +{
> > +   switch (spl_boot_device()) {
> > +   case BOOT_DEVICE_MMC1:
> > +#ifdef CONFIG_SPL_FAT_SUPPORT
> > +   return MMCSD_MODE_FS;
> > +#else
> > +   return MMCSD_MODE_RAW;
> > +#endif
> > +   break;
> > +   case BOOT_DEVICE_NAND:
> > +   return 0;
> > +   break;
> > +   default:
> > +   puts("spl: ERROR:  unsupported device\n");
> > +   hang();
> > +   }
> > +}
> > +#endif
> > diff --git a/arch/arm/cpu/armv7/ls102xa/spl.c
> > b/arch/arm/cpu/armv7/ls102xa/spl.c index 1e4a164..1246eed 100644
> > --- a/arch/arm/cpu/armv7/ls102xa/spl.c
> > +++ b/arch/arm/cpu/armv7/ls102xa/spl.c
> > @@ -14,3 +14,20 @@ u32 spl_boot_device(void)
> >  #endif
> > return BOOT_DEVICE_NAND;
> >  }
> > +
> > +u32 spl_boot_mode(const u32 boot_device)
> > +{
> > +   switch (spl_boot_device()) {
> > +   case BOOT_DEVICE_MMC1:
> > +#ifdef CONFIG_SPL_FAT_SUPPORT
> > +   return MMCSD_MODE_FS;
> > +#else
> > +   return MMCSD_MODE_RAW;
> > +#endif
> > +   case BOOT_DEVICE_NAND:
> > +   return 0;
> > +   default:
> > +   puts("spl: error: unsupported device\n");
> > +   hang();
> > +   }
> > +}
> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
> > b/arch/arm/cpu/armv8/fsl-layerscape/spl.c index 3a74040..4093d15
> > 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
> > @@ -26,6 +26,23 @@ u32 spl_boot_device(void)
> > return 0;
> >  }
> >  
> > +u32 spl_boot_mode(const u32 boot_device)
> > +{
> > +   switch (spl_boot_device()) {
> > +   case BOOT_DEVICE_MMC1:
> > +#ifdef CONFIG_SPL_FAT_SUPPORT
> > +   return MMCSD_MODE_FS;
> > +#else
> > +   return MMCSD_MODE_RAW;
> > +#endif
> > +   case BOOT_DEVICE_NAND:
> > +   return 0;
> > +   default:
> > +   puts("spl: error: unsupported device\n");
> > +   hang();
> > +   }
> > +}
> > +
> >  #ifdef CONFIG_SPL_BUILD
> >  
> >  void spl_board_init(void)
> > diff --git a/arch/arm/cpu/armv8/zynqmp/spl.c
> > b/arch/arm/cpu/armv8/zynqmp/spl.c index 0bfa5c1..bc7313a 100644
> > --- a/arch/arm/cpu/armv8/zynqmp/spl.c
> > +++ b/arch/arm/cpu/armv8/zynqmp/spl.c
> > @@ -115,6 +115,20 @@ u32 

Re: [U-Boot] [PATCH v2] Revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Lukasz Majewski
Hi Fabio,

> This reverts commit d695d6627803dbb78a226e04b0436a01633a9936.
> 
> Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak spl_boot_mode()
> function") breaks the boot on several i.MX6 boards,
> such as cuboxi and wandboard:
> 
> U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33
> +1300) Trying to boot from MMC1
> Failed to mount ext2 filesystem...
> spl_load_image_ext: ext4fs mount err - 0
> 
> Revert it so that we can boot U-Boot again.

This is IMHO throwing the baby with the batch

The problem is with legacy iMX6 boards, which use MMCSD_MODE_RAW to try
booting, even when they use CONFIG_SPL_EXT_SUPPORT for the boot.

On those boards we do have following boot order:

if CONFIG_SPL_FAT_SUPPORT {
return MMCSD_MODE_FS
} else {
return MODE_RAW
}

And thn in the spl_load_image() they first try MODE_RAW and if failed,
then MMCSD_MODE_EXT


So the (implicit) boot order is as follows:

1. SPL_FAT

2. RAW

3. If RAW fails, use EXT.


What I've think of:

1. Either implement the proper boot order (or just stick to the correct
SPL_EXT_SUPPORT).

2. If you agree - I can prepare the code to put imx code there they
were before this patch (to override the __weak function).
In that way we would got the cleanup for other archs in.



> 
> Reported-by: Jonathan Gray 
> Signed-off-by: Fabio Estevam 
> ---
> Changes since v1:
> - Fix typo in commit log: "breaks the boot" instead of "breaks the
> build"
> 
>  arch/arm/cpu/arm1136/mx35/generic.c   | 21 +
>  arch/arm/cpu/armv7/ls102xa/spl.c  | 17 +
>  arch/arm/cpu/armv8/fsl-layerscape/spl.c   | 17 +
>  arch/arm/cpu/armv8/zynqmp/spl.c   | 14 ++
>  arch/arm/mach-at91/spl.c  | 15 +++
>  arch/arm/mach-davinci/spl.c   |  5 +
>  arch/arm/mach-imx/spl.c   | 23
> +++ arch/arm/mach-mvebu/spl.c |
> 7 +++ arch/arm/mach-rockchip/rk3188-board-spl.c |  5 +
>  arch/arm/mach-rockchip/rk3288-board-spl.c |  5 +
>  arch/arm/mach-rockchip/rk3368-board-spl.c |  5 +
>  arch/arm/mach-rockchip/rk3399-board-spl.c |  5 +
>  arch/arm/mach-socfpga/spl.c   | 11 +++
>  arch/arm/mach-sunxi/board.c   |  6 ++
>  arch/arm/mach-zynq/spl.c  |  7 +++
>  common/spl/spl_mmc.c  | 11 ---
>  16 files changed, 163 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm1136/mx35/generic.c
> b/arch/arm/cpu/arm1136/mx35/generic.c index 4dcfc72..5297d62 100644
> --- a/arch/arm/cpu/arm1136/mx35/generic.c
> +++ b/arch/arm/cpu/arm1136/mx35/generic.c
> @@ -524,3 +524,24 @@ u32 spl_boot_device(void)
>  
>   return BOOT_DEVICE_NONE;
>  }
> +
> +#ifdef CONFIG_SPL_BUILD
> +u32 spl_boot_mode(const u32 boot_device)
> +{
> + switch (spl_boot_device()) {
> + case BOOT_DEVICE_MMC1:
> +#ifdef CONFIG_SPL_FAT_SUPPORT
> + return MMCSD_MODE_FS;
> +#else
> + return MMCSD_MODE_RAW;
> +#endif
> + break;
> + case BOOT_DEVICE_NAND:
> + return 0;
> + break;
> + default:
> + puts("spl: ERROR:  unsupported device\n");
> + hang();
> + }
> +}
> +#endif
> diff --git a/arch/arm/cpu/armv7/ls102xa/spl.c
> b/arch/arm/cpu/armv7/ls102xa/spl.c index 1e4a164..1246eed 100644
> --- a/arch/arm/cpu/armv7/ls102xa/spl.c
> +++ b/arch/arm/cpu/armv7/ls102xa/spl.c
> @@ -14,3 +14,20 @@ u32 spl_boot_device(void)
>  #endif
>   return BOOT_DEVICE_NAND;
>  }
> +
> +u32 spl_boot_mode(const u32 boot_device)
> +{
> + switch (spl_boot_device()) {
> + case BOOT_DEVICE_MMC1:
> +#ifdef CONFIG_SPL_FAT_SUPPORT
> + return MMCSD_MODE_FS;
> +#else
> + return MMCSD_MODE_RAW;
> +#endif
> + case BOOT_DEVICE_NAND:
> + return 0;
> + default:
> + puts("spl: error: unsupported device\n");
> + hang();
> + }
> +}
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
> b/arch/arm/cpu/armv8/fsl-layerscape/spl.c index 3a74040..4093d15
> 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
> @@ -26,6 +26,23 @@ u32 spl_boot_device(void)
>   return 0;
>  }
>  
> +u32 spl_boot_mode(const u32 boot_device)
> +{
> + switch (spl_boot_device()) {
> + case BOOT_DEVICE_MMC1:
> +#ifdef CONFIG_SPL_FAT_SUPPORT
> + return MMCSD_MODE_FS;
> +#else
> + return MMCSD_MODE_RAW;
> +#endif
> + case BOOT_DEVICE_NAND:
> + return 0;
> + default:
> + puts("spl: error: unsupported device\n");
> + hang();
> + }
> +}
> +
>  #ifdef CONFIG_SPL_BUILD
>  
>  void spl_board_init(void)
> diff --git a/arch/arm/cpu/armv8/zynqmp/spl.c
> b/arch/arm/cpu/armv8/zynqmp/spl.c index 0bfa5c1..bc7313a 100644
> --- a/arch/arm/cpu/armv8/zynqmp/spl.c
> 

Re: [U-Boot] How to test new bootloaders on Jetson TX1?

2018-02-15 Thread Mikko Perttunen

On 15.02.2018 15:25, Andreas Färber wrote:

Hi Mikko,

Am 15.02.2018 um 08:56 schrieb Mikko Perttunen:

In the cboot + U-Boot combination, cboot loads U-Boot from the usual
kernel partition (LNX or kernel depending on system), so flashing U-Boot
there should do the trick. I believe this did indeed change in some L4T
version, so the wiki page needs to be updated. Tom should know more
about this.


Thanks for explaining.

The LNX partition is getting a boot.img - what is the relation to the
four U-Boot files? flash.sh source is not really helping here.


cboot is only capable of booting Android .img's so the U-Boot binary 
(u-boot-dtb.bin according ton Jon) is packaged as one using mkbootimg or 
similar - I expect flash.sh to do this automatically.




Might any changes to RP1 and/or DTB partitions be necessary to match my
newer U-Boot, or does U-Boot use an internal .dtb these days?


My understanding is that it uses an internal .dtb.



Is there any more efficient way to flash just U-Boot? -k LNX possibly?


That might work. Jon should know the details.



I had played with the -L option before (which mentions u-boot-dtb.bin),
but recall it ran into some form of checksum error on boot when passing
it my file...


I expect Varun to know the details about ATF, but I'll check if I can
find some answer myself.


Thanks again for your efforts.


I found out that ATF and optionally a secure OS (Trusty usually) are 
contained in the file tos.img. The image contains a padded header, 
followed by bl31.bin and the secure OS binary concatenated.


The header format should be pretty straightforward to reverse-engineer 
(need to change some fields specifying lengths), but I'll ask around if 
we can get a script to generate it released.


Cheers,
Mikko



Regards,
Andreas


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


[U-Boot] [PATCH v2 11/13] Rename CONFIG_SYS_BOOTCOUNT_ADDR to BOOTCOUNT_ADDR

2018-02-15 Thread Alex Kiernan
Remove CONFIG_SYS_BOOTCOUNT_ADDR from Kconfig.

Signed-off-by: Alex Kiernan 
---

Changes in v2: None

 drivers/bootcount/Kconfig | 10 ++
 drivers/bootcount/bootcount.c | 16 
 drivers/bootcount/bootcount_davinci.c |  4 ++--
 drivers/bootcount/bootcount_ext.c |  8 
 drivers/bootcount/bootcount_i2c.c |  6 +++---
 include/configs/brppt1.h  |  2 +-
 include/configs/calimain.h|  2 +-
 include/configs/dh_imx6.h |  2 +-
 include/configs/ge_bx50v3.h   |  2 +-
 include/configs/highbank.h|  2 +-
 include/configs/ids8313.h |  2 +-
 include/configs/km/kmp204x-common.h   |  2 +-
 include/configs/mx53ppd.h |  2 +-
 include/configs/socfpga_is1.h |  2 +-
 include/configs/socfpga_sr1500.h  |  2 +-
 include/configs/ti_am335x_common.h|  2 +-
 include/configs/tqma6_wru4.h  |  2 +-
 include/configs/x600.h|  2 +-
 18 files changed, 36 insertions(+), 34 deletions(-)

diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index 583d6a6..ce26e38 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -19,9 +19,9 @@ choice
 config BOOTCOUNT_GENERIC
bool "Generic default boot counter"
help
- Generic bootcount stored at SYS_BOOTCOUNT_ADDR.
+ Generic bootcount stored at BOOTCOUNT_ADDR.
 
- SYS_BOOTCOUNT_ADDR:
+ BOOTCOUNT_ADDR:
Set to the address where the bootcount and bootcount magic
will be stored.
 
@@ -31,6 +31,9 @@ config BOOTCOUNT_EXT
  Add support for maintaining boot count in a file on an EXT
  filesystem.
 
+ BOOTCOUNT_ADDR
+   Set to the RAM address used for read and write.
+
 config BOOTCOUNT_AM33XX
bool "Boot counter in AM33XX RTC IP block"
depends on AM33XX || SOC_DA8XX
@@ -62,8 +65,7 @@ config BOOTCOUNT_I2C
help
  Enable support for the bootcounter on an i2c (like RTC) device.
  CONFIG_SYS_I2C_RTC_ADDR = i2c chip address
- CONFIG_SYS_BOOTCOUNT_ADDR = i2c addr which is used for
- the bootcounter.
+ BOOTCOUNT_ADDR = i2c addr which is used for the bootcounter.
  CONFIG_BOOTCOUNT_ALEN = address len
 
 config BOOTCOUNT_AT91
diff --git a/drivers/bootcount/bootcount.c b/drivers/bootcount/bootcount.c
index 8b499fe..82ef426 100644
--- a/drivers/bootcount/bootcount.c
+++ b/drivers/bootcount/bootcount.c
@@ -9,24 +9,24 @@
 #include 
 
 /*
- * Only override CONFIG_SYS_BOOTCOUNT_ADDR if not already defined. This
+ * Only override BOOTCOUNT_ADDR if not already defined. This
  * way, some boards can define it directly in their config header.
  */
-#if !defined(CONFIG_SYS_BOOTCOUNT_ADDR)
+#if !defined(BOOTCOUNT_ADDR)
 
 #if defined(CONFIG_QE)
 #include 
-#define CONFIG_SYS_BOOTCOUNT_ADDR  (CONFIG_SYS_IMMR + 0x11 + \
+#define BOOTCOUNT_ADDR (CONFIG_SYS_IMMR + 0x11 + \
 QE_MURAM_SIZE - 2 * sizeof(u32))
 #endif /* defined(CONFIG_QE) */
 
-#endif /* !defined(CONFIG_SYS_BOOTCOUNT_ADDR) */
+#endif /* !defined(BOOTCOUNT_ADDR) */
 
 /* Now implement the generic default functions */
-#if defined(CONFIG_SYS_BOOTCOUNT_ADDR)
+#if defined(BOOTCOUNT_ADDR)
 __weak void bootcount_store(ulong a)
 {
-   void *reg = (void *)CONFIG_SYS_BOOTCOUNT_ADDR;
+   void *reg = (void *)BOOTCOUNT_ADDR;
 
 #if defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD)
raw_bootcount_store(reg, (BOOTCOUNT_MAGIC & 0x) | a);
@@ -38,7 +38,7 @@ __weak void bootcount_store(ulong a)
 
 __weak ulong bootcount_load(void)
 {
-   void *reg = (void *)CONFIG_SYS_BOOTCOUNT_ADDR;
+   void *reg = (void *)BOOTCOUNT_ADDR;
 
 #if defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD)
u32 tmp = raw_bootcount_load(reg);
@@ -54,4 +54,4 @@ __weak ulong bootcount_load(void)
return raw_bootcount_load(reg);
 #endif /* defined(CONFIG_SYS_BOOTCOUNT_SINGLEWORD) */
 }
-#endif /* defined(CONFIG_SYS_BOOTCOUNT_ADDR) */
+#endif /* defined(BOOTCOUNT_ADDR) */
diff --git a/drivers/bootcount/bootcount_davinci.c 
b/drivers/bootcount/bootcount_davinci.c
index 17829be..d00fd7a 100644
--- a/drivers/bootcount/bootcount_davinci.c
+++ b/drivers/bootcount/bootcount_davinci.c
@@ -15,7 +15,7 @@
 void bootcount_store(ulong a)
 {
struct davinci_rtc *reg =
-   (struct davinci_rtc *)CONFIG_SYS_BOOTCOUNT_ADDR;
+   (struct davinci_rtc *)BOOTCOUNT_ADDR;
 
/*
 * write RTC kick registers to enable write
@@ -32,7 +32,7 @@ ulong bootcount_load(void)
 {
unsigned long val;
struct davinci_rtc *reg =
-   (struct davinci_rtc *)CONFIG_SYS_BOOTCOUNT_ADDR;
+   (struct davinci_rtc *)BOOTCOUNT_ADDR;
 
val = raw_bootcount_load(>scratch2);
if ((val & 0x) != (BOOTCOUNT_MAGIC & 0x))
diff --git 

Re: [U-Boot] How to test new bootloaders on Jetson TX1?

2018-02-15 Thread Jon Hunter

On 15/02/18 12:32, Andreas Färber wrote:
> Am 15.02.2018 um 10:22 schrieb Jon Hunter:
>> On 15/02/18 01:51, Andreas Färber wrote:
>>> I would like to test the latest version of U-Boot on the Jetson TX1.
> [...]
>>> Here's what I have tried:
>>>
>>> $ sudo ./flash.sh p2371-2180-devkit mmcblk0p1
>> This should work. Which u-boot binary are you copying and where are you
>> copying it?
>>
>> I copy the u-boot-dtb.bin over u-boot.bin in the L4T directory
>> Linux_for_Tegra/bootloader/t186ref/p2771-/500/u-boot.bin.
> 
> I downloaded the .rpm from
> https://build.opensuse.org/package/show/hardware:boot/u-boot-p2371-2180
> extracting all of u-boot, u-boot.bin, u-boot.dtb and u-boot-dtb.bin to
> bootloader/t210ref/p2371-2180/ - and as described it makes a difference
> in that it then ceases to boot to a U-Boot prompt.

Sorry, looks like I mixed TX1 and TX2. I see you are using TX1. However,
I believe you are still booting the wrong u-boot file.

If you look at the p2371-2180-devkit.conf you will see that it has ...

 DFLT_KERNEL_IMAGE="bootloader/${target_board}/p2371-2180/u-boot.bin

For using the upstream u-boot, we need to use the u-boot-dtb.bin and not
the u-boot.bin. So you can either ...

1. Update the p2371-2180-devkit.conf to use the u-boot-dtb.bin that you
copied.
2. Move the u-boot-dtb.bin from your rpm to
bootloader/t210ref/p2371-2180/u-boot.bin.

Cheers
Jon

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


[U-Boot] [PATCH v2 00/13] Convert bootcount drivers to Kconfig

2018-02-15 Thread Alex Kiernan

This patch set converts bootcount drivers to Kconfig, it also merges
CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMIT.

Green Travis build:

https://travis-ci.org/akiernan/u-boot/builds/341811354

This patch has been applied on top of u-boot/master:
SHA1: 7d531e8a4f9265ade08bc1d35135ff381a15

This patch series shall be applied on top of:
[U-Boot,1/2] Convert CONFIG_BOOTCOUNT_LIMIT to Kconfig
http://patchwork.ozlabs.org/patch/871585/

[U-Boot,2/2] Convert CONFIG_SYS_BOOTCOUNT_SINGLEWORD to Kconfig
http://patchwork.ozlabs.org/patch/871586/

Changes in v2:
- Fix erroneously removed line in README
- Convert CONFIG_BOOTCOUNT_EXT too - it had only been partially done
- Reword CONFIG_BOOTCOUNT_DRAM
- Update README for AT91 driver
- Remove CONFIG_BOOTCOUNT_LIMIT and CONFIG_SYS_BOOTCOUNT_SINGLEWORD
  from whitelist
- Rename CONFIG_SYS_BOOTCOUNT_ADDR to BOOTCOUNT_ADDR and remove from
  Kconfig
- Migrate CONFIG_BOOTCOUNT_ALEN to Kconfig

Alex Kiernan (13):
  Merge CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMIT
  Prepare for multiple bootcount drivers
  Convert CONFIG_BOOTCOUNT_AM33XX to Kconfig
  Convert CONFIG_BOOTCOUNT_ENV to Kconfig
  Convert CONFIG_BOOTCOUNT_RAM to Kconfig
  Convert CONFIG_BOOTCOUNT_I2C to Kconfig
  Convert CONFIG_BOOTCOUNT_EXT to Kconfig
  Integrate AT91 bootcount driver
  Migrate generic bootcount to Kconfig
  Remove SYS_BOOTCOUNT_ADDR from Kconfig
  Rename CONFIG_SYS_BOOTCOUNT_ADDR to BOOTCOUNT_ADDR
  Migrate CONFIG_BOOTCOUNT_ALEN to Kconfig
  Remove CONFIG_SYS_BOOTCOUNT_SINGLEWORD

 README | 32 ---
 configs/draco_defconfig|  1 +
 configs/etamin_defconfig   |  1 +
 configs/ge_b450v3_defconfig|  2 +
 configs/ge_b650v3_defconfig|  2 +
 configs/ge_b850v3_defconfig|  2 +
 configs/ids8313_defconfig  |  1 +
 configs/km_kirkwood_128m16_defconfig   |  1 +
 configs/km_kirkwood_defconfig  |  1 +
 configs/km_kirkwood_pci_defconfig  |  1 +
 configs/kmcoge5un_defconfig|  1 +
 configs/kmnusa_defconfig   |  1 +
 configs/kmsugp1_defconfig  |  1 +
 configs/kmsuv31_defconfig  |  1 +
 configs/mgcoge3un_defconfig|  1 +
 configs/mx53ppd_defconfig  |  1 -
 configs/portl2_defconfig   |  1 +
 configs/pxm2_defconfig |  1 +
 configs/rastaban_defconfig |  1 +
 configs/rut_defconfig  |  1 +
 configs/theadorable_debug_defconfig|  1 +
 configs/thuban_defconfig   |  1 +
 drivers/bootcount/Kconfig  | 98 --
 drivers/bootcount/Makefile |  5 +-
 drivers/bootcount/bootcount.c  | 16 +++---
 drivers/bootcount/bootcount_davinci.c  |  4 +-
 drivers/bootcount/bootcount_ext.c  |  8 +--
 drivers/bootcount/bootcount_i2c.c  |  6 +--
 include/configs/am335x_evm.h   |  1 -
 include/configs/am335x_sl50.h  |  1 -
 include/configs/baltos.h   |  2 -
 include/configs/bav335x.h  |  1 -
 include/configs/brppt1.h   |  3 +-
 include/configs/calimain.h |  2 +-
 include/configs/chiliboard.h   |  1 -
 include/configs/dh_imx6.h  |  2 +-
 include/configs/ge_bx50v3.h|  6 +--
 include/configs/highbank.h |  2 +-
 include/configs/ids8313.h  |  4 +-
 include/configs/km/km_arm.h|  2 -
 include/configs/km/kmp204x-common.h|  2 +-
 include/configs/mx53ppd.h  |  2 +
 include/configs/siemens-am33x-common.h |  2 -
 include/configs/socfpga_is1.h  |  2 +-
 include/configs/socfpga_sr1500.h   |  2 +-
 include/configs/theadorable.h  |  1 -
 include/configs/ti_am335x_common.h |  2 +-
 include/configs/tqma6_wru4.h   |  2 +-
 include/configs/x600.h |  2 +-
 scripts/config_whitelist.txt   |  7 ---
 50 files changed, 127 insertions(+), 117 deletions(-)

-- 
2.7.4

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


Re: [U-Boot] [PATCH v2] Revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

2018-02-15 Thread Stefano Babic
Hi Heiko,

On 15/02/2018 13:14, Fabio Estevam wrote:
> This reverts commit d695d6627803dbb78a226e04b0436a01633a9936.
> 
> Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak spl_boot_mode()
> function") breaks the boot on several i.MX6 boards,
> such as cuboxi and wandboard:
> 
> U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33 +1300)
> Trying to boot from MMC1
> Failed to mount ext2 filesystem...
> spl_load_image_ext: ext4fs mount err - 0
> 
> Revert it so that we can boot U-Boot again.
> 

Can this the cause of the issue on the wandboard you told me yesterday ?
Wasn't it due to CONFIG_SPL_EXT_SUPPORT ?

Just to collect and understand myself if issues are connected...

Best regards,
Stefano

> Reported-by: Jonathan Gray 
> Signed-off-by: Fabio Estevam 
> ---
> Changes since v1:
> - Fix typo in commit log: "breaks the boot" instead of "breaks the build"
> 
>  arch/arm/cpu/arm1136/mx35/generic.c   | 21 +
>  arch/arm/cpu/armv7/ls102xa/spl.c  | 17 +
>  arch/arm/cpu/armv8/fsl-layerscape/spl.c   | 17 +
>  arch/arm/cpu/armv8/zynqmp/spl.c   | 14 ++
>  arch/arm/mach-at91/spl.c  | 15 +++
>  arch/arm/mach-davinci/spl.c   |  5 +
>  arch/arm/mach-imx/spl.c   | 23 +++
>  arch/arm/mach-mvebu/spl.c |  7 +++
>  arch/arm/mach-rockchip/rk3188-board-spl.c |  5 +
>  arch/arm/mach-rockchip/rk3288-board-spl.c |  5 +
>  arch/arm/mach-rockchip/rk3368-board-spl.c |  5 +
>  arch/arm/mach-rockchip/rk3399-board-spl.c |  5 +
>  arch/arm/mach-socfpga/spl.c   | 11 +++
>  arch/arm/mach-sunxi/board.c   |  6 ++
>  arch/arm/mach-zynq/spl.c  |  7 +++
>  common/spl/spl_mmc.c  | 11 ---
>  16 files changed, 163 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm1136/mx35/generic.c 
> b/arch/arm/cpu/arm1136/mx35/generic.c
> index 4dcfc72..5297d62 100644
> --- a/arch/arm/cpu/arm1136/mx35/generic.c
> +++ b/arch/arm/cpu/arm1136/mx35/generic.c
> @@ -524,3 +524,24 @@ u32 spl_boot_device(void)
>  
>   return BOOT_DEVICE_NONE;
>  }
> +
> +#ifdef CONFIG_SPL_BUILD
> +u32 spl_boot_mode(const u32 boot_device)
> +{
> + switch (spl_boot_device()) {
> + case BOOT_DEVICE_MMC1:
> +#ifdef CONFIG_SPL_FAT_SUPPORT
> + return MMCSD_MODE_FS;
> +#else
> + return MMCSD_MODE_RAW;
> +#endif
> + break;
> + case BOOT_DEVICE_NAND:
> + return 0;
> + break;
> + default:
> + puts("spl: ERROR:  unsupported device\n");
> + hang();
> + }
> +}
> +#endif
> diff --git a/arch/arm/cpu/armv7/ls102xa/spl.c 
> b/arch/arm/cpu/armv7/ls102xa/spl.c
> index 1e4a164..1246eed 100644
> --- a/arch/arm/cpu/armv7/ls102xa/spl.c
> +++ b/arch/arm/cpu/armv7/ls102xa/spl.c
> @@ -14,3 +14,20 @@ u32 spl_boot_device(void)
>  #endif
>   return BOOT_DEVICE_NAND;
>  }
> +
> +u32 spl_boot_mode(const u32 boot_device)
> +{
> + switch (spl_boot_device()) {
> + case BOOT_DEVICE_MMC1:
> +#ifdef CONFIG_SPL_FAT_SUPPORT
> + return MMCSD_MODE_FS;
> +#else
> + return MMCSD_MODE_RAW;
> +#endif
> + case BOOT_DEVICE_NAND:
> + return 0;
> + default:
> + puts("spl: error: unsupported device\n");
> + hang();
> + }
> +}
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c 
> b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
> index 3a74040..4093d15 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
> @@ -26,6 +26,23 @@ u32 spl_boot_device(void)
>   return 0;
>  }
>  
> +u32 spl_boot_mode(const u32 boot_device)
> +{
> + switch (spl_boot_device()) {
> + case BOOT_DEVICE_MMC1:
> +#ifdef CONFIG_SPL_FAT_SUPPORT
> + return MMCSD_MODE_FS;
> +#else
> + return MMCSD_MODE_RAW;
> +#endif
> + case BOOT_DEVICE_NAND:
> + return 0;
> + default:
> + puts("spl: error: unsupported device\n");
> + hang();
> + }
> +}
> +
>  #ifdef CONFIG_SPL_BUILD
>  
>  void spl_board_init(void)
> diff --git a/arch/arm/cpu/armv8/zynqmp/spl.c b/arch/arm/cpu/armv8/zynqmp/spl.c
> index 0bfa5c1..bc7313a 100644
> --- a/arch/arm/cpu/armv8/zynqmp/spl.c
> +++ b/arch/arm/cpu/armv8/zynqmp/spl.c
> @@ -115,6 +115,20 @@ u32 spl_boot_device(void)
>   return 0;
>  }
>  
> +u32 spl_boot_mode(const u32 boot_device)
> +{
> + switch (boot_device) {
> + case BOOT_DEVICE_RAM:
> + return 0;
> + case BOOT_DEVICE_MMC1:
> + case BOOT_DEVICE_MMC2:
> + return MMCSD_MODE_FS;
> + default:
> + puts("spl: error: unsupported device\n");
> + hang();
> + }
> +}
> +
>  #ifdef CONFIG_SPL_OS_BOOT
>  int spl_start_uboot(void)
>  {
> diff --git 

[U-Boot] [PATCH v2 06/13] board: freescale: ls1012aqds: enable network support on ls1012aqds

2018-02-15 Thread Calvin Johnson
This patch enables ethernet support for ls1012aqds.

Signed-off-by: Calvin Johnson 
Signed-off-by: Anjaneyulu Jagarlmudi 
---
Changes in v2:
-split from original patch "board: freescale: ls1012a: enable network
support on ls1012a platforms"
---
 board/freescale/ls1012aqds/Kconfig|  14 ++
 board/freescale/ls1012aqds/Makefile   |   1 +
 board/freescale/ls1012aqds/eth.c  | 304 ++
 board/freescale/ls1012aqds/ls1012aqds.c   |  97 +++-
 board/freescale/ls1012aqds/ls1012aqds_pfe.h   |  48 
 board/freescale/ls1012aqds/ls1012aqds_qixis.h |   2 +-
 6 files changed, 459 insertions(+), 7 deletions(-)
 create mode 100644 board/freescale/ls1012aqds/eth.c
 create mode 100644 board/freescale/ls1012aqds/ls1012aqds_pfe.h

diff --git a/board/freescale/ls1012aqds/Kconfig 
b/board/freescale/ls1012aqds/Kconfig
index fc9250b..e6c2aa2 100644
--- a/board/freescale/ls1012aqds/Kconfig
+++ b/board/freescale/ls1012aqds/Kconfig
@@ -12,6 +12,20 @@ config SYS_SOC
 config SYS_CONFIG_NAME
default "ls1012aqds"
 
+if FSL_PFE
+config SYS_LS_PFE_FW_ADDR
+   hex "Flash address of PFE firmware"
+   default 0x40a0
+
+config DDR_PFE_PHYS_BASEADDR
+   hex "PFE DDR physical base address"
+   default 0x0380
+
+config DDR_PFE_BASEADDR
+   hex "PFE DDR base address"
+   default 0x8380
+endif
+
 source "board/freescale/common/Kconfig"
 
 endif
diff --git a/board/freescale/ls1012aqds/Makefile 
b/board/freescale/ls1012aqds/Makefile
index 0b813f9..b18494a 100644
--- a/board/freescale/ls1012aqds/Makefile
+++ b/board/freescale/ls1012aqds/Makefile
@@ -5,3 +5,4 @@
 #
 
 obj-y += ls1012aqds.o
+obj-y += eth.o
diff --git a/board/freescale/ls1012aqds/eth.c b/board/freescale/ls1012aqds/eth.c
new file mode 100644
index 000..41d077a
--- /dev/null
+++ b/board/freescale/ls1012aqds/eth.c
@@ -0,0 +1,304 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "../common/qixis.h"
+#include 
+#include 
+#include "ls1012aqds_qixis.h"
+
+#define EMI_NONE   0xFF
+#define EMI1_RGMII 1
+#define EMI1_SLOT1 2
+#define EMI1_SLOT2 3
+
+#define DEFAULT_PFE_MDIO_NAME "PFE_MDIO"
+#define DEFAULT_PFE_MDIO1_NAME "PFE_MDIO1"
+
+static const char * const mdio_names[] = {
+   "NULL",
+   "LS1012AQDS_MDIO_RGMII",
+   "LS1012AQDS_MDIO_SLOT1",
+   "LS1012AQDS_MDIO_SLOT2",
+   "NULL",
+};
+
+static const char *ls1012aqds_mdio_name_for_muxval(u8 muxval)
+{
+   return mdio_names[muxval];
+}
+
+struct ls1012aqds_mdio {
+   u8 muxval;
+   struct mii_dev *realbus;
+};
+
+static void ls1012aqds_mux_mdio(u8 muxval)
+{
+   u8 brdcfg4;
+
+   if (muxval < 7) {
+   brdcfg4 = QIXIS_READ(brdcfg[4]);
+   brdcfg4 &= ~BRDCFG4_EMISEL_MASK;
+   brdcfg4 |= (muxval << BRDCFG4_EMISEL_SHIFT);
+   QIXIS_WRITE(brdcfg[4], brdcfg4);
+   }
+}
+
+static int ls1012aqds_mdio_read(struct mii_dev *bus, int addr, int devad,
+   int regnum)
+{
+   struct ls1012aqds_mdio *priv = bus->priv;
+
+   ls1012aqds_mux_mdio(priv->muxval);
+
+   return priv->realbus->read(priv->realbus, addr, devad, regnum);
+}
+
+static int ls1012aqds_mdio_write(struct mii_dev *bus, int addr, int devad,
+int regnum, u16 value)
+{
+   struct ls1012aqds_mdio *priv = bus->priv;
+
+   ls1012aqds_mux_mdio(priv->muxval);
+
+   return priv->realbus->write(priv->realbus, addr, devad, regnum, value);
+}
+
+static int ls1012aqds_mdio_reset(struct mii_dev *bus)
+{
+   struct ls1012aqds_mdio *priv = bus->priv;
+
+   if (priv->realbus->reset)
+   return priv->realbus->reset(priv->realbus);
+   else
+   return -1;
+}
+
+static int ls1012aqds_mdio_init(char *realbusname, u8 muxval)
+{
+   struct ls1012aqds_mdio *pmdio;
+   struct mii_dev *bus = mdio_alloc();
+
+   if (!bus) {
+   printf("Failed to allocate ls1012aqds MDIO bus\n");
+   return -1;
+   }
+
+   pmdio = malloc(sizeof(*pmdio));
+   if (!pmdio) {
+   printf("Failed to allocate ls1012aqds private data\n");
+   free(bus);
+   return -1;
+   }
+
+   bus->read = ls1012aqds_mdio_read;
+   bus->write = ls1012aqds_mdio_write;
+   bus->reset = ls1012aqds_mdio_reset;
+   sprintf(bus->name, ls1012aqds_mdio_name_for_muxval(muxval));
+
+   pmdio->realbus = miiphy_get_dev_by_name(realbusname);
+
+   if (!pmdio->realbus) {
+   printf("No bus with name %s\n", realbusname);
+   free(bus);
+   free(pmdio);
+   return -1;
+   }
+
+   pmdio->muxval 

[U-Boot] [PATCH v2 07/13] board: freescale: ls1012afrdm: enable network support on ls1012afrdm

2018-02-15 Thread Calvin Johnson
This patch enables ethernet support for ls1012afrdm.

Signed-off-by: Calvin Johnson 
Signed-off-by: Anjaneyulu Jagarlmudi 
---
Changes in v2:
-split from original patch "board: freescale: ls1012a: enable network
support on ls1012a platforms"
---
 board/freescale/ls1012afrdm/Kconfig   |  14 
 board/freescale/ls1012afrdm/Makefile  |   1 +
 board/freescale/ls1012afrdm/eth.c | 122 ++
 board/freescale/ls1012afrdm/ls1012afrdm.c |   5 --
 4 files changed, 137 insertions(+), 5 deletions(-)
 create mode 100644 board/freescale/ls1012afrdm/eth.c

diff --git a/board/freescale/ls1012afrdm/Kconfig 
b/board/freescale/ls1012afrdm/Kconfig
index 38bd91b..adb 100644
--- a/board/freescale/ls1012afrdm/Kconfig
+++ b/board/freescale/ls1012afrdm/Kconfig
@@ -12,6 +12,20 @@ config SYS_SOC
 config SYS_CONFIG_NAME
default "ls1012afrdm"
 
+if FSL_PFE
+config SYS_LS_PFE_FW_ADDR
+   hex "Flash address of PFE firmware"
+   default 0x40a0
+
+config DDR_PFE_PHYS_BASEADDR
+   hex "PFE DDR physical base address"
+   default 0x0380
+
+config DDR_PFE_BASEADDR
+   hex "PFE DDR base address"
+   default 0x8380
+endif
+
 source "board/freescale/common/Kconfig"
 
 endif
diff --git a/board/freescale/ls1012afrdm/Makefile 
b/board/freescale/ls1012afrdm/Makefile
index dbfa2ce..1364f22 100644
--- a/board/freescale/ls1012afrdm/Makefile
+++ b/board/freescale/ls1012afrdm/Makefile
@@ -5,3 +5,4 @@
 #
 
 obj-y += ls1012afrdm.o
+obj-y += eth.o
diff --git a/board/freescale/ls1012afrdm/eth.c 
b/board/freescale/ls1012afrdm/eth.c
new file mode 100644
index 000..4f4fff8
--- /dev/null
+++ b/board/freescale/ls1012afrdm/eth.c
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define DEFAULT_PFE_MDIO_NAME "PFE_MDIO"
+#define DEFAULT_PFE_MDIO1_NAME "PFE_MDIO1"
+
+#define MASK_ETH_PHY_RST   0x0100
+
+static inline void ls1012afrdm_reset_phy(void)
+{
+   unsigned int val;
+   struct ccsr_gpio *pgpio = (void *)(GPIO1_BASE_ADDR);
+
+   setbits_be32(>gpdir, MASK_ETH_PHY_RST);
+
+   val = in_be32(>gpdat);
+   setbits_be32(>gpdat, val & ~MASK_ETH_PHY_RST);
+   mdelay(10);
+
+   val = in_be32(>gpdat);
+   setbits_be32(>gpdat, val | MASK_ETH_PHY_RST);
+   mdelay(50);
+}
+
+int pfe_eth_board_init(struct udevice *dev)
+{
+   static int init_done;
+   struct mii_dev *bus;
+   struct pfe_mdio_info mac_mdio_info;
+   struct pfe_eth_dev *priv = dev_get_priv(dev);
+
+   if (!init_done) {
+   ls1012afrdm_reset_phy();
+
+   mac_mdio_info.reg_base = (void *)EMAC1_BASE_ADDR;
+   mac_mdio_info.name = DEFAULT_PFE_MDIO_NAME;
+
+   bus = pfe_mdio_init(_mdio_info);
+   if (!bus) {
+   printf("Failed to register mdio\n");
+   return -1;
+   }
+
+   init_done = 1;
+   }
+
+   if (priv->gemac_port) {
+   mac_mdio_info.reg_base = (void *)EMAC2_BASE_ADDR;
+   mac_mdio_info.name = DEFAULT_PFE_MDIO1_NAME;
+   bus = pfe_mdio_init(_mdio_info);
+   if (!bus) {
+   printf("Failed to register mdio\n");
+   return -1;
+   }
+   }
+
+   pfe_set_mdio(priv->gemac_port,
+miiphy_get_dev_by_name(DEFAULT_PFE_MDIO_NAME));
+   if (!priv->gemac_port)
+   /* MAC1 */
+   pfe_set_phy_address_mode(priv->gemac_port, EMAC1_PHY_ADDR,
+PHY_INTERFACE_MODE_SGMII);
+   else
+   /* MAC2 */
+   pfe_set_phy_address_mode(priv->gemac_port, EMAC2_PHY_ADDR,
+PHY_INTERFACE_MODE_SGMII);
+   return 0;
+}
+
+static struct pfe_eth_pdata pfe_pdata0 = {
+   .pfe_eth_pdata_mac = {
+   .iobase = (phys_addr_t)EMAC1_BASE_ADDR,
+   .phy_interface = 0,
+   },
+
+   .pfe_ddr_addr = {
+   .ddr_pfe_baseaddr = (void *)CONFIG_DDR_PFE_BASEADDR,
+   .ddr_pfe_phys_baseaddr = CONFIG_DDR_PFE_PHYS_BASEADDR,
+   },
+};
+
+static struct pfe_eth_pdata pfe_pdata1 = {
+   .pfe_eth_pdata_mac = {
+   .iobase = (phys_addr_t)EMAC2_BASE_ADDR,
+   .phy_interface = 1,
+   },
+
+   .pfe_ddr_addr = {
+   .ddr_pfe_baseaddr = (void *)CONFIG_DDR_PFE_BASEADDR,
+   .ddr_pfe_phys_baseaddr = CONFIG_DDR_PFE_PHYS_BASEADDR,
+   },
+};
+
+U_BOOT_DEVICE(ls1012a_pfe0) = {
+   .name = "pfe_eth",
+   .platdata = _pdata0,
+};
+
+U_BOOT_DEVICE(ls1012a_pfe1) = {
+   .name = "pfe_eth",

[U-Boot] [PATCH v2 12/13] armv8: layerscape: csu: enable ns access to PFE registers

2018-02-15 Thread Calvin Johnson
Enable all types of non-secure access to PFE block registers.

Signed-off-by: Calvin Johnson 
Signed-off-by: Anjaneyulu Jagarlmudi 
---
Changes in v2:
-Improved commit message to provide more description
---
 arch/arm/include/asm/arch-fsl-layerscape/ns_access.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/include/asm/arch-fsl-layerscape/ns_access.h 
b/arch/arm/include/asm/arch-fsl-layerscape/ns_access.h
index f46f1d8..fe97a93 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/ns_access.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/ns_access.h
@@ -26,6 +26,7 @@ enum csu_cslx_ind {
CSU_CSLX_PCIE3_IO,
CSU_CSLX_USB3 = 20,
CSU_CSLX_USB2,
+   CSU_CSLX_PFE = 23,
CSU_CSLX_SERDES = 32,
CSU_CSLX_QDMA,
CSU_CSLX_LPUART2,
@@ -105,6 +106,7 @@ static struct csu_ns_dev ns_dev[] = {
 {CSU_CSLX_PCIE3_IO, CSU_ALL_RW},
 {CSU_CSLX_USB3, CSU_ALL_RW},
 {CSU_CSLX_USB2, CSU_ALL_RW},
+{CSU_CSLX_PFE, CSU_ALL_RW},
 {CSU_CSLX_SERDES, CSU_ALL_RW},
 {CSU_CSLX_QDMA, CSU_ALL_RW},
 {CSU_CSLX_LPUART2, CSU_ALL_RW},
-- 
2.7.4

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


[U-Boot] [PATCH v2 13/13] configs: ls1012a: add pfe configuration for LS1012A

2018-02-15 Thread Calvin Johnson
Add configurations for PFE.

Signed-off-by: Calvin Johnson 
Signed-off-by: Anjaneyulu Jagarlmudi 
---
Changes in v2:
-Moved SYS_LS_PFE_FW_ADDR from pfe Kconfig to board Kconfigs
-Add "pfe stop" to ls1012a rdb, frdm and 2g5rdb config files
---
 configs/ls1012a2g5rdb_qspi_defconfig |  2 ++
 configs/ls1012afrdm_qspi_defconfig   |  2 ++
 configs/ls1012aqds_qspi_defconfig|  2 ++
 configs/ls1012ardb_qspi_defconfig|  2 ++
 drivers/net/Kconfig  |  1 +
 drivers/net/Makefile |  1 +
 drivers/net/pfe_eth/Kconfig  | 17 +
 drivers/net/pfe_eth/Makefile | 12 
 include/configs/ls1012a2g5rdb.h  |  2 +-
 include/configs/ls1012a_common.h |  6 +++---
 include/configs/ls1012afrdm.h|  9 -
 include/configs/ls1012aqds.h | 14 ++
 include/configs/ls1012ardb.h | 10 +-
 13 files changed, 74 insertions(+), 6 deletions(-)
 create mode 100644 drivers/net/pfe_eth/Kconfig
 create mode 100644 drivers/net/pfe_eth/Makefile

diff --git a/configs/ls1012a2g5rdb_qspi_defconfig 
b/configs/ls1012a2g5rdb_qspi_defconfig
index 140a4e1..a979211 100644
--- a/configs/ls1012a2g5rdb_qspi_defconfig
+++ b/configs/ls1012a2g5rdb_qspi_defconfig
@@ -30,7 +30,9 @@ CONFIG_DM=y
 CONFIG_DM_MMC=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
+CONFIG_DM_ETH=y
 CONFIG_NETDEVICES=y
+CONFIG_FSL_PFE=y
 CONFIG_SYS_NS16550=y
 CONFIG_DM_SPI=y
 CONFIG_USB=y
diff --git a/configs/ls1012afrdm_qspi_defconfig 
b/configs/ls1012afrdm_qspi_defconfig
index 060f073..d0bf081 100644
--- a/configs/ls1012afrdm_qspi_defconfig
+++ b/configs/ls1012afrdm_qspi_defconfig
@@ -28,8 +28,10 @@ CONFIG_DM=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
+CONFIG_DM_ETH=y
 CONFIG_NETDEVICES=y
 CONFIG_E1000=y
+CONFIG_FSL_PFE=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
diff --git a/configs/ls1012aqds_qspi_defconfig 
b/configs/ls1012aqds_qspi_defconfig
index 0435d51..40fbdd8 100644
--- a/configs/ls1012aqds_qspi_defconfig
+++ b/configs/ls1012aqds_qspi_defconfig
@@ -39,8 +39,10 @@ CONFIG_SCSI_AHCI=y
 CONFIG_DM_MMC=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
+CONFIG_DM_ETH=y
 CONFIG_NETDEVICES=y
 CONFIG_E1000=y
+CONFIG_FSL_PFE=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
diff --git a/configs/ls1012ardb_qspi_defconfig 
b/configs/ls1012ardb_qspi_defconfig
index ea28953..6262351 100644
--- a/configs/ls1012ardb_qspi_defconfig
+++ b/configs/ls1012ardb_qspi_defconfig
@@ -31,8 +31,10 @@ CONFIG_DM=y
 CONFIG_DM_MMC=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
+CONFIG_DM_ETH=y
 CONFIG_NETDEVICES=y
 CONFIG_E1000=y
+CONFIG_FSL_PFE=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index de1947c..f589978 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1,4 +1,5 @@
 source "drivers/net/phy/Kconfig"
+source "drivers/net/pfe_eth/Kconfig"
 
 config DM_ETH
bool "Enable Driver Model for Ethernet drivers"
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index ac5443c..102e65a 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -75,3 +75,4 @@ obj-$(CONFIG_FSL_MEMAC) += fm/memac_phy.o
 obj-$(CONFIG_VSC9953) += vsc9953.o
 obj-$(CONFIG_PIC32_ETH) += pic32_mdio.o pic32_eth.o
 obj-$(CONFIG_DWC_ETH_QOS) += dwc_eth_qos.o
+obj-$(CONFIG_FSL_PFE) += pfe_eth/
diff --git a/drivers/net/pfe_eth/Kconfig b/drivers/net/pfe_eth/Kconfig
new file mode 100644
index 000..6f99710
--- /dev/null
+++ b/drivers/net/pfe_eth/Kconfig
@@ -0,0 +1,17 @@
+menuconfig FSL_PFE
+   bool "Freescale PFE driver"
+   help
+ This driver provides support for Freescale PFE.
+
+if FSL_PFE
+
+config UTIL_PE_DISABLED
+   bool
+   help
+ Disable UTIL processor engine of PFE
+
+config SYS_FSL_PFE_ADDR
+   hex "PFE base address"
+   default 0x0400
+
+endif
diff --git a/drivers/net/pfe_eth/Makefile b/drivers/net/pfe_eth/Makefile
new file mode 100644
index 000..6b5248f
--- /dev/null
+++ b/drivers/net/pfe_eth/Makefile
@@ -0,0 +1,12 @@
+# Copyright 2015-2016 Freescale Semiconductor, Inc.
+# Copyright 2017 NXP
+#
+# SPDX-License-Identifier:GPL-2.0+
+
+# Layerscape PFE driver
+obj-y += pfe_cmd.o \
+pfe_driver.o   \
+pfe_eth.o  \
+pfe_firmware.o \
+pfe_hw.o   \
+pfe_mdio.o
diff --git a/include/configs/ls1012a2g5rdb.h b/include/configs/ls1012a2g5rdb.h
index 25df103..2d18f3c 100644
--- a/include/configs/ls1012a2g5rdb.h
+++ b/include/configs/ls1012a2g5rdb.h
@@ -110,7 +110,7 @@
 
 #undef CONFIG_BOOTCOMMAND
 #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
-#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \
+#define CONFIG_BOOTCOMMAND "pfe stop;run distro_bootcmd; run qspi_bootcmd; " \
   "env exists secureboot && esbc_halt;"
 #endif
 
diff --git a/include/configs/ls1012a_common.h 

[U-Boot] [PATCH v2 05/13] drivers: net: pfe_eth: LS1012A PFE headers

2018-02-15 Thread Calvin Johnson
Contains all the pfe header files.

Signed-off-by: Calvin Johnson 
Signed-off-by: Anjaneyulu Jagarlmudi 
---
Changes in v2:
-Add pfe_rx_done to clear bd after packet processing
-remove unused code under CONFIG_UTIL_PE_DISABLED
-Used BIT and GENMASK macros wherever applicable
-Removed generic definitions that pollutes namespace
-File names pfe.h renamed to pfe_hw.h to be more clear as it contains
 low level functions that directly access pfe hardware block
-Added pfe_dm_eth.h for new driver model
---
 include/dm/platform_data/pfe_dm_eth.h |  21 
 include/pfe_eth/pfe/cbus.h|  77 +++
 include/pfe_eth/pfe/cbus/bmu.h|  40 
 include/pfe_eth/pfe/cbus/class_csr.h  | 180 ++
 include/pfe_eth/pfe/cbus/emac.h   | 140 ++
 include/pfe_eth/pfe/cbus/gpi.h|  62 
 include/pfe_eth/pfe/cbus/hif.h|  68 +
 include/pfe_eth/pfe/cbus/hif_nocpy.h  |  40 
 include/pfe_eth/pfe/cbus/tmu_csr.h| 148 
 include/pfe_eth/pfe/cbus/util_csr.h   |  47 +
 include/pfe_eth/pfe/pfe_hw.h  | 163 ++
 include/pfe_eth/pfe_driver.h  |  59 +++
 include/pfe_eth/pfe_eth.h | 104 
 include/pfe_eth/pfe_firmware.h|  17 
 include/pfe_eth/pfe_mdio.h|  13 +++
 15 files changed, 1179 insertions(+)
 create mode 100644 include/dm/platform_data/pfe_dm_eth.h
 create mode 100644 include/pfe_eth/pfe/cbus.h
 create mode 100644 include/pfe_eth/pfe/cbus/bmu.h
 create mode 100644 include/pfe_eth/pfe/cbus/class_csr.h
 create mode 100644 include/pfe_eth/pfe/cbus/emac.h
 create mode 100644 include/pfe_eth/pfe/cbus/gpi.h
 create mode 100644 include/pfe_eth/pfe/cbus/hif.h
 create mode 100644 include/pfe_eth/pfe/cbus/hif_nocpy.h
 create mode 100644 include/pfe_eth/pfe/cbus/tmu_csr.h
 create mode 100644 include/pfe_eth/pfe/cbus/util_csr.h
 create mode 100644 include/pfe_eth/pfe/pfe_hw.h
 create mode 100644 include/pfe_eth/pfe_driver.h
 create mode 100644 include/pfe_eth/pfe_eth.h
 create mode 100644 include/pfe_eth/pfe_firmware.h
 create mode 100644 include/pfe_eth/pfe_mdio.h

diff --git a/include/dm/platform_data/pfe_dm_eth.h 
b/include/dm/platform_data/pfe_dm_eth.h
new file mode 100644
index 000..7943c67
--- /dev/null
+++ b/include/dm/platform_data/pfe_dm_eth.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __PFE_DM_ETH_H__
+#define __PFE_DM_ETH_H__
+#include 
+
+struct pfe_ddr_address {
+   void *ddr_pfe_baseaddr;
+   unsigned long ddr_pfe_phys_baseaddr;
+};
+
+struct pfe_eth_pdata {
+   struct eth_pdata pfe_eth_pdata_mac;
+   struct pfe_ddr_address pfe_ddr_addr;
+};
+#endif /* __PFE_DM_ETH_H__ */
diff --git a/include/pfe_eth/pfe/cbus.h b/include/pfe_eth/pfe/cbus.h
new file mode 100644
index 000..002041c
--- /dev/null
+++ b/include/pfe_eth/pfe/cbus.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _CBUS_H_
+#define _CBUS_H_
+
+#include "cbus/emac.h"
+#include "cbus/gpi.h"
+#include "cbus/bmu.h"
+#include "cbus/hif.h"
+#include "cbus/tmu_csr.h"
+#include "cbus/class_csr.h"
+#include "cbus/hif_nocpy.h"
+#include "cbus/util_csr.h"
+
+#define CBUS_BASE_ADDR ((void *)CONFIG_SYS_FSL_PFE_ADDR)
+
+/* PFE Control and Status Register Desciption */
+#define EMAC1_BASE_ADDR(CBUS_BASE_ADDR + 0x20)
+#define EGPI1_BASE_ADDR(CBUS_BASE_ADDR + 0x21)
+#define EMAC2_BASE_ADDR(CBUS_BASE_ADDR + 0x22)
+#define EGPI2_BASE_ADDR(CBUS_BASE_ADDR + 0x23)
+#define BMU1_BASE_ADDR (CBUS_BASE_ADDR + 0x24)
+#define BMU2_BASE_ADDR (CBUS_BASE_ADDR + 0x25)
+#define ARB_BASE_ADDR  (CBUS_BASE_ADDR + 0x26)
+#define DDR_CONFIG_BASE_ADDR   (CBUS_BASE_ADDR + 0x27)
+#define HIF_BASE_ADDR  (CBUS_BASE_ADDR + 0x28)
+#define HGPI_BASE_ADDR (CBUS_BASE_ADDR + 0x29)
+#define LMEM_BASE_ADDR (CBUS_BASE_ADDR + 0x30)
+#define LMEM_SIZE  0x1
+#define LMEM_END   (LMEM_BASE_ADDR + LMEM_SIZE)
+#define TMU_CSR_BASE_ADDR  (CBUS_BASE_ADDR + 0x31)
+#define CLASS_CSR_BASE_ADDR(CBUS_BASE_ADDR + 0x32)
+#define HIF_NOCPY_BASE_ADDR(CBUS_BASE_ADDR + 0x35)
+#define UTIL_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x36)
+#define CBUS_GPT_BASE_ADDR (CBUS_BASE_ADDR + 0x37)
+
+/*
+ * defgroup XXX_MEM_ACCESS_ADDR PE memory access through CSR
+ * XXX_MEM_ACCESS_ADDR register bit definitions.
+ */
+/* Internal Memory Write. */
+#define PE_MEM_ACCESS_WRITEBIT(31)
+/* Internal Memory Read. */
+#define PE_MEM_ACCESS_READ (0 << 31)

[U-Boot] [PATCH v2 04/13] drivers: net: pfe_eth: provide pfe commands

2018-02-15 Thread Calvin Johnson
pfe_command provides command line support for several features that
support pfe, like starting or stopping the pfe, checking the health
of the processor engines and checking status of different units inside
pfe.

Signed-off-by: Calvin Johnson 
Signed-off-by: Anjaneyulu Jagarlmudi 
---
Changes in v2:
-remove unused code under CONFIG_UTIL_PE_DISABLED
-remove unused code under CONFIG_PFE_WARN_WA
---
 drivers/net/pfe_eth/pfe_cmd.c | 497 ++
 1 file changed, 497 insertions(+)
 create mode 100644 drivers/net/pfe_eth/pfe_cmd.c

diff --git a/drivers/net/pfe_eth/pfe_cmd.c b/drivers/net/pfe_eth/pfe_cmd.c
new file mode 100644
index 000..41c9c9b
--- /dev/null
+++ b/drivers/net/pfe_eth/pfe_cmd.c
@@ -0,0 +1,497 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/*
+ * @file
+ * @brief PFE utility commands
+ */
+
+#include 
+
+static inline void pfe_command_help(void)
+{
+   printf("Usage: pfe [pe | status | expt ] \n");
+}
+
+static void pfe_command_pe(int argc, char * const argv[])
+{
+   if (argc >= 3 && strcmp(argv[2], "pmem") == 0) {
+   if (argc >= 4 && strcmp(argv[3], "read") == 0) {
+   int i;
+   int num;
+   int id;
+   u32 addr;
+   u32 size;
+   u32 val;
+
+   if (argc == 7) {
+   num = simple_strtoul(argv[6], NULL, 0);
+   } else if (argc == 6) {
+   num = 1;
+   } else {
+   printf("Usage: pfe pe pmem read   
[]\n");
+   return;
+   }
+
+   id = simple_strtoul(argv[4], NULL, 0);
+   addr = simple_strtoul(argv[5], NULL, 16);
+   size = 4;
+
+   for (i = 0; i < num; i++, addr += 4) {
+   val = pe_pmem_read(id, addr, size);
+   val = be32_to_cpu(val);
+   if (!(i & 3))
+   printf("%08x: ", addr);
+   printf("%08x%s", val, i == num - 1 || (i & 3)
+  == 3 ? "\n" : " ");
+   }
+
+   } else {
+   printf("Usage: pfe pe pmem read \n");
+   }
+   } else if (argc >= 3 && strcmp(argv[2], "dmem") == 0) {
+   if (argc >= 4 && strcmp(argv[3], "read") == 0) {
+   int i;
+   int num;
+   int id;
+   u32 addr;
+   u32 size;
+   u32 val;
+
+   if (argc == 7) {
+   num = simple_strtoul(argv[6], NULL, 0);
+   } else if (argc == 6) {
+   num = 1;
+   } else {
+   printf("Usage: pfe pe dmem read   
[]\n");
+   return;
+   }
+
+   id = simple_strtoul(argv[4], NULL, 0);
+   addr = simple_strtoul(argv[5], NULL, 16);
+   size = 4;
+
+   for (i = 0; i < num; i++, addr += 4) {
+   val = pe_dmem_read(id, addr, size);
+   val = be32_to_cpu(val);
+   if (!(i & 3))
+   printf("%08x: ", addr);
+   printf("%08x%s", val, i == num - 1 || (i & 3)
+  == 3 ? "\n" : " ");
+   }
+
+   } else if (argc >= 4 && strcmp(argv[3], "write") == 0) {
+   int id;
+   u32 val;
+   u32 addr;
+   u32 size;
+
+   if (argc != 7) {
+   printf("Usage: pfe pe dmem write   
\n");
+   return;
+   }
+
+   id = simple_strtoul(argv[4], NULL, 0);
+   val = simple_strtoul(argv[5], NULL, 16);
+   val = cpu_to_be32(val);
+   addr = simple_strtoul(argv[6], NULL, 16);
+   size = 4;
+   pe_dmem_write(id, val, addr, size);
+   } else {
+   printf("Usage: pfe pe dmem [read | write] 
\n");
+   }
+   } else if (argc >= 3 && strcmp(argv[2], "lmem") == 0) {
+   if (argc >= 4 && strcmp(argv[3], "read") == 0) {
+   int i;
+   int num;
+   u32 

[U-Boot] [PATCH v2 03/13] drivers: net: pfe_eth: LS1012A PFE driver introduction

2018-02-15 Thread Calvin Johnson
This patch adds PFE driver to U-Boot

Following are the main driver files:-
pfe_hw.c: provides low level helper functions to initialize PFE
internal processor engines and other hardware blocks
pfe_driver.c: provides initialization functions
and packet send and receive functions
pfe_eth.c: provides high level gemac initialization functions
pfe_firmware.c: provides functions to load firmware into PFE
internal processor engines.
pfe_mdio.c: provides functions to initialize phy and mdio.

Signed-off-by: Calvin Johnson 
Signed-off-by: Anjaneyulu Jagarlmudi 
---
Changes in v2:
-fix RGMII TX-delay issue
-add pfe_rx_done to clear bd after packet processing
-use writel/readl to access hw bds
-cleanup typos and indent
-remove unused code under CONFIG_UTIL_PE_DISABLED
-Consolidate code in pfe_lib_init
-Corrected typo receive
-Magic numbers replaced with proper definitions
-File names pfe.c renamed to pfe_hw.c to be more clear as it contains
 low level functions that directly access pfe hardware block.
-MDIO related code is also moved from pfe_eth.c to a new file
 pfe_mdio.c.
---
 drivers/net/pfe_eth/pfe_driver.c   | 643 
 drivers/net/pfe_eth/pfe_eth.c  | 297 +++
 drivers/net/pfe_eth/pfe_firmware.c | 230 +
 drivers/net/pfe_eth/pfe_hw.c   | 999 +
 drivers/net/pfe_eth/pfe_mdio.c | 291 +++
 5 files changed, 2460 insertions(+)
 create mode 100644 drivers/net/pfe_eth/pfe_driver.c
 create mode 100644 drivers/net/pfe_eth/pfe_eth.c
 create mode 100644 drivers/net/pfe_eth/pfe_firmware.c
 create mode 100644 drivers/net/pfe_eth/pfe_hw.c
 create mode 100644 drivers/net/pfe_eth/pfe_mdio.c

diff --git a/drivers/net/pfe_eth/pfe_driver.c b/drivers/net/pfe_eth/pfe_driver.c
new file mode 100644
index 000..3122d5a
--- /dev/null
+++ b/drivers/net/pfe_eth/pfe_driver.c
@@ -0,0 +1,643 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+
+static struct tx_desc_s *g_tx_desc;
+static struct rx_desc_s *g_rx_desc;
+
+/*
+ * HIF Rx interface function
+ * Reads the rx descriptor from the current location (rx_to_read).
+ * - If the descriptor has a valid data/pkt, then get the data pointer
+ * - check for the input rx phy number
+ * - increment the rx data pointer by pkt_head_room_size
+ * - decrement the data length by pkt_head_room_size
+ * - handover the packet to caller.
+ *
+ * @param[out] pkt_ptr - Pointer to store rx packet
+ * @param[out] phy_port - Pointer to store recv phy port
+ *
+ * @return -1 if no packet, else return length of packet.
+ */
+int pfe_recv(uchar **pkt_ptr, int *phy_port)
+{
+   struct rx_desc_s *rx_desc = g_rx_desc;
+   struct buf_desc *bd;
+   int len = 0;
+
+   struct hif_header_s *hif_header;
+
+   bd = rx_desc->rx_base + rx_desc->rx_to_read;
+
+   if (readl(>ctrl) & BD_CTRL_DESC_EN)
+   return len; /* No pending Rx packet */
+
+   /* this len include hif_header(8 bytes) */
+   len = readl(>ctrl) & 0x;
+
+   hif_header = (struct hif_header_s *)DDR_PFE_TO_VIRT(readl(>data));
+
+   /* Get the receive port info from the packet */
+   debug("Pkt received:");
+   debug(" Pkt ptr(%p), len(%d), gemac_port(%d) status(%08x)\n",
+ hif_header, len, hif_header->port_no, readl(>status));
+#ifdef DEBUG
+   {
+   int i;
+   unsigned char *p = (unsigned char *)hif_header;
+
+   for (i = 0; i < len; i++) {
+   if (!(i % 16))
+   printf("\n");
+   printf(" %02x", p[i]);
+   }
+   printf("\n");
+   }
+#endif
+
+   *pkt_ptr = (uchar *)(hif_header + 1);
+   *phy_port = hif_header->port_no;
+   len -= sizeof(struct hif_header_s);
+
+   return len;
+}
+
+/*
+ * HIF function to check the Rx done
+ * This function will check the rx done indication of the current rx_to_read
+ * locations
+ * if success, moves the rx_to_read to next location.
+ */
+int pfe_eth_free_pkt(struct udevice *dev, uchar *packet, int length)
+{
+   struct rx_desc_s *rx_desc = g_rx_desc;
+   struct buf_desc *bd;
+
+   debug("%s:rx_base: %p, rx_to_read: %d\n", __func__, rx_desc->rx_base,
+ rx_desc->rx_to_read);
+
+   bd = rx_desc->rx_base + rx_desc->rx_to_read;
+
+   /* reset the control field */
+   writel((MAX_FRAME_SIZE | BD_CTRL_LIFM | BD_CTRL_DESC_EN
+   | BD_CTRL_DIR), >ctrl);
+   writel(0, >status);
+
+   debug("Rx Done : status: %08x, ctrl: %08x\n", readl(>status),
+ readl(>ctrl));
+
+   /* Give START_STROBE to BDP to fetch the descriptor __NOW__,
+* BDP need not wait for rx_poll_cycle time to fetch the descriptor,
+* In idle state (ie., no rx pkt), BDP will not fetch
+* the descriptor 

[U-Boot] [PATCH v2 02/13] armv8: fsl-layerscape: Add support of GPIO structure

2018-02-15 Thread Calvin Johnson
From: Prabhakar Kushwaha 

Layerscape Gen2 SoC supports GPIO registers to control GPIO
signals. Adding support of GPIO structure to access GPIO
registers.

Signed-off-by: Pratiyush Srivastava 
Signed-off-by: Prabhakar Kushwaha 
---
Changes in v2: None
---
 arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h 
b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
index 1ff5cac..b195005 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
@@ -82,6 +82,11 @@
 #define QSPI0_BASE_ADDR(CONFIG_SYS_IMMR + 
0x0055)
 #define DSPI1_BASE_ADDR(CONFIG_SYS_IMMR + 
0x0110)
 
+#define GPIO1_BASE_ADDR(CONFIG_SYS_IMMR + 
0x130)
+#define GPIO2_BASE_ADDR(CONFIG_SYS_IMMR + 
0x131)
+#define GPIO3_BASE_ADDR(CONFIG_SYS_IMMR + 
0x132)
+#define GPIO4_BASE_ADDR(CONFIG_SYS_IMMR + 
0x133)
+
 #define LPUART_BASE(CONFIG_SYS_IMMR + 0x0195)
 
 #define AHCI_BASE_ADDR (CONFIG_SYS_IMMR + 0x0220)
@@ -591,6 +596,16 @@ struct ccsr_serdes {
u8  res_19a0[0x2000-0x19a0];/* from 0x19a0 to 0x1fff */
 };
 
+struct ccsr_gpio {
+   u32 gpdir;
+   u32 gpodr;
+   u32 gpdat;
+   u32 gpier;
+   u32 gpimr;
+   u32 gpicr;
+   u32 gpibe;
+};
+
 /* MMU 500 */
 #define SMMU_SCR0  (SMMU_BASE + 0x0)
 #define SMMU_SCR1  (SMMU_BASE + 0x4)
-- 
2.7.4

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


[U-Boot] [PATCH v2 08/13] board: freescale: ls1012ardb: enable network support on ls1012ardb

2018-02-15 Thread Calvin Johnson
This patch enables ethernet support for ls1012ardb.

Signed-off-by: Calvin Johnson 
Signed-off-by: Anjaneyulu Jagarlmudi 
---
Changes in v2:
-split from original patch "board: freescale: ls1012a: enable network
support on ls1012a platforms"
---
 board/freescale/ls1012ardb/Kconfig  |  14 +
 board/freescale/ls1012ardb/Makefile |   1 +
 board/freescale/ls1012ardb/eth.c| 106 
 board/freescale/ls1012ardb/ls1012ardb.c |   4 --
 include/configs/ls1012ardb.h|   4 ++
 5 files changed, 125 insertions(+), 4 deletions(-)
 create mode 100644 board/freescale/ls1012ardb/eth.c

diff --git a/board/freescale/ls1012ardb/Kconfig 
b/board/freescale/ls1012ardb/Kconfig
index d13b08e..6e6197a 100644
--- a/board/freescale/ls1012ardb/Kconfig
+++ b/board/freescale/ls1012ardb/Kconfig
@@ -12,6 +12,20 @@ config SYS_SOC
 config SYS_CONFIG_NAME
default "ls1012ardb"
 
+if FSL_PFE
+config SYS_LS_PFE_FW_ADDR
+   hex "Flash address of PFE firmware"
+   default 0x40a0
+
+config DDR_PFE_PHYS_BASEADDR
+   hex "PFE DDR physical base address"
+   default 0x0380
+
+config DDR_PFE_BASEADDR
+   hex "PFE DDR base address"
+   default 0x8380
+endif
+
 source "board/freescale/common/Kconfig"
 
 endif
diff --git a/board/freescale/ls1012ardb/Makefile 
b/board/freescale/ls1012ardb/Makefile
index 05fa9d9..bd80ce5 100644
--- a/board/freescale/ls1012ardb/Makefile
+++ b/board/freescale/ls1012ardb/Makefile
@@ -5,3 +5,4 @@
 #
 
 obj-y += ls1012ardb.o
+obj-y += eth.o
diff --git a/board/freescale/ls1012ardb/eth.c b/board/freescale/ls1012ardb/eth.c
new file mode 100644
index 000..bf67590
--- /dev/null
+++ b/board/freescale/ls1012ardb/eth.c
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define DEFAULT_PFE_MDIO_NAME "PFE_MDIO"
+
+static inline void ls1012ardb_reset_phy(void)
+{
+   /* Through reset IO expander reset both RGMII and SGMII PHYs */
+   i2c_reg_write(I2C_MUX_IO2_ADDR, 6, __PHY_MASK);
+   i2c_reg_write(I2C_MUX_IO2_ADDR, 2, __PHY_ETH2_MASK);
+   mdelay(10);
+   i2c_reg_write(I2C_MUX_IO2_ADDR, 2, __PHY_ETH1_MASK);
+   mdelay(10);
+   i2c_reg_write(I2C_MUX_IO2_ADDR, 2, 0xFF);
+   mdelay(50);
+}
+
+int pfe_eth_board_init(struct udevice *dev)
+{
+   static int init_done;
+   struct mii_dev *bus;
+   struct pfe_mdio_info mac_mdio_info;
+   struct pfe_eth_dev *priv = dev_get_priv(dev);
+
+   if (!init_done) {
+   ls1012ardb_reset_phy();
+   mac_mdio_info.reg_base = (void *)EMAC1_BASE_ADDR;
+   mac_mdio_info.name = DEFAULT_PFE_MDIO_NAME;
+
+   bus = pfe_mdio_init(_mdio_info);
+   if (!bus) {
+   printf("Failed to register mdio\n");
+   return -1;
+   }
+   init_done = 1;
+   }
+
+   pfe_set_mdio(priv->gemac_port,
+miiphy_get_dev_by_name(DEFAULT_PFE_MDIO_NAME));
+
+   if (!priv->gemac_port) {
+   /* MAC1 */
+   pfe_set_phy_address_mode(priv->gemac_port, EMAC1_PHY_ADDR,
+PHY_INTERFACE_MODE_SGMII);
+   } else {
+   /* MAC2 */
+   pfe_set_phy_address_mode(priv->gemac_port, EMAC2_PHY_ADDR,
+PHY_INTERFACE_MODE_RGMII_TXID);
+   }
+   return 0;
+}
+
+static struct pfe_eth_pdata pfe_pdata0 = {
+   .pfe_eth_pdata_mac = {
+   .iobase = (phys_addr_t)EMAC1_BASE_ADDR,
+   .phy_interface = 0,
+   },
+
+   .pfe_ddr_addr = {
+   .ddr_pfe_baseaddr = (void *)CONFIG_DDR_PFE_BASEADDR,
+   .ddr_pfe_phys_baseaddr = CONFIG_DDR_PFE_PHYS_BASEADDR,
+   },
+};
+
+static struct pfe_eth_pdata pfe_pdata1 = {
+   .pfe_eth_pdata_mac = {
+   .iobase = (phys_addr_t)EMAC2_BASE_ADDR,
+   .phy_interface = 1,
+   },
+
+   .pfe_ddr_addr = {
+   .ddr_pfe_baseaddr = (void *)CONFIG_DDR_PFE_BASEADDR,
+   .ddr_pfe_phys_baseaddr = CONFIG_DDR_PFE_PHYS_BASEADDR,
+   },
+};
+
+U_BOOT_DEVICE(ls1012a_pfe0) = {
+   .name = "pfe_eth",
+   .platdata = _pdata0,
+};
+
+U_BOOT_DEVICE(ls1012a_pfe1) = {
+   .name = "pfe_eth",
+   .platdata = _pdata1,
+};
diff --git a/board/freescale/ls1012ardb/ls1012ardb.c 
b/board/freescale/ls1012ardb/ls1012ardb.c
index c9557bb..ed5a8e6 100644
--- a/board/freescale/ls1012ardb/ls1012ardb.c
+++ b/board/freescale/ls1012ardb/ls1012ardb.c
@@ -114,10 +114,6 @@ int dram_init(void)
return 0;
 }
 
-int board_eth_init(bd_t *bis)
-{
-   return pci_eth_init(bis);
-}
 
 

[U-Boot] [PATCH v2 11/13] armv8: fsl-lsch2: configure pfe's DDR and HDBUS interfaces and ECC

2018-02-15 Thread Calvin Johnson
1. Set AWCACHE0 attribute of PFE DDR and HDBUS master interfaces
to bufferable.
2. Set RD/WR QoS for PFE DDR and HDBUS AXI master interfaces.
3. Disable ECC detection for PFE.

Signed-off-by: Calvin Johnson 
Signed-off-by: Anjaneyulu Jagarlmudi 
---
Changes in v2:
-Improved commit message to provide more description
-Replaced magic numbers with proper definitions
---
 arch/arm/cpu/armv8/fsl-layerscape/soc.c| 23 ++
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  | 12 ++-
 arch/arm/include/asm/arch-fsl-layerscape/soc.h |  3 +++
 3 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c 
b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
index b9f837d..18fb937 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
@@ -612,6 +612,29 @@ int setup_chip_volt(void)
return 0;
 }
 
+#ifdef CONFIG_FSL_PFE
+void init_pfe_scfg_dcfg_regs(void)
+{
+   struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
+   u32 ecccr2;
+
+   out_be32(>pfeasbcr,
+in_be32(>pfeasbcr) | SCFG_PFEASBCR_AWCACHE0);
+   out_be32(>pfebsbcr,
+in_be32(>pfebsbcr) | SCFG_PFEASBCR_AWCACHE0);
+
+   /* CCI-400 QoS settings for PFE */
+   out_be32(>wr_qos1, (unsigned int)(SCFG_WR_QOS1_PFE1_QOS
+| SCFG_WR_QOS1_PFE2_QOS));
+   out_be32(>rd_qos1, (unsigned int)(SCFG_RD_QOS1_PFE1_QOS
+| SCFG_RD_QOS1_PFE2_QOS));
+
+   ecccr2 = in_be32(CONFIG_SYS_DCSR_DCFG_ADDR + DCFG_DCSR_ECCCR2);
+   out_be32((void *)CONFIG_SYS_DCSR_DCFG_ADDR + DCFG_DCSR_ECCCR2,
+ecccr2 | (unsigned int)DISABLE_PFE_ECC);
+}
+#endif
+
 void fsl_lsch2_early_init_f(void)
 {
struct ccsr_cci400 *cci = (struct ccsr_cci400 *)(CONFIG_SYS_IMMR +
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h 
b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
index e1a57de..11cf35c 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
@@ -205,6 +205,8 @@ struct sys_info {
 
 /* Device Configuration and Pin Control */
 #define DCFG_DCSR_PORCR1   0x0
+#define DCFG_DCSR_ECCCR2   0x524
+#define DISABLE_PFE_ECCBIT(13)
 
 struct ccsr_gur {
u32 porsr1; /* POR status 1 */
@@ -402,7 +404,7 @@ struct ccsr_gur {
 #define SCFG_RGMIIPCR_SETSP_10M(0x0002)
 #define SCFG_RGMIIPCR_SETFD(0x0001)
 
-/*PFEASBCR bit definitions */
+/* PFEASBCR bit definitions */
 #define SCFG_PFEASBCR_ARCACHE0 (0x8000)
 #define SCFG_PFEASBCR_AWCACHE0 (0x4000)
 #define SCFG_PFEASBCR_ARCACHE1 (0x2000)
@@ -410,6 +412,14 @@ struct ccsr_gur {
 #define SCFG_PFEASBCR_ARSNP(0x0800)
 #define SCFG_PFEASBCR_AWSNP(0x0400)
 
+/* WR_QoS1 PFE bit definitions */
+#define SCFG_WR_QOS1_PFE1_QOS  GENMASK(27, 24)
+#define SCFG_WR_QOS1_PFE2_QOS  GENMASK(23, 20)
+
+/* RD_QoS1 PFE bit definitions */
+#define SCFG_RD_QOS1_PFE1_QOS  GENMASK(27, 24)
+#define SCFG_RD_QOS1_PFE2_QOS  GENMASK(23, 20)
+
 /* Supplemental Configuration Unit */
 struct ccsr_scfg {
u8 res_000[0x100-0x000];
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/soc.h 
b/arch/arm/include/asm/arch-fsl-layerscape/soc.h
index cb760b5..d9bfddb 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/soc.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/soc.h
@@ -127,6 +127,9 @@ void fsl_lsch2_early_init_f(void);
 int setup_chip_volt(void);
 /* Setup core vdd in unit mV */
 int board_setup_core_volt(u32 vdd);
+#ifdef CONFIG_FSL_PFE
+void init_pfe_scfg_dcfg_regs(void);
+#endif
 #endif
 
 void cpu_name(char *name);
-- 
2.7.4

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


[U-Boot] [PATCH v2 10/13] armv8: fsl-lsch2: add pfe macros and update ccsr_scfg structure

2018-02-15 Thread Calvin Johnson
SoC specific PFE macros are defined and structure ccsr_scfg
is updated with members defined for PFE.

Signed-off-by: Calvin Johnson 
Signed-off-by: Anjaneyulu Jagarlmudi 
---
Changes in v2: None
---
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  | 38 --
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h 
b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
index b195005..e1a57de 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
@@ -395,6 +395,21 @@ struct ccsr_gur {
 #define SCFG_SNPCNFGCR_SATARDSNP   0x0080
 #define SCFG_SNPCNFGCR_SATAWRSNP   0x0040
 
+/* RGMIIPCR bit definitions*/
+#define SCFG_RGMIIPCR_EN_AUTO  (0x0008)
+#define SCFG_RGMIIPCR_SETSP_1000M  (0x0004)
+#define SCFG_RGMIIPCR_SETSP_100M   (0x)
+#define SCFG_RGMIIPCR_SETSP_10M(0x0002)
+#define SCFG_RGMIIPCR_SETFD(0x0001)
+
+/*PFEASBCR bit definitions */
+#define SCFG_PFEASBCR_ARCACHE0 (0x8000)
+#define SCFG_PFEASBCR_AWCACHE0 (0x4000)
+#define SCFG_PFEASBCR_ARCACHE1 (0x2000)
+#define SCFG_PFEASBCR_AWCACHE1 (0x1000)
+#define SCFG_PFEASBCR_ARSNP(0x0800)
+#define SCFG_PFEASBCR_AWSNP(0x0400)
+
 /* Supplemental Configuration Unit */
 struct ccsr_scfg {
u8 res_000[0x100-0x000];
@@ -412,7 +427,12 @@ struct ccsr_scfg {
u8 res_140[0x158-0x140];
u32 altcbar;
u32 qspi_cfg;
-   u8 res_160[0x180-0x160];
+   u8 res_160[0x164 - 0x160];
+   u32 wr_qos1;
+   u32 wr_qos2;
+   u32 rd_qos1;
+   u32 rd_qos2;
+   u8 res_174[0x180 - 0x174];
u32 dmamcr;
u8 res_184[0x188-0x184];
u32 gic_align;
@@ -443,7 +463,21 @@ struct ccsr_scfg {
u32 usb_refclk_selcr1;
u32 usb_refclk_selcr2;
u32 usb_refclk_selcr3;
-   u8 res_424[0x600-0x424];
+   u8 res_424[0x434 - 0x424];
+   u32 rgmiipcr;
+   u32 res_438;
+   u32 rgmiipsr;
+   u32 pfepfcssr1;
+   u32 pfeintencr1;
+   u32 pfepfcssr2;
+   u32 pfeintencr2;
+   u32 pfeerrcr;
+   u32 pfeeerrintencr;
+   u32 pfeasbcr;
+   u32 pfebsbcr;
+   u8 res_460[0x484 - 0x460];
+   u32 mdioselcr;
+   u8 res_468[0x600 - 0x488];
u32 scratchrw[4];
u8 res_610[0x680-0x610];
u32 corebcr;
-- 
2.7.4

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


[U-Boot] [PATCH v2 09/13] board: freescale: ls1012a2g5rdb: enable network support on ls1012a2g5rdb

2018-02-15 Thread Calvin Johnson
This patch enables ethernet support for ls1012a2g5rdb.

Signed-off-by: Calvin Johnson 
Signed-off-by: Bhaskar Upadhaya 
---
Changes in v2:
-New patch added to series to enable ethernet support for
ls1012a2g5rdb
---
 board/freescale/ls1012ardb/Kconfig | 14 ++
 board/freescale/ls1012ardb/eth.c   | 25 +
 2 files changed, 39 insertions(+)

diff --git a/board/freescale/ls1012ardb/Kconfig 
b/board/freescale/ls1012ardb/Kconfig
index 6e6197a..4bb672c 100644
--- a/board/freescale/ls1012ardb/Kconfig
+++ b/board/freescale/ls1012ardb/Kconfig
@@ -44,6 +44,20 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 default "ls1012a2g5rdb"
 
+if FSL_PFE
+config SYS_LS_PFE_FW_ADDR
+   hex "Flash address of PFE firmware"
+   default 0x40a0
+
+config DDR_PFE_PHYS_BASEADDR
+   hex "PFE DDR physical base address"
+   default 0x0380
+
+config DDR_PFE_BASEADDR
+   hex "PFE DDR base address"
+   default 0x8380
+endif
+
 source "board/freescale/common/Kconfig"
 
 endif
diff --git a/board/freescale/ls1012ardb/eth.c b/board/freescale/ls1012ardb/eth.c
index bf67590..fc062cf 100644
--- a/board/freescale/ls1012ardb/eth.c
+++ b/board/freescale/ls1012ardb/eth.c
@@ -26,6 +26,7 @@
 
 static inline void ls1012ardb_reset_phy(void)
 {
+#ifdef CONFIG_TARGET_LS1012ARDB
/* Through reset IO expander reset both RGMII and SGMII PHYs */
i2c_reg_write(I2C_MUX_IO2_ADDR, 6, __PHY_MASK);
i2c_reg_write(I2C_MUX_IO2_ADDR, 2, __PHY_ETH2_MASK);
@@ -34,6 +35,7 @@ static inline void ls1012ardb_reset_phy(void)
mdelay(10);
i2c_reg_write(I2C_MUX_IO2_ADDR, 2, 0xFF);
mdelay(50);
+#endif
 }
 
 int pfe_eth_board_init(struct udevice *dev)
@@ -42,6 +44,11 @@ int pfe_eth_board_init(struct udevice *dev)
struct mii_dev *bus;
struct pfe_mdio_info mac_mdio_info;
struct pfe_eth_dev *priv = dev_get_priv(dev);
+   struct ccsr_gur __iomem *gur = (void *)CONFIG_SYS_FSL_GUTS_ADDR;
+
+   int srds_s1 = in_be32(>rcwsr[4]) &
+   FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_MASK;
+   srds_s1 >>= FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_SHIFT;
 
if (!init_done) {
ls1012ardb_reset_phy();
@@ -59,6 +66,8 @@ int pfe_eth_board_init(struct udevice *dev)
pfe_set_mdio(priv->gemac_port,
 miiphy_get_dev_by_name(DEFAULT_PFE_MDIO_NAME));
 
+   switch (srds_s1) {
+   case 0x3508:
if (!priv->gemac_port) {
/* MAC1 */
pfe_set_phy_address_mode(priv->gemac_port, EMAC1_PHY_ADDR,
@@ -68,6 +77,22 @@ int pfe_eth_board_init(struct udevice *dev)
pfe_set_phy_address_mode(priv->gemac_port, EMAC2_PHY_ADDR,
 PHY_INTERFACE_MODE_RGMII_TXID);
}
+   break;
+   case 0x2208:
+   if (!priv->gemac_port) {
+   /* MAC1 */
+   pfe_set_phy_address_mode(priv->gemac_port, EMAC1_PHY_ADDR,
+PHY_INTERFACE_MODE_SGMII_2500);
+   } else {
+   /* MAC2 */
+   pfe_set_phy_address_mode(priv->gemac_port, EMAC2_PHY_ADDR,
+PHY_INTERFACE_MODE_SGMII_2500);
+   }
+   break;
+   default:
+   printf("unsupported SerDes PRCTL= %d\n", srds_s1);
+   break;
+   }
return 0;
 }
 
-- 
2.7.4

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


[U-Boot] [PATCH v2 01/13] drivers: net: phy: Fix aquantia compilation with DM

2018-02-15 Thread Calvin Johnson
With CONFIG_DM_ETH enabled, aquantia driver compilation fails with
below error. This patch fixes the issue by including dm.h.

drivers/net/phy/aquantia.c: In function ‘aquantia_startup’:
drivers/net/phy/aquantia.c:73:21: error: dereferencing pointer to
incomplete
type ‘struct udevice’
  phydev->dev->name);
 ^~

Signed-off-by: Calvin Johnson 
---
Changes in v2: None
---
 drivers/net/phy/aquantia.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
index ad12f6d..6678147 100644
--- a/drivers/net/phy/aquantia.c
+++ b/drivers/net/phy/aquantia.c
@@ -7,6 +7,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 
 #ifndef CONFIG_PHYLIB_10G
-- 
2.7.4

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


[U-Boot] [PATCH v2 00/13] LS1012A PFE driver patch series

2018-02-15 Thread Calvin Johnson
Hi,
 
This patch series introduces U-Boot support for NXP's LS1012A Packet
Forwarding Engine (pfe_eth). LS1012A uses hardware packet forwarding
engine to provide high performance Ethernet interfaces. The device
includes two Ethernet ports.
 
Changes in v2 series:
1. PFE patches submitted on top of this base patch are now merged to
this patch.
2. Platform changes are segregated into different patches.
3. Network enabled on 2g5rdb platform
4. Moved from legacy to new driver model.

Calvin Johnson (12):
  drivers: net: phy: Fix aquantia compilation with DM
  drivers: net: pfe_eth: LS1012A PFE driver introduction
  drivers: net: pfe_eth: provide pfe commands
  drivers: net: pfe_eth: LS1012A PFE headers
  board: freescale: ls1012aqds: enable network support on ls1012aqds
  board: freescale: ls1012afrdm: enable network support on ls1012afrdm
  board: freescale: ls1012ardb: enable network support on ls1012ardb
  board: freescale: ls1012a2g5rdb: enable network support on
ls1012a2g5rdb
  armv8: fsl-lsch2: add pfe macros and update ccsr_scfg structure
  armv8: fsl-lsch2: configure pfe's DDR and HDBUS interfaces and ECC
  armv8: layerscape: csu: enable ns access to PFE registers
  configs: ls1012a: add pfe configuration for LS1012A

Prabhakar Kushwaha (1):
  armv8: fsl-layerscape: Add support of GPIO structure

 arch/arm/cpu/armv8/fsl-layerscape/soc.c|  23 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  63 +-
 .../include/asm/arch-fsl-layerscape/ns_access.h|   2 +
 arch/arm/include/asm/arch-fsl-layerscape/soc.h |   3 +
 board/freescale/ls1012afrdm/Kconfig|  14 +
 board/freescale/ls1012afrdm/Makefile   |   1 +
 board/freescale/ls1012afrdm/eth.c  | 122 +++
 board/freescale/ls1012afrdm/ls1012afrdm.c  |   5 -
 board/freescale/ls1012aqds/Kconfig |  14 +
 board/freescale/ls1012aqds/Makefile|   1 +
 board/freescale/ls1012aqds/eth.c   | 304 +++
 board/freescale/ls1012aqds/ls1012aqds.c|  97 +-
 board/freescale/ls1012aqds/ls1012aqds_pfe.h|  48 +
 board/freescale/ls1012aqds/ls1012aqds_qixis.h  |   2 +-
 board/freescale/ls1012ardb/Kconfig |  28 +
 board/freescale/ls1012ardb/Makefile|   1 +
 board/freescale/ls1012ardb/eth.c   | 131 +++
 board/freescale/ls1012ardb/ls1012ardb.c|   4 -
 configs/ls1012a2g5rdb_qspi_defconfig   |   2 +
 configs/ls1012afrdm_qspi_defconfig |   2 +
 configs/ls1012aqds_qspi_defconfig  |   2 +
 configs/ls1012ardb_qspi_defconfig  |   2 +
 drivers/net/Kconfig|   1 +
 drivers/net/Makefile   |   1 +
 drivers/net/pfe_eth/Kconfig|  17 +
 drivers/net/pfe_eth/Makefile   |  12 +
 drivers/net/pfe_eth/pfe_cmd.c  | 497 ++
 drivers/net/pfe_eth/pfe_driver.c   | 643 +
 drivers/net/pfe_eth/pfe_eth.c  | 297 ++
 drivers/net/pfe_eth/pfe_firmware.c | 230 +
 drivers/net/pfe_eth/pfe_hw.c   | 999 +
 drivers/net/pfe_eth/pfe_mdio.c | 291 ++
 drivers/net/phy/aquantia.c |   1 +
 include/configs/ls1012a2g5rdb.h|   2 +-
 include/configs/ls1012a_common.h   |   6 +-
 include/configs/ls1012afrdm.h  |   9 +-
 include/configs/ls1012aqds.h   |  14 +
 include/configs/ls1012ardb.h   |  14 +-
 include/dm/platform_data/pfe_dm_eth.h  |  21 +
 include/pfe_eth/pfe/cbus.h |  77 ++
 include/pfe_eth/pfe/cbus/bmu.h |  40 +
 include/pfe_eth/pfe/cbus/class_csr.h   | 180 
 include/pfe_eth/pfe/cbus/emac.h| 140 +++
 include/pfe_eth/pfe/cbus/gpi.h |  62 ++
 include/pfe_eth/pfe/cbus/hif.h |  68 ++
 include/pfe_eth/pfe/cbus/hif_nocpy.h   |  40 +
 include/pfe_eth/pfe/cbus/tmu_csr.h | 148 +++
 include/pfe_eth/pfe/cbus/util_csr.h|  47 +
 include/pfe_eth/pfe/pfe_hw.h   | 163 
 include/pfe_eth/pfe_driver.h   |  59 ++
 include/pfe_eth/pfe_eth.h  | 104 +++
 include/pfe_eth/pfe_firmware.h |  17 +
 include/pfe_eth/pfe_mdio.h |  13 +
 53 files changed, 5060 insertions(+), 24 deletions(-)
 create mode 100644 board/freescale/ls1012afrdm/eth.c
 create mode 100644 board/freescale/ls1012aqds/eth.c
 create mode 100644 board/freescale/ls1012aqds/ls1012aqds_pfe.h
 create mode 100644 board/freescale/ls1012ardb/eth.c
 create mode 100644 drivers/net/pfe_eth/Kconfig
 create mode 100644 drivers/net/pfe_eth/Makefile
 create mode 100644 

Re: [U-Boot] [PATCH 8/8] Migrate generic bootcount to Kconfig

2018-02-15 Thread Alex Kiernan
On Wed, Feb 14, 2018 at 7:13 PM, Lukasz Majewski  wrote:
> Hi Alex,
>
>> On Wed, Feb 14, 2018 at 8:53 AM, Lukasz Majewski 
>> wrote:
>> >> >> Whatever we do, I think CONFIG_SYS_BOOTCOUNT_ADDR wants
>> >> >> splitting into at least two:
>> >> >>
>> >> >> - I2C - an offset from an I2C base for the bootcounter
>> >> >   - RAM/SoC memory - location of special register to store
>> >> > bootcounter
>> >> >> - Others - an actual address used for storing the bootcounter
>> >> >
>> >> >
>> >> >
>> >> >>
>> >> >> I'm struggling to see why EXT is the way it is - AFAICS the
>> >> >> location it uses to access/return the bootcounter is basically
>> >> >> local to the two functions in bootcount_ext and could just be a
>> >> >> local variable.
>> >> >
>> >> > Maybe we can replace it with local, static variable then?
>> >> >
>> >> >
>> >> > As said above - I would remove the (wrongly?) used
>> >> > BOOTCOUNT_ADDR in Kconfig.
>> >> >
>> >>
>> >> Just removing SYS_BOOTCOUNT_ADDR from Kconfig and putting the
>> >> default back into bootcount_ext seems like the simplest correct
>> >> change. I'll add that onto the series and throw it at Travis.
>> >
>> > Great. I'm looking forward for next verison of the code - as I do
>> > have some code to be put on top of it.
>> >
>>
>> So the super-trivial approach doesn't work, because
>> CONFIG_SYS_BOOTCOUNT_ADDR isn't in the whitelist anymore
>> (7af2e3648f3f6d726f6476745c2eec5de709a702) and I think the only reason
>> it was getting through before is because scripts/check-config.sh
>> doesn't parse conditionals in Kconfig so thought it was allowed :(
>>
>> I expect reintroducing CONFIG_SYS_BOOTCOUNT_ADDR to
>> config_whitelist.txt would "fix" the problem, but that's not going to
>> make it in.
>>
>> Which I think means I have to do the work to migrate it out of CONFIG_
>> land properly.
>>
>
> Ok. I see.
>

'tis done. Only I've fallen foul of the recipient limit on the mailing
list :( Will see if the two pieces get pushed out, if not I'll go and
trim the list and try again.

As you say, this isn't a patch for -rc2

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


[U-Boot] [PATCH v2 12/13] Migrate CONFIG_BOOTCOUNT_ALEN to Kconfig

2018-02-15 Thread Alex Kiernan
Signed-off-by: Alex Kiernan 
---

Changes in v2: None

 drivers/bootcount/Kconfig| 9 -
 include/configs/ids8313.h| 1 -
 scripts/config_whitelist.txt | 1 -
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index ce26e38..1a037f2 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -66,7 +66,14 @@ config BOOTCOUNT_I2C
  Enable support for the bootcounter on an i2c (like RTC) device.
  CONFIG_SYS_I2C_RTC_ADDR = i2c chip address
  BOOTCOUNT_ADDR = i2c addr which is used for the bootcounter.
- CONFIG_BOOTCOUNT_ALEN = address len
+
+config BOOTCOUNT_ALEN
+   int "I2C address length"
+   default 1
+   depends on BOOTCOUNT_I2C
+   help
+ Length of the the I2C address at BOOTCOUNT_ADDR for storing
+ the boot counter.
 
 config BOOTCOUNT_AT91
bool "Boot counter for Atmel AT91SAM9XE"
diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index 4449e27..fb891a3 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -515,7 +515,6 @@
 #define CONFIG_MTD_PARTITIONS
 
 /* bootcount support */
-#define CONFIG_BOOTCOUNT_ALEN  1
 #define BOOTCOUNT_ADDR 0x9
 
 #define CONFIG_IMAGE_FORMAT_LEGACY
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index a8380c6..e16085b 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -147,7 +147,6 @@ CONFIG_BOARD_TYPES
 CONFIG_BOOGER
 CONFIG_BOOM
 CONFIG_BOOTBLOCK
-CONFIG_BOOTCOUNT_ALEN
 CONFIG_BOOTFILE
 CONFIG_BOOTMAPSZ
 CONFIG_BOOTMODE
-- 
2.7.4

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


[U-Boot] [PATCH v2 08/13] Integrate AT91 bootcount driver

2018-02-15 Thread Alex Kiernan
Integrate Boot counter for Atmel AT91SAM9XE into Kconfig

Reviewed-by: Lukasz Majewski 
Signed-off-by: Alex Kiernan 
---

Changes in v2: None

 README | 4 
 drivers/bootcount/Kconfig  | 5 +
 drivers/bootcount/Makefile | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/README b/README
index 9eb4f5a..aee 100644
--- a/README
+++ b/README
@@ -2306,10 +2306,6 @@ The following options need to be configured:
A better solution is to properly configure the firewall,
but sometimes that is not allowed.
 
-- bootcount support:
-   CONFIG_AT91SAM9XE
-   enable special bootcounter support on at91sam9xe based boards.
-
 - Show boot progress:
CONFIG_SHOW_BOOT_PROGRESS
 
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index 8c19ae6..e0d1fc2 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -13,6 +13,7 @@ if BOOTCOUNT_LIMIT
 choice
prompt "Boot count device"
default BOOTCOUNT_AM33XX if AM33XX || SOC_DA8XX
+   default BOOTCOUNT_AT91 if AT91SAM9XE
 
 config BOOTCOUNT_EXT
bool "Boot counter on EXT filesystem"
@@ -55,6 +56,10 @@ config BOOTCOUNT_I2C
  the bootcounter.
  CONFIG_BOOTCOUNT_ALEN = address len
 
+config BOOTCOUNT_AT91
+   bool "Boot counter for Atmel AT91SAM9XE"
+   depends on AT91SAM9XE
+
 endchoice
 
 config SYS_BOOTCOUNT_SINGLEWORD
diff --git a/drivers/bootcount/Makefile b/drivers/bootcount/Makefile
index 62bf55e..a3658c1 100644
--- a/drivers/bootcount/Makefile
+++ b/drivers/bootcount/Makefile
@@ -3,7 +3,7 @@
 #
 
 obj-y  += bootcount.o
-obj-$(CONFIG_AT91SAM9XE)   += bootcount_at91.o
+obj-$(CONFIG_BOOTCOUNT_AT91)   += bootcount_at91.o
 obj-$(CONFIG_BOOTCOUNT_AM33XX) += bootcount_davinci.o
 obj-$(CONFIG_BOOTCOUNT_RAM)+= bootcount_ram.o
 obj-$(CONFIG_BOOTCOUNT_ENV)+= bootcount_env.o
-- 
2.7.4

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


[U-Boot] [PATCH v2 07/13] Convert CONFIG_BOOTCOUNT_EXT to Kconfig

2018-02-15 Thread Alex Kiernan
This converts the following to Kconfig:
  CONFIG_BOOTCOUNT_EXT

Signed-off-by: Alex Kiernan 
---

Changes in v2: None

 README  | 7 ---
 configs/ge_b450v3_defconfig | 2 ++
 configs/ge_b650v3_defconfig | 2 ++
 configs/ge_b850v3_defconfig | 2 ++
 include/configs/ge_bx50v3.h | 4 
 5 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/README b/README
index 0157f0b..9eb4f5a 100644
--- a/README
+++ b/README
@@ -2309,13 +2309,6 @@ The following options need to be configured:
 - bootcount support:
CONFIG_AT91SAM9XE
enable special bootcounter support on at91sam9xe based boards.
-   CONFIG_BOOTCOUNT_EXT
-   enable support for the bootcounter in EXT filesystem
-   CONFIG_SYS_BOOTCOUNT_ADDR = RAM address used for read
-and write.
-   CONFIG_SYS_BOOTCOUNT_EXT_INTERFACE = interface
-   CONFIG_SYS_BOOTCOUNT_EXT_DEVPART = device and part
-   CONFIG_SYS_BOOTCOUNT_EXT_NAME = filename
 
 - Show boot progress:
CONFIG_SHOW_BOOT_PROGRESS
diff --git a/configs/ge_b450v3_defconfig b/configs/ge_b450v3_defconfig
index a5beefe..32f07ab 100644
--- a/configs/ge_b450v3_defconfig
+++ b/configs/ge_b450v3_defconfig
@@ -26,6 +26,8 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_DOS_PARTITION=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_EXT=y
+CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5"
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_NETDEVICES=y
diff --git a/configs/ge_b650v3_defconfig b/configs/ge_b650v3_defconfig
index cbf83b1..188238e 100644
--- a/configs/ge_b650v3_defconfig
+++ b/configs/ge_b650v3_defconfig
@@ -26,6 +26,8 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_DOS_PARTITION=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_EXT=y
+CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5"
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_NETDEVICES=y
diff --git a/configs/ge_b850v3_defconfig b/configs/ge_b850v3_defconfig
index 953681f..96ac173 100644
--- a/configs/ge_b850v3_defconfig
+++ b/configs/ge_b850v3_defconfig
@@ -26,6 +26,8 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_DOS_PARTITION=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_EXT=y
+CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="1:5"
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_NETDEVICES=y
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h
index 8dc0a7f..0a72b58 100644
--- a/include/configs/ge_bx50v3.h
+++ b/include/configs/ge_bx50v3.h
@@ -267,10 +267,6 @@
 
 #define CONFIG_BCH
 
-#define CONFIG_BOOTCOUNT_EXT
-#define CONFIG_SYS_BOOTCOUNT_EXT_INTERFACE "mmc"
-#define CONFIG_SYS_BOOTCOUNT_EXT_DEVPART   "1:5"
-#define CONFIG_SYS_BOOTCOUNT_EXT_NAME  "/boot/failures"
 #define CONFIG_SYS_BOOTCOUNT_ADDR  0x7000A000
 
 #endif /* __GE_BX50V3_CONFIG_H */
-- 
2.7.4

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


[U-Boot] [PATCH v2 09/13] Migrate generic bootcount to Kconfig

2018-02-15 Thread Alex Kiernan
Make generate boot counter selected in the same way as other boot count
drivers

Reviewed-by: Lukasz Majewski 
Signed-off-by: Alex Kiernan 
---

Changes in v2: None

 drivers/bootcount/Kconfig  | 11 +++
 drivers/bootcount/Makefile |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index e0d1fc2..9fde2f2 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -14,6 +14,16 @@ choice
prompt "Boot count device"
default BOOTCOUNT_AM33XX if AM33XX || SOC_DA8XX
default BOOTCOUNT_AT91 if AT91SAM9XE
+   default BOOTCOUNT_GENERIC
+
+config BOOTCOUNT_GENERIC
+   bool "Generic default boot counter"
+   help
+ Generic bootcount stored at SYS_BOOTCOUNT_ADDR.
+
+ SYS_BOOTCOUNT_ADDR:
+   Set to the address where the bootcount and bootcount magic
+   will be stored.
 
 config BOOTCOUNT_EXT
bool "Boot counter on EXT filesystem"
@@ -64,6 +74,7 @@ endchoice
 
 config SYS_BOOTCOUNT_SINGLEWORD
bool "Use single word to pack boot count and magic value"
+   depends on BOOTCOUNT_GENERIC
help
  This option enables packing boot count magic value and boot count
  into single word (32 bits).
diff --git a/drivers/bootcount/Makefile b/drivers/bootcount/Makefile
index a3658c1..3e1ae8c 100644
--- a/drivers/bootcount/Makefile
+++ b/drivers/bootcount/Makefile
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-y  += bootcount.o
+obj-$(CONFIG_BOOTCOUNT_GENERIC)+= bootcount.o
 obj-$(CONFIG_BOOTCOUNT_AT91)   += bootcount_at91.o
 obj-$(CONFIG_BOOTCOUNT_AM33XX) += bootcount_davinci.o
 obj-$(CONFIG_BOOTCOUNT_RAM)+= bootcount_ram.o
-- 
2.7.4

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


[U-Boot] [PATCH v2 04/13] Convert CONFIG_BOOTCOUNT_ENV to Kconfig

2018-02-15 Thread Alex Kiernan
This converts the following to Kconfig:
  CONFIG_BOOTCOUNT_ENV

Signed-off-by: Alex Kiernan 
Reviewed-by: Lukasz Majewski 
---

Changes in v2: None

 README | 11 ---
 configs/draco_defconfig|  1 +
 configs/etamin_defconfig   |  1 +
 configs/pxm2_defconfig |  1 +
 configs/rastaban_defconfig |  1 +
 configs/rut_defconfig  |  1 +
 configs/thuban_defconfig   |  1 +
 drivers/bootcount/Kconfig  | 12 
 include/configs/siemens-am33x-common.h |  2 --
 scripts/config_whitelist.txt   |  1 -
 10 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/README b/README
index cc341ac..da77484 100644
--- a/README
+++ b/README
@@ -714,17 +714,6 @@ The following options need to be configured:
RAM and NFS.
 
 - Bootcount:
-   CONFIG_BOOTCOUNT_ENV
-   If no softreset save registers are found on the hardware
-   "bootcount" is stored in the environment. To prevent a
-   saveenv on all reboots, the environment variable
-   "upgrade_available" is used. If "upgrade_available" is
-   0, "bootcount" is always 0, if "upgrade_available" is
-   1 "bootcount" is incremented in the environment.
-   So the Userspace Applikation must set the "upgrade_available"
-   and "bootcount" variable to 0, if a boot was successfully.
-
-- Pre-Boot Commands:
CONFIG_PREBOOT
 
When this option is #defined, the existence of the
diff --git a/configs/draco_defconfig b/configs/draco_defconfig
index 693d91c..0416daa 100644
--- a/configs/draco_defconfig
+++ b/configs/draco_defconfig
@@ -52,6 +52,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
diff --git a/configs/etamin_defconfig b/configs/etamin_defconfig
index e7a3d22..7d639ea 100644
--- a/configs/etamin_defconfig
+++ b/configs/etamin_defconfig
@@ -52,6 +52,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
diff --git a/configs/pxm2_defconfig b/configs/pxm2_defconfig
index 6063259..90783b4 100644
--- a/configs/pxm2_defconfig
+++ b/configs/pxm2_defconfig
@@ -55,6 +55,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
diff --git a/configs/rastaban_defconfig b/configs/rastaban_defconfig
index ce6981e..c0947e9 100644
--- a/configs/rastaban_defconfig
+++ b/configs/rastaban_defconfig
@@ -52,6 +52,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
diff --git a/configs/rut_defconfig b/configs/rut_defconfig
index b31eb97..685b4c8 100644
--- a/configs/rut_defconfig
+++ b/configs/rut_defconfig
@@ -56,6 +56,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
diff --git a/configs/thuban_defconfig b/configs/thuban_defconfig
index 4a3c0cd..f5d1077 100644
--- a/configs/thuban_defconfig
+++ b/configs/thuban_defconfig
@@ -52,6 +52,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index e905295..40a0755 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -28,6 +28,18 @@ config BOOTCOUNT_AM33XX
  This requires the RTC clocks, etc, to be enabled prior to use and
  not all boards with this IP block on it will have the RTC in use.
 
+config BOOTCOUNT_ENV
+   bool "Boot counter in environment"
+   help
+ If no softreset save registers are found on the hardware
+ "bootcount" is stored in the environment. To prevent a
+ saveenv on all reboots, the environment variable
+ "upgrade_available" is used. If "upgrade_available" is
+ 0, "bootcount" is always 0, if "upgrade_available" is
+ 1 "bootcount" is incremented in the environment.
+ So the Userspace Application must set the "upgrade_available"
+ and "bootcount" variable to 0, if a boot was successfully.
+
 endchoice
 
 config SYS_BOOTCOUNT_SINGLEWORD
diff --git a/include/configs/siemens-am33x-common.h 
b/include/configs/siemens-am33x-common.h
index 838e8d0..ed4b6cd 100644
--- a/include/configs/siemens-am33x-common.h
+++ b/include/configs/siemens-am33x-common.h
@@ -499,6 +499,4 @@
 #define CONFIG_RESET_TO_RETRY
 #define 

[U-Boot] [PATCH v2 10/13] Remove SYS_BOOTCOUNT_ADDR from Kconfig

2018-02-15 Thread Alex Kiernan
The only user of SYS_BOOTCOUNT_ADDR is mx53ppd; remove it from Kconfig
in preparation for renaming SYS_BOOTCOUNT_ADDR.

Signed-off-by: Alex Kiernan 
---

Changes in v2: None

 drivers/bootcount/Kconfig | 7 ---
 include/configs/mx53ppd.h | 2 ++
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index 9fde2f2..583d6a6 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -102,11 +102,4 @@ config SYS_BOOTCOUNT_EXT_NAME
help
  Set the filename and path of the file used to store the boot counter.
 
-config SYS_BOOTCOUNT_ADDR
-   hex "RAM address used for reading and writing the boot counter"
-   default 0x7000A000
-   depends on BOOTCOUNT_EXT
-   help
- Set the address used for reading and writing the boot counter.
-
 endif
diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h
index 79c97b5..aa1480c 100644
--- a/include/configs/mx53ppd.h
+++ b/include/configs/mx53ppd.h
@@ -241,4 +241,6 @@
#define CONFIG_VIDEO_IPUV3
 #endif
 
+#define CONFIG_SYS_BOOTCOUNT_ADDR  0x7000A000
+
 #endif /* __CONFIG_H */
-- 
2.7.4

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


[U-Boot] [PATCH v2 13/13] Remove CONFIG_SYS_BOOTCOUNT_SINGLEWORD

2018-02-15 Thread Alex Kiernan
Tidy up CONFIG_SYS_BOOTCOUNT_SINGLEWORD from the whitelist as there's
no remaining uses of it left.

Signed-off-by: Alex Kiernan 
---

Changes in v2: None

 scripts/config_whitelist.txt | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index e16085b..1e18488 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -,7 +,6 @@ CONFIG_SYS_BOARD_VERSION
 CONFIG_SYS_BOOK3E_HV
 CONFIG_SYS_BOOTCOUNT_BE
 CONFIG_SYS_BOOTCOUNT_LE
-CONFIG_SYS_BOOTCOUNT_SINGLEWORD
 CONFIG_SYS_BOOTFILE_PREFIX
 CONFIG_SYS_BOOTMAPSZ
 CONFIG_SYS_BOOTM_LEN
-- 
2.7.4

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


[U-Boot] [PATCH v2 06/13] Convert CONFIG_BOOTCOUNT_I2C to Kconfig

2018-02-15 Thread Alex Kiernan
This converts the following to Kconfig:
  CONFIG_BOOTCOUNT_I2C

Signed-off-by: Alex Kiernan 
Reviewed-by: Lukasz Majewski 
---

Changes in v2: None

 README   | 6 --
 configs/ids8313_defconfig| 1 +
 drivers/bootcount/Kconfig| 9 +
 include/configs/ids8313.h| 1 -
 scripts/config_whitelist.txt | 1 -
 5 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/README b/README
index d28a576..0157f0b 100644
--- a/README
+++ b/README
@@ -2309,12 +2309,6 @@ The following options need to be configured:
 - bootcount support:
CONFIG_AT91SAM9XE
enable special bootcounter support on at91sam9xe based boards.
-   CONFIG_BOOTCOUNT_I2C
-   enable support for the bootcounter on an i2c (like RTC) device.
-   CONFIG_SYS_I2C_RTC_ADDR = i2c chip address
-   CONFIG_SYS_BOOTCOUNT_ADDR = i2c addr which is used for
-   the bootcounter.
-   CONFIG_BOOTCOUNT_ALEN = address len
CONFIG_BOOTCOUNT_EXT
enable support for the bootcounter in EXT filesystem
CONFIG_SYS_BOOTCOUNT_ADDR = RAM address used for read
diff --git a/configs/ids8313_defconfig b/configs/ids8313_defconfig
index b754758..ca14815 100644
--- a/configs/ids8313_defconfig
+++ b/configs/ids8313_defconfig
@@ -30,6 +30,7 @@ 
CONFIG_MTDIDS_DEFAULT="nor0=ff80.flash,nand0=e100.flash"
 
CONFIG_MTDPARTS_DEFAULT="mtdparts=ff80.flash:7m(dum),768k(BOOT-BIN),128k(BOOT-ENV),128k(BOOT-REDENV);e100.flash:-(ubi)"
 CONFIG_CMD_UBI=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_I2C=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_PHYLIB=y
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index eabfd13..8c19ae6 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -46,6 +46,15 @@ config BOOTCOUNT_RAM
  Store the bootcount in DRAM protected against against bit errors
  due to short power loss or holding a system in RESET.
 
+config BOOTCOUNT_I2C
+   bool "Boot counter on I2C device"
+   help
+ Enable support for the bootcounter on an i2c (like RTC) device.
+ CONFIG_SYS_I2C_RTC_ADDR = i2c chip address
+ CONFIG_SYS_BOOTCOUNT_ADDR = i2c addr which is used for
+ the bootcounter.
+ CONFIG_BOOTCOUNT_ALEN = address len
+
 endchoice
 
 config SYS_BOOTCOUNT_SINGLEWORD
diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index 628e0a2..099d7bd 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -515,7 +515,6 @@
 #define CONFIG_MTD_PARTITIONS
 
 /* bootcount support */
-#define CONFIG_BOOTCOUNT_I2C
 #define CONFIG_BOOTCOUNT_ALEN  1
 #define CONFIG_SYS_BOOTCOUNT_ADDR  0x9
 
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 312d4bb..a8380c6 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -148,7 +148,6 @@ CONFIG_BOOGER
 CONFIG_BOOM
 CONFIG_BOOTBLOCK
 CONFIG_BOOTCOUNT_ALEN
-CONFIG_BOOTCOUNT_I2C
 CONFIG_BOOTFILE
 CONFIG_BOOTMAPSZ
 CONFIG_BOOTMODE
-- 
2.7.4

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


[U-Boot] [PATCH v2 05/13] Convert CONFIG_BOOTCOUNT_RAM to Kconfig

2018-02-15 Thread Alex Kiernan
This converts the following to Kconfig:
  CONFIG_BOOTCOUNT_RAM

Signed-off-by: Alex Kiernan 
Reviewed-by: Lukasz Majewski 
---

Changes in v2: None

 README   | 2 --
 configs/km_kirkwood_128m16_defconfig | 1 +
 configs/km_kirkwood_defconfig| 1 +
 configs/km_kirkwood_pci_defconfig| 1 +
 configs/kmcoge5un_defconfig  | 1 +
 configs/kmnusa_defconfig | 1 +
 configs/kmsugp1_defconfig| 1 +
 configs/kmsuv31_defconfig| 1 +
 configs/mgcoge3un_defconfig  | 1 +
 configs/portl2_defconfig | 1 +
 configs/theadorable_debug_defconfig  | 1 +
 drivers/bootcount/Kconfig| 6 ++
 include/configs/km/km_arm.h  | 2 --
 include/configs/theadorable.h| 1 -
 scripts/config_whitelist.txt | 1 -
 15 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/README b/README
index da77484..d28a576 100644
--- a/README
+++ b/README
@@ -2309,8 +2309,6 @@ The following options need to be configured:
 - bootcount support:
CONFIG_AT91SAM9XE
enable special bootcounter support on at91sam9xe based boards.
-   CONFIG_BOOTCOUNT_RAM
-   enable support for the bootcounter in RAM
CONFIG_BOOTCOUNT_I2C
enable support for the bootcounter on an i2c (like RTC) device.
CONFIG_SYS_I2C_RTC_ADDR = i2c chip address
diff --git a/configs/km_kirkwood_128m16_defconfig 
b/configs/km_kirkwood_128m16_defconfig
index 54c22a7..5f378f7 100644
--- a/configs/km_kirkwood_128m16_defconfig
+++ b/configs/km_kirkwood_128m16_defconfig
@@ -27,6 +27,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_EEPROM=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/km_kirkwood_defconfig b/configs/km_kirkwood_defconfig
index 20ea24b..ae20d24 100644
--- a/configs/km_kirkwood_defconfig
+++ b/configs/km_kirkwood_defconfig
@@ -27,6 +27,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_EEPROM=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/km_kirkwood_pci_defconfig 
b/configs/km_kirkwood_pci_defconfig
index 402610c..22bc6cd 100644
--- a/configs/km_kirkwood_pci_defconfig
+++ b/configs/km_kirkwood_pci_defconfig
@@ -27,6 +27,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_EEPROM=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/kmcoge5un_defconfig b/configs/kmcoge5un_defconfig
index 72aee04..5c123a4 100644
--- a/configs/kmcoge5un_defconfig
+++ b/configs/kmcoge5un_defconfig
@@ -27,6 +27,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/kmnusa_defconfig b/configs/kmnusa_defconfig
index ac82780..4749ead 100644
--- a/configs/kmnusa_defconfig
+++ b/configs/kmnusa_defconfig
@@ -27,6 +27,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/kmsugp1_defconfig b/configs/kmsugp1_defconfig
index af2c93e3..de68d41 100644
--- a/configs/kmsugp1_defconfig
+++ b/configs/kmsugp1_defconfig
@@ -27,6 +27,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/kmsuv31_defconfig b/configs/kmsuv31_defconfig
index 09d75ab..892f212 100644
--- a/configs/kmsuv31_defconfig
+++ b/configs/kmsuv31_defconfig
@@ -27,6 +27,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/mgcoge3un_defconfig b/configs/mgcoge3un_defconfig
index 3e90e70..89a83fd 100644
--- a/configs/mgcoge3un_defconfig
+++ b/configs/mgcoge3un_defconfig
@@ -27,6 +27,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_EEPROM=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/configs/portl2_defconfig b/configs/portl2_defconfig
index 1c6dad9..8a6d996 100644
--- a/configs/portl2_defconfig
+++ b/configs/portl2_defconfig
@@ -27,6 +27,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_EEPROM=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_RAM=y
 # CONFIG_MMC is not set
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git 

[U-Boot] [PATCH v2 03/13] Convert CONFIG_BOOTCOUNT_AM33XX to Kconfig

2018-02-15 Thread Alex Kiernan
This converts the following to Kconfig:
  CONFIG_BOOTCOUNT_AM33XX

Reviewed-by: Lukasz Majewski 
Reviewed-by: Hannes Schmelzer 
Acked-by: Hannes Schmelzer 
Signed-off-by: Alex Kiernan 
---

Changes in v2: None

 README| 2 --
 drivers/bootcount/Kconfig | 9 +
 drivers/bootcount/Makefile| 1 -
 include/configs/am335x_evm.h  | 1 -
 include/configs/am335x_sl50.h | 1 -
 include/configs/baltos.h  | 2 --
 include/configs/bav335x.h | 1 -
 include/configs/brppt1.h  | 1 -
 include/configs/chiliboard.h  | 1 -
 scripts/config_whitelist.txt  | 1 -
 10 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/README b/README
index dc4c329..cc341ac 100644
--- a/README
+++ b/README
@@ -2320,8 +2320,6 @@ The following options need to be configured:
 - bootcount support:
CONFIG_AT91SAM9XE
enable special bootcounter support on at91sam9xe based boards.
-   CONFIG_SOC_DA8XX
-   enable special bootcounter support on da850 based boards.
CONFIG_BOOTCOUNT_RAM
enable support for the bootcounter in RAM
CONFIG_BOOTCOUNT_I2C
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index 26fec89..e905295 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -12,6 +12,7 @@ if BOOTCOUNT_LIMIT
 
 choice
prompt "Boot count device"
+   default BOOTCOUNT_AM33XX if AM33XX || SOC_DA8XX
 
 config BOOTCOUNT_EXT
bool "Boot counter on EXT filesystem"
@@ -19,6 +20,14 @@ config BOOTCOUNT_EXT
  Add support for maintaining boot count in a file on an EXT
  filesystem.
 
+config BOOTCOUNT_AM33XX
+   bool "Boot counter in AM33XX RTC IP block"
+   depends on AM33XX || SOC_DA8XX
+   help
+ A bootcount driver for the RTC IP block found on many TI platforms.
+ This requires the RTC clocks, etc, to be enabled prior to use and
+ not all boards with this IP block on it will have the RTC in use.
+
 endchoice
 
 config SYS_BOOTCOUNT_SINGLEWORD
diff --git a/drivers/bootcount/Makefile b/drivers/bootcount/Makefile
index 45445d2..62bf55e 100644
--- a/drivers/bootcount/Makefile
+++ b/drivers/bootcount/Makefile
@@ -4,7 +4,6 @@
 
 obj-y  += bootcount.o
 obj-$(CONFIG_AT91SAM9XE)   += bootcount_at91.o
-obj-$(CONFIG_SOC_DA8XX)+= bootcount_davinci.o
 obj-$(CONFIG_BOOTCOUNT_AM33XX) += bootcount_davinci.o
 obj-$(CONFIG_BOOTCOUNT_RAM)+= bootcount_ram.o
 obj-$(CONFIG_BOOTCOUNT_ENV)+= bootcount_env.o
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index cacc262..442f6c4 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -177,7 +177,6 @@
 /* SPL */
 #ifndef CONFIG_NOR_BOOT
 /* Bootcount using the RTC block */
-#define CONFIG_BOOTCOUNT_AM33XX
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 /* USB gadget RNDIS */
diff --git a/include/configs/am335x_sl50.h b/include/configs/am335x_sl50.h
index 1cb3578..4bcbaee 100644
--- a/include/configs/am335x_sl50.h
+++ b/include/configs/am335x_sl50.h
@@ -74,7 +74,6 @@
 /* SPL */
 
 /* Bootcount using the RTC block */
-#define CONFIG_BOOTCOUNT_AM33XX
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
diff --git a/include/configs/baltos.h b/include/configs/baltos.h
index 440dbf5..10979c7 100644
--- a/include/configs/baltos.h
+++ b/include/configs/baltos.h
@@ -230,8 +230,6 @@
 
 /* SPL */
 #ifndef CONFIG_NOR_BOOT
-/* Bootcount using the RTC block */
-#define CONFIG_BOOTCOUNT_AM33XX
 
 /* USB gadget RNDIS */
 
diff --git a/include/configs/bav335x.h b/include/configs/bav335x.h
index 5ea7658..48cd285 100644
--- a/include/configs/bav335x.h
+++ b/include/configs/bav335x.h
@@ -339,7 +339,6 @@ DEFAULT_LINUX_BOOT_ENV \
 /* SPL */
 #ifndef CONFIG_NOR_BOOT
 /* Bootcount using the RTC block */
-#define CONFIG_BOOTCOUNT_AM33XX
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 /* USB gadget RNDIS */
diff --git a/include/configs/brppt1.h b/include/configs/brppt1.h
index fb2845f..30ea2d2 100644
--- a/include/configs/brppt1.h
+++ b/include/configs/brppt1.h
@@ -22,7 +22,6 @@
 
 /* Bootcount using the RTC block */
 #define CONFIG_SYS_BOOTCOUNT_ADDR  0x44E3E000
-#define CONFIG_BOOTCOUNT_AM33XX
 
 /* memory */
 #define CONFIG_SYS_MALLOC_LEN  (5 * 1024 * 1024)
diff --git a/include/configs/chiliboard.h b/include/configs/chiliboard.h
index 234cd6a..92e0479 100644
--- a/include/configs/chiliboard.h
+++ b/include/configs/chiliboard.h
@@ -123,7 +123,6 @@
 
 /* SPL */
 /* Bootcount using the RTC block */
-#define CONFIG_BOOTCOUNT_AM33XX
 #define CONFIG_SYS_BOOTCOUNT_BE
 
 /* NAND: device related configs */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index b3a5d93..ccaac48 100644
--- a/scripts/config_whitelist.txt
+++ 

[U-Boot] [PATCH v2 02/13] Prepare for multiple bootcount drivers

2018-02-15 Thread Alex Kiernan
Reviewed-by: Lukasz Majewski 
Signed-off-by: Alex Kiernan 
---

Changes in v2: None

 drivers/bootcount/Kconfig | 25 +++--
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index da2ccab..26fec89 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -2,29 +2,30 @@
 # Boot count configuration
 #
 
-menu "Boot count support"
-
-config BOOTCOUNT_LIMIT
+menuconfig BOOTCOUNT_LIMIT
bool "Enable support for checking boot count limit"
help
  Enable checking for exceeding the boot count limit.
  More information: http://www.denx.de/wiki/DULG/UBootBootCountLimit
 
-config SYS_BOOTCOUNT_SINGLEWORD
-   bool "Use single word to pack boot count and magic value"
-   help
- This option enables packing boot count magic value and boot count
- into single word (32 bits).
-
 if BOOTCOUNT_LIMIT
 
+choice
+   prompt "Boot count device"
+
 config BOOTCOUNT_EXT
bool "Boot counter on EXT filesystem"
help
  Add support for maintaining boot count in a file on an EXT
  filesystem.
 
-if BOOTCOUNT_EXT
+endchoice
+
+config SYS_BOOTCOUNT_SINGLEWORD
+   bool "Use single word to pack boot count and magic value"
+   help
+ This option enables packing boot count magic value and boot count
+ into single word (32 bits).
 
 config SYS_BOOTCOUNT_EXT_INTERFACE
string "Interface on which to find boot counter EXT filesystem"
@@ -57,7 +58,3 @@ config SYS_BOOTCOUNT_ADDR
  Set the address used for reading and writing the boot counter.
 
 endif
-
-endif
-
-endmenu
-- 
2.7.4

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


[U-Boot] [PATCH v2 01/13] Merge CONFIG_BOOTCOUNT and CONFIG_BOOTCOUNT_LIMIT

2018-02-15 Thread Alex Kiernan
CONFIG_BOOTCOUNT was only used in mx53ppd, merge it with
CONFIG_BOOTCOUNT_LIMIT

CONFIG_BOOTCOUNT was only used in mx53ppd, merge it with
CONFIG_BOOTCOUNT_LIMIT

Signed-off-by: Alex Kiernan 
Reviewed-by: Lukasz Majewski 
Reviewed-by: Ian Ray 
---

Changes in v2:
- Fix erroneously removed line in README
- Convert CONFIG_BOOTCOUNT_EXT too - it had only been partially done
- Reword CONFIG_BOOTCOUNT_DRAM
- Update README for AT91 driver
- Remove CONFIG_BOOTCOUNT_LIMIT and CONFIG_SYS_BOOTCOUNT_SINGLEWORD
  from whitelist
- Rename CONFIG_SYS_BOOTCOUNT_ADDR to BOOTCOUNT_ADDR and remove from
  Kconfig
- Migrate CONFIG_BOOTCOUNT_ALEN to Kconfig

 configs/mx53ppd_defconfig| 1 -
 drivers/bootcount/Kconfig| 9 +
 scripts/config_whitelist.txt | 1 -
 3 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
index 90df425..7e3dd6d 100644
--- a/configs/mx53ppd_defconfig
+++ b/configs/mx53ppd_defconfig
@@ -21,7 +21,6 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
-CONFIG_BOOTCOUNT=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_EXT=y
 CONFIG_SYS_BOOTCOUNT_EXT_DEVPART="0:5"
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index d82289f..da2ccab 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -4,13 +4,6 @@
 
 menu "Boot count support"
 
-config BOOTCOUNT
-   bool "Enable Boot count support"
-   help
- Enable boot count support, which provides the ability to store the
- number of times the board has booted on a number of different
- persistent storage mediums.
-
 config BOOTCOUNT_LIMIT
bool "Enable support for checking boot count limit"
help
@@ -23,7 +16,7 @@ config SYS_BOOTCOUNT_SINGLEWORD
  This option enables packing boot count magic value and boot count
  into single word (32 bits).
 
-if BOOTCOUNT
+if BOOTCOUNT_LIMIT
 
 config BOOTCOUNT_EXT
bool "Boot counter on EXT filesystem"
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 38ce88e..b3a5d93 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -151,7 +151,6 @@ CONFIG_BOOTCOUNT_ALEN
 CONFIG_BOOTCOUNT_AM33XX
 CONFIG_BOOTCOUNT_ENV
 CONFIG_BOOTCOUNT_I2C
-CONFIG_BOOTCOUNT_LIMIT
 CONFIG_BOOTCOUNT_RAM
 CONFIG_BOOTFILE
 CONFIG_BOOTMAPSZ
-- 
2.7.4

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


Re: [U-Boot] [PATCH v3 1/2] i.MX6: nand: add nandbcb update command

2018-02-15 Thread Jagan Teki
On Fri, Feb 9, 2018 at 12:56 AM, Fabio Estevam  wrote:
> Hi Stefan,
>
> On Wed, Feb 7, 2018 at 3:02 PM,   wrote:
>
>> Thanks for working on that! We carry a similar command since a while
>> downstream and I hoped since quite a while to get some time to upstream
>> it:
>>
>> http://git.toradex.com/cgit/u-boot-toradex.git/tree/arch/arm/imx-common/cmd_writebcb_mx7.c?h=2016.11-toradex
>
> Looks like an elegant implementation!
>
> Jagan,
>
> Could you please consider bringing Stefan's work upstream?

Look good to me as well, let us give some time to review.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] How to test new bootloaders on Jetson TX1?

2018-02-15 Thread Andreas Färber
Hi Mikko,

Am 15.02.2018 um 08:56 schrieb Mikko Perttunen:
> In the cboot + U-Boot combination, cboot loads U-Boot from the usual
> kernel partition (LNX or kernel depending on system), so flashing U-Boot
> there should do the trick. I believe this did indeed change in some L4T
> version, so the wiki page needs to be updated. Tom should know more
> about this.

Thanks for explaining.

The LNX partition is getting a boot.img - what is the relation to the
four U-Boot files? flash.sh source is not really helping here.

Might any changes to RP1 and/or DTB partitions be necessary to match my
newer U-Boot, or does U-Boot use an internal .dtb these days?

Is there any more efficient way to flash just U-Boot? -k LNX possibly?

I had played with the -L option before (which mentions u-boot-dtb.bin),
but recall it ran into some form of checksum error on boot when passing
it my file...

> I expect Varun to know the details about ATF, but I'll check if I can
> find some answer myself.

Thanks again for your efforts.

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] Please pull ARC changes

2018-02-15 Thread Alexey Brodkin
Hi Tom,

This is just a quite subtle fix that allows to use Elf32 toolchain
for building U-Boot so I do believe it qualifies for the next RC and
some technical background below.

For quite some time we used to use uClibc toolchain for building U-Boot
just because it was our default toolchain. But when I tried to use
pre-built toolchain from kernel.org for example this one:
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/7.3.0/x86_64-gcc-7.3.0-nolibc_arc-elf.tar.gz

I bumped into a trivial problem which is solved now.
That said recent kernel.org toolchains could be used for ARC once
buildman switches to them.

Anyways...

The following changes since commit 0c502b6c176281a096a23803e517b19e964485f1:

  configs: Resync with savedefconfig (2018-02-14 21:34:50 -0500)

are available in the Git repository at:

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

for you to fetch changes up to d53b128df40d8b2f5dd87cac194163fca2bc17ed:

  arc: Fix final linkage with Elf32 tools (2018-02-15 15:44:47 +0300)


Alexey Brodkin (1):
  arc: Fix final linkage with Elf32 tools

 arch/arc/config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


[U-Boot] [PATCH] ARM: rmobile: Fix the memory map on Gen3

2018-02-15 Thread Marek Vasut
Fix up the memory map on Gen3 to match datasheet properly.
This simplifies the memory map setup as well, since we do
no longer need this massive complexity.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/mach-rmobile/cpu_info.c |  3 -
 arch/arm/mach-rmobile/include/mach/rmobile.h |  1 -
 arch/arm/mach-rmobile/memmap-gen3.c  | 91 +++-
 3 files changed, 9 insertions(+), 86 deletions(-)

diff --git a/arch/arm/mach-rmobile/cpu_info.c b/arch/arm/mach-rmobile/cpu_info.c
index ad9f86c5b8..5fb4d3347c 100644
--- a/arch/arm/mach-rmobile/cpu_info.c
+++ b/arch/arm/mach-rmobile/cpu_info.c
@@ -18,9 +18,6 @@ int arch_cpu_init(void)
 #ifndef CONFIG_SYS_DCACHE_OFF
 void enable_caches(void)
 {
-#if defined(CONFIG_RCAR_GEN3)
-   rcar_gen3_memmap_fixup();
-#endif
dcache_enable();
 }
 #endif
diff --git a/arch/arm/mach-rmobile/include/mach/rmobile.h 
b/arch/arm/mach-rmobile/include/mach/rmobile.h
index f4db42c34b..995871fb27 100644
--- a/arch/arm/mach-rmobile/include/mach/rmobile.h
+++ b/arch/arm/mach-rmobile/include/mach/rmobile.h
@@ -40,7 +40,6 @@
 u32 rmobile_get_cpu_type(void);
 u32 rmobile_get_cpu_rev_integer(void);
 u32 rmobile_get_cpu_rev_fraction(void);
-void rcar_gen3_memmap_fixup(void);
 #endif /* __ASSEMBLY__ */
 
 #endif /* __ASM_ARCH_RMOBILE_H */
diff --git a/arch/arm/mach-rmobile/memmap-gen3.c 
b/arch/arm/mach-rmobile/memmap-gen3.c
index 199c2c2aea..52cd000a17 100644
--- a/arch/arm/mach-rmobile/memmap-gen3.c
+++ b/arch/arm/mach-rmobile/memmap-gen3.c
@@ -9,77 +9,24 @@
 #include 
 #include 
 
-static struct mm_region r8a7795_mem_map[] = {
+static struct mm_region gen3_mem_map[] = {
{
.virt = 0x0UL,
.phys = 0x0UL,
-   .size = 0x8000UL,
-   .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
-PTE_BLOCK_INNER_SHARE
-   }, {
-   .virt = 0x8000UL,
-   .phys = 0x8000UL,
-   .size = 0x8000UL,
-   .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
-PTE_BLOCK_NON_SHARE |
-PTE_BLOCK_PXN | PTE_BLOCK_UXN
-   }, {
-   /* List terminator */
-   0,
-   }
-};
-
-static struct mm_region r8a7796_mem_map[] = {
-   {
-   .virt = 0x0UL,
-   .phys = 0x0UL,
-   .size = 0xe000UL,
-   .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
-PTE_BLOCK_INNER_SHARE
-   }, {
-   .virt = 0xe000UL,
-   .phys = 0xe000UL,
-   .size = 0xe000UL,
+   .size = 0x4000UL,
.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
 PTE_BLOCK_NON_SHARE |
 PTE_BLOCK_PXN | PTE_BLOCK_UXN
}, {
-   /* List terminator */
-   0,
-   }
-};
-
-static struct mm_region r8a77970_mem_map[] = {
-   {
-   .virt = 0x0UL,
-   .phys = 0x0UL,
-   .size = 0xe000UL,
-   .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
-PTE_BLOCK_INNER_SHARE
-   }, {
-   .virt = 0xe000UL,
-   .phys = 0xe000UL,
-   .size = 0xe000UL,
-   .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
-PTE_BLOCK_NON_SHARE |
-PTE_BLOCK_PXN | PTE_BLOCK_UXN
-   }, {
-   /* List terminator */
-   0,
-   }
-};
-
-static struct mm_region r8a77995_mem_map[] = {
-   {
-   .virt = 0x0UL,
-   .phys = 0x0UL,
-   .size = 0xe000UL,
+   .virt = 0x4000UL,
+   .phys = 0x4000UL,
+   .size = 0x8000UL,
.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
 PTE_BLOCK_INNER_SHARE
}, {
-   .virt = 0xe000UL,
-   .phys = 0xe000UL,
-   .size = 0xe000UL,
+   .virt = 0xc000UL,
+   .phys = 0xc000UL,
+   .size = 0x4000UL,
.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
 PTE_BLOCK_NON_SHARE |
 PTE_BLOCK_PXN | PTE_BLOCK_UXN
@@ -89,24 +36,4 @@ static struct mm_region r8a77995_mem_map[] = {
}
 };
 
-struct mm_region *mem_map = r8a7795_mem_map;
-
-void rcar_gen3_memmap_fixup(void)
-{
-   u32 cpu_type = rmobile_get_cpu_type();
-
-   switch (cpu_type) {
-   case RMOBILE_CPU_TYPE_R8A7795:
-   mem_map = r8a7795_mem_map;
-   break;
-   case RMOBILE_CPU_TYPE_R8A7796:
-   mem_map = r8a7796_mem_map;
-   break;
-   case RMOBILE_CPU_TYPE_R8A77970:
-   mem_map = r8a77970_mem_map;
-   break;
-   case 

[U-Boot] [PATCH] arc: Fix final linkage with Elf32 tools

2018-02-15 Thread Alexey Brodkin
ARC Elf32 tools by default enable usage of so-called "small data"
section or in ARC PRM parlance "GP-relative addressing".

The idea is to put up to 2kB of frequently used data into a separate
location and use indirect addressing via dedicated core register (GP).
Where GP is used as a base for offset calculation.

And so if "-msdata" toggle is passed to the compiler either explicitly
or implicitly (that's Elf32 tools case) it will try to put some data
in that "small data" area and then to calculate real offset from GP
to be encoded in instructions we need to know the base value which
liker gets from __SDATA_BEGIN__ symbol in hte linker script.

In U-Boot we don't use that feature and linker script doesn't define
__SDATA_BEGIN__ which gives us the following linkage error if we use
Elf32 tools:
->8---
  LD  u-boot
.../bin/arc-elf32-ld.bfd: Error: Linker symbol __SDATA_BEGIN__ not found
.../bin/arc-elf32-ld.bfd: final link failed: Bad value
->8---

Note if uClibc or glibc tools are used that problem doesn't happen
because usage of "small data section" is disabled by default as not very
useful for bigger executables. Moreover GP is just another name of r26
so we're loosing 1 core register which is not used by the compiler as a
generic register with "-msdata".

Signed-off-by: Alexey Brodkin 
---
 arch/arc/config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arc/config.mk b/arch/arc/config.mk
index 13676bd0c8e1..3ed0c282bae0 100644
--- a/arch/arc/config.mk
+++ b/arch/arc/config.mk
@@ -50,7 +50,7 @@ ifdef CONFIG_CPU_ARCHS38
 PLATFORM_CPPFLAGS += -mcpu=archs
 endif
 
-PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2
+PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2 -mno-sdata
 
 # Needed for relocation
 LDFLAGS_FINAL += -pie
-- 
2.14.3

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


[U-Boot] [PATCH] ARM: rmobile: Enable autocompletion on Gen3

2018-02-15 Thread Marek Vasut
This makes the shell so much more pleasant to use, so enable it.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
---
 include/configs/rcar-gen3-common.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/rcar-gen3-common.h 
b/include/configs/rcar-gen3-common.h
index a16d26be99..226069d67c 100644
--- a/include/configs/rcar-gen3-common.h
+++ b/include/configs/rcar-gen3-common.h
@@ -16,6 +16,7 @@
 
 /* boot option */
 #define CONFIG_SUPPORT_RAW_INITRD
+#define CONFIG_AUTO_COMPLETE
 
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_SETUP_MEMORY_TAGS
-- 
2.15.1

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


Re: [U-Boot] How to test new bootloaders on Jetson TX1?

2018-02-15 Thread Andreas Färber
Am 15.02.2018 um 10:22 schrieb Jon Hunter:
> On 15/02/18 01:51, Andreas Färber wrote:
>> I would like to test the latest version of U-Boot on the Jetson TX1.
[...]
>> Here's what I have tried:
>>
>> $ sudo ./flash.sh p2371-2180-devkit mmcblk0p1
> This should work. Which u-boot binary are you copying and where are you
> copying it?
> 
> I copy the u-boot-dtb.bin over u-boot.bin in the L4T directory
> Linux_for_Tegra/bootloader/t186ref/p2771-/500/u-boot.bin.

I downloaded the .rpm from
https://build.opensuse.org/package/show/hardware:boot/u-boot-p2371-2180
extracting all of u-boot, u-boot.bin, u-boot.dtb and u-boot-dtb.bin to
bootloader/t210ref/p2371-2180/ - and as described it makes a difference
in that it then ceases to boot to a U-Boot prompt.

I then have to use jumper J9 to enter RCM again.

So something is getting flashed, it's just not working right.

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 1/1] cmd: scsi: move CMD_SCSI to device access commands

2018-02-15 Thread Tom Rini
On Wed, Feb 14, 2018 at 08:05:44AM +0100, Heinrich Schuchardt wrote:

> Configuration option CMD_SCSI should be placed in the same submenu as
> CMD_SATA and CMD_MMC.
> 
> Signed-off-by: Heinrich Schuchardt 

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


Re: [U-Boot] am335x_evm: Consolidate eMMC partitions with DFU info

2018-02-15 Thread Tom Rini
On Wed, Feb 07, 2018 at 08:41:32PM +0200, Sam Protsenko wrote:

> >From DFU_ALT_INFO_EMMC (include/environment/ti/dfu.h) we can see that
> rootfs will be flashed to second partition on eMMC. But at the moment we
> have only one partition in $partitions environment variable. Let's add
> "bootloader" partition prior to "rootfs", so that DFU works correctly.
> This also fixes eMMC boot, which looks for rootfs on second partition.
> 
> "bootloader" partition start corresponds to "u-boot.img.raw" in DFU
> eMMC info, which is 0x300 sector (384 KiB offset from eMMC start).
> 
> rootfs start address can be also found from DFU eMMC info.
> bootloader-related area is finished at 0x1500 sector (2688 KiB offset
> from eMMC start). This should be the start address for rootfs in
> $partitions environment variable.
> 
> While at it, fix U-Boot environment address to be the same as for
> AM57x EVM, so that it doesn't clash with other partitions.
> 
> So now eMMC layout looks like this:
> 
> ===
> 
> 0   ++
> | MBR/GPT header |   128   -
> 128 ++
> | MLO|   256   -
> 384 ++
> | u-boot.img |   1792  bootloader
> 2176++
> |  hole  |   256   -
> 2432++
> | U-Boot environment |   128   -
> 2560++
> | U-Boot environment |   128   -
> | (redundant)|
> 2688++
> | rootfs |   remaining rootfs
> end ++
> 
> ===
> 
> "hole" area can be used further for storing U-Boot environment (like
> it's done in AM57x EVM config file) or for increasing u-boot.img area
> (in case u-boot.img size increased, e.g. if new dtbs were added).
> 
> This commit conforms with Linux partition table from f6d245b8c56c
> ("arm: am57xx: Fix Linux boot from eMMC") commit, making things in
> uniform way.
> 
> Signed-off-by: Sam Protsenko 
> Reviewed-by: Lokesh Vutla 
> Reviewed-by: Tom Rini 

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


Re: [U-Boot] [U-Boot, 1/2] configs: Drop unused CONFIG_SPL_MMC_MINIMAL

2018-02-15 Thread Tom Rini
On Tue, Feb 06, 2018 at 12:15:37PM -0500, Tom Rini wrote:

> The option CONFIG_SPL_MMC_MINIMAL is unused in code, drop it.
> 
> Signed-off-by: Tom Rini 

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


Re: [U-Boot] arm/PSCI: support PSCI versions greater than 1.0

2018-02-15 Thread Tom Rini
On Fri, Feb 09, 2018 at 08:10:22AM +0100, Andre Heider wrote:

> ATF recently began announcing PSCI v1.1. Since that version is unknown
> to u-boot, the PSCI device nodes were not updated.
> 
> Switch from the case statement to a greater/less-than comparison so that
> v1.1, as well as future versions, get at least the compatible nodes of
> known versions.
> 
> PSCI v1.1 doesn't seem to have introduced a new corresponding compatible.
> 
> Signed-off-by: Andre Heider 

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


Re: [U-Boot] [U-Boot,v2] Fix --noheader on fw_printenv

2018-02-15 Thread Tom Rini
On Sun, Feb 11, 2018 at 05:16:46PM +, Alex Kiernan wrote:

> The single argument `--noheader' is expecting isn't taken from getopt
> parsing, but instead from the remaining argv arguments.
> 
> Signed-off-by: Alex Kiernan 

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


Re: [U-Boot] [U-Boot, v3] spl: unbreak CONFIG_SPL_MULTI_DTB_FIT after fixing CONFIG_OF_EMBED

2018-02-15 Thread Tom Rini
On Wed, Feb 14, 2018 at 06:44:36AM +0100, Simon Goldschmidt wrote:

> With commit 9bd76b807636 ("spl: make CONFIG_OF_EMBED pass dts through
> fdtgrep"), CONFIG_SPL_MULTI_DTB_FIT has been broken because
> cmd_fdtgrep was now unknown in scripts/Makefile.spl after moving
> it to dts/Makefile. This bug has been introduced with v2018.01.
> 
> This patch moves cmd_fdtgrep from dts/Makefile to scripts/Makefile.lib
> and includes scripts/Makefile.lib in scripts/Makefile.spl.
> 
> Fixes: 9bd76b807636 ("spl: make CONFIG_OF_EMBED pass dts through fdtgrep")
> Reported-by: Lokesh Vutla 
> Signed-off-by: Simon Goldschmidt 
> Reviewed-by: Lokesh Vutla 

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


Re: [U-Boot] [U-Boot,2/2] configs: Migrate CONFIG_SPL_FRAMEWORK

2018-02-15 Thread Tom Rini
On Tue, Feb 06, 2018 at 12:15:38PM -0500, Tom Rini wrote:

> Migrate the option CONFIG_SPL_FRAMEWORK and make this gate most of the
> current set of options we have in Kconfig.  We will need to have some
> options available for SPL and !SPL_FRAMEWORK so this is important.  In a
> few cases we re-order existing options so that we have less escapes from
> the SPL_FRAMEWORK guard.
> 
> Signed-off-by: Tom Rini 

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


Re: [U-Boot] [U-Boot, 2/2] configs: am335x_evm: Add DYNAMIC_CRC_TABLE

2018-02-15 Thread Tom Rini
On Tue, Feb 06, 2018 at 07:15:59PM +0530, Faiz Abbas wrote:

> Add CONFIG_DYNAMIC_CRC_TABLE to am335x_evm_defconfig to reduce the
> size of the image.
> 
> Signed-off-by: Faiz Abbas 

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


Re: [U-Boot] [U-Boot, 1/2] lib: Kconfig: Move DYNAMIC_CRC_TABLE to Kconfig

2018-02-15 Thread Tom Rini
On Tue, Feb 06, 2018 at 07:15:58PM +0530, Faiz Abbas wrote:

> Add CONFIG prefix to DYNAMIC_CRC_TABLE and implement it in
> Kconfig.
> 
> Signed-off-by: Faiz Abbas 

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


Re: [U-Boot] [U-Boot, v2] configs: am335x_evm: Disable ISO and EFI partitions in SPL

2018-02-15 Thread Tom Rini
On Mon, Feb 05, 2018 at 07:22:29PM +0530, Faiz Abbas wrote:

> ISO and EFI partition configs in SPL are selected by default.
> However, they are not being used.
> 
> Therefore, remove ISO and EFI partition support in SPL.
> 
> Signed-off-by: Faiz Abbas 
> Reviewed-by: Tom Rini 

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] ARM: rmobile: Enable DTO support on Gen3

2018-02-15 Thread Marek Vasut
Enable support for applying DT overlays on Gen3. This is convenient
for handling extra additional hardware, like ie. the Kingfisher.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
---
 configs/r8a7795_salvator-x_defconfig | 1 +
 configs/r8a7795_ulcb_defconfig   | 1 +
 configs/r8a7796_salvator-x_defconfig | 1 +
 configs/r8a7796_ulcb_defconfig   | 1 +
 configs/r8a77970_eagle_defconfig | 1 +
 configs/r8a77995_draak_defconfig | 1 +
 6 files changed, 6 insertions(+)

diff --git a/configs/r8a7795_salvator-x_defconfig 
b/configs/r8a7795_salvator-x_defconfig
index 816b437baa..c7613218ba 100644
--- a/configs/r8a7795_salvator-x_defconfig
+++ b/configs/r8a7795_salvator-x_defconfig
@@ -72,4 +72,5 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
 CONFIG_USB_STORAGE=y
+CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SMBIOS_MANUFACTURER=""
diff --git a/configs/r8a7795_ulcb_defconfig b/configs/r8a7795_ulcb_defconfig
index 5a561f721f..7879e28d2a 100644
--- a/configs/r8a7795_ulcb_defconfig
+++ b/configs/r8a7795_ulcb_defconfig
@@ -73,4 +73,5 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
 CONFIG_USB_STORAGE=y
+CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SMBIOS_MANUFACTURER=""
diff --git a/configs/r8a7796_salvator-x_defconfig 
b/configs/r8a7796_salvator-x_defconfig
index 40a5f2d9bf..ecfa4f6987 100644
--- a/configs/r8a7796_salvator-x_defconfig
+++ b/configs/r8a7796_salvator-x_defconfig
@@ -73,4 +73,5 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
 CONFIG_USB_STORAGE=y
+CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SMBIOS_MANUFACTURER=""
diff --git a/configs/r8a7796_ulcb_defconfig b/configs/r8a7796_ulcb_defconfig
index a573db479b..1af4b1b7b3 100644
--- a/configs/r8a7796_ulcb_defconfig
+++ b/configs/r8a7796_ulcb_defconfig
@@ -74,4 +74,5 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
 CONFIG_USB_STORAGE=y
+CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SMBIOS_MANUFACTURER=""
diff --git a/configs/r8a77970_eagle_defconfig b/configs/r8a77970_eagle_defconfig
index 7cd8046c08..434b41631f 100644
--- a/configs/r8a77970_eagle_defconfig
+++ b/configs/r8a77970_eagle_defconfig
@@ -66,4 +66,5 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
 CONFIG_USB_STORAGE=y
+CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SMBIOS_MANUFACTURER=""
diff --git a/configs/r8a77995_draak_defconfig b/configs/r8a77995_draak_defconfig
index 09033c9a96..1a084c43f3 100644
--- a/configs/r8a77995_draak_defconfig
+++ b/configs/r8a77995_draak_defconfig
@@ -70,4 +70,5 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
 CONFIG_USB_STORAGE=y
+CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SMBIOS_MANUFACTURER=""
-- 
2.15.1

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


[U-Boot] [PATCH v2] usb: host: xhci-omap: Remove redundant board_usb_init and board_usb_cleanup functions

2018-02-15 Thread Faiz Abbas
board_usb_init()/_cleanup() should be in board files and don't have
a place in the xhci-omap driver. Weak versions for
board_usb_init()/_cleanup() already exist in common/usb.c
(for host mode) and drivers/usb/gadget/g_dnl.c (for gadget mode).

Therefore, remove init and cleanup functions from xhci-omap and
implement them in the board files.

Signed-off-by: Faiz Abbas 
Reviewed-by: Marek Vasut 
Reviewed-by: Bin Meng 
---
v2: Added init and cleanup implementations for boards which
were relying on the weak implementation.

Uri please test the compulab boards.

 board/compulab/cl-som-am57x/cl-som-am57x.c | 13 +
 board/compulab/cm_t43/cm_t43.c | 14 ++
 board/ti/am43xx/board.c|  4 ++--
 board/ti/am57xx/board.c|  4 ++--
 board/ti/dra7xx/evm.c  |  4 ++--
 drivers/usb/host/xhci-omap.c   | 22 --
 6 files changed, 33 insertions(+), 28 deletions(-)

diff --git a/board/compulab/cl-som-am57x/cl-som-am57x.c 
b/board/compulab/cl-som-am57x/cl-som-am57x.c
index 389eebb..d7dc8a4 100644
--- a/board/compulab/cl-som-am57x/cl-som-am57x.c
+++ b/board/compulab/cl-som-am57x/cl-som-am57x.c
@@ -16,6 +16,7 @@
 #include 
 #include "../common/common.h"
 #include "../common/eeprom.h"
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -64,3 +65,15 @@ u32 get_board_rev(void)
 {
return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
 }
+
+int board_usb_init(int index, enum usb_init_type init)
+{
+   enable_usb_clocks(index);
+   return 0;
+}
+
+int board_usb_cleanup(int index, enum usb_init_type init)
+{
+   disable_usb_clocks(index);
+   return 0;
+}
diff --git a/board/compulab/cm_t43/cm_t43.c b/board/compulab/cm_t43/cm_t43.c
index 0d5da6f..bdbea4f 100644
--- a/board/compulab/cm_t43/cm_t43.c
+++ b/board/compulab/cm_t43/cm_t43.c
@@ -14,6 +14,8 @@
 #include 
 #include 
 #include "board.h"
+#include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -50,6 +52,18 @@ int board_init(void)
return 0;
 }
 
+int board_usb_init(int index, enum usb_init_type init)
+{
+   enable_usb_clocks(index);
+   return 0;
+}
+
+int board_usb_cleanup(int index, enum usb_init_type init)
+{
+   disable_usb_clocks(index);
+   return 0;
+}
+
 #ifdef CONFIG_DRIVER_TI_CPSW
 
 static void cpsw_control(int enabled)
diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
index 16150ad..715960a 100644
--- a/board/ti/am43xx/board.c
+++ b/board/ti/am43xx/board.c
@@ -687,7 +687,7 @@ int usb_gadget_handle_interrupts(int index)
 #endif /* CONFIG_USB_DWC3 */
 
 #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)
-int omap_xhci_board_usb_init(int index, enum usb_init_type init)
+int board_usb_init(int index, enum usb_init_type init)
 {
enable_usb_clocks(index);
 #ifdef CONFIG_USB_DWC3
@@ -718,7 +718,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type 
init)
return 0;
 }
 
-int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
+int board_usb_cleanup(int index, enum usb_init_type init)
 {
 #ifdef CONFIG_USB_DWC3
switch (index) {
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index 1128784..c3f60f6 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -867,7 +867,7 @@ int usb_gadget_handle_interrupts(int index)
 #endif /* CONFIG_USB_DWC3 */
 
 #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)
-int omap_xhci_board_usb_init(int index, enum usb_init_type init)
+int board_usb_init(int index, enum usb_init_type init)
 {
enable_usb_clocks(index);
switch (index) {
@@ -901,7 +901,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type 
init)
return 0;
 }
 
-int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
+int board_usb_cleanup(int index, enum usb_init_type init)
 {
 #ifdef CONFIG_USB_DWC3
switch (index) {
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index 6ecf971..519475e 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -907,7 +907,7 @@ static struct ti_usb_phy_device usb_phy2_device = {
.index = 1,
 };
 
-int omap_xhci_board_usb_init(int index, enum usb_init_type init)
+int board_usb_init(int index, enum usb_init_type init)
 {
enable_usb_clocks(index);
switch (index) {
@@ -944,7 +944,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type 
init)
return 0;
 }
 
-int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
+int board_usb_cleanup(int index, enum usb_init_type init)
 {
switch (index) {
case 0:
diff --git a/drivers/usb/host/xhci-omap.c b/drivers/usb/host/xhci-omap.c
index d6c5744..b814500 100644
--- a/drivers/usb/host/xhci-omap.c
+++ b/drivers/usb/host/xhci-omap.c
@@ -27,28 +27,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static struct omap_xhci omap;
 
-__weak int omap_xhci_board_usb_init(int index, enum 

  1   2   >