Re: [U-Boot] [PATCH v6] x86: Add 64-bit memory-mapped I/O functions

2018-04-07 Thread Bin Meng
On Sat, Apr 7, 2018 at 5:43 AM, Ivan Gorinov  wrote:
> Add readq() and writeq() definitions for x86.
>
> Please note: in 32-bit code readq/writeq will generate two 32-bit
> memory access instructions instead of one atomic 64-bit operation.
>
> Signed-off-by: Ivan Gorinov 
> ---
>  arch/x86/include/asm/io.h | 4 
>  1 file changed, 4 insertions(+)
>

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


Re: [U-Boot] [U-Boot, 36/36] rockchip: add common board file for rockchip platform

2018-04-07 Thread Kever Yang
Philipp,


On 04/02/2018 05:28 AM, Philipp Tomsich wrote:
>
>
> On Tue, 27 Mar 2018, Kever Yang wrote:
>
>> We use common board/spl/tpl file for all rockchip SoCs,
>> - all the SoC spec setting should move into SoC file like rk3288.c;
>> - tpl is option and only purpose to init DRAM, clock, uart(option);
>> - spl do secure relate one time init, boot device select, boot into
>>  U-Boot or trust or OS in falcon mode;
>> - board do boot mode detect, enable regulator, usb init and so on.
>
> There's too much going on in a single commit/single series.
> This needs to be split up into multiple, independent steps (e.g. one
> for the timer changes, another one for the UART changes)...

I understand review the patches piece by piece is much more comfortable,
and this patch including "too much" things. And I never expect this
patch set
can be merge quickly, but we have to do this ASAP before more SoC coming.
I have do a lot of test and re-work in my local branch and at last make
it landed in
rockchip vendor U-Boot, with testing in most of SoCs(not including
rk3066/rk3188).
Well, I do try to split it into pieces, but I found that actually not
help very much
except waste much more time:
- The target is(very clear) to make rockchip soc board file in a good
shape with common files,
    instead of copy-paste for each soc(more than 10 of them now)
- then we need to identify what's common and what should go to soc and
board;
- remove using common rockchip timer and use arm generic timer instead
for armv7
    SoCs(rk3066 and rk3188 need still using rockchip timer)
- most soc need to do uart init, boot order select, and some
arch_cpu_init().
- don't break the boards already working, so I still leave some code
which not so common
    in board file, but I would like to remove or move them into right
place if I got a board
    to verify;

@Simon, @Tom,
This patch set is to remove some common files and add some other common
files for
all Rockchip SoCs, I have to make sure the whole patch set can running
good for all SoCs,
but it's really hard to make every patch to build and work perfect for
all SoCs, is there
any mandatory rules for this?

I have to do a lot of temporary work for this like add temporary MACRO
for those SoCs
convert to use common code, and remove it after all the SoCs have
convert to use common
code, which have no any help for what we get at last, but it really cost
a lot of time.

>
>>
>> Signed-off-by: Kever Yang 
>
> See below for requested changes (beyond splitting this up).
> Reviewing this in this state is a real chore, so I'll probably have
> more comments, once I see this presented in more manageable parcels.
>
>> ---
>>
>> arch/arm/mach-rockchip/Makefile |  23 +
>> arch/arm/mach-rockchip/board.c  | 136 
>> arch/arm/mach-rockchip/spl.c    | 195
>> 
>> arch/arm/mach-rockchip/tpl.c    | 111 +++
>> 4 files changed, 445 insertions(+), 20 deletions(-)
>> create mode 100644 arch/arm/mach-rockchip/board.c
>> create mode 100644 arch/arm/mach-rockchip/spl.c
>> create mode 100644 arch/arm/mach-rockchip/tpl.c
>>
>> diff --git a/arch/arm/mach-rockchip/Makefile
>> b/arch/arm/mach-rockchip/Makefile
>> index e1b0519..3aba66c 100644
>> --- a/arch/arm/mach-rockchip/Makefile
>> +++ b/arch/arm/mach-rockchip/Makefile
>> @@ -11,15 +11,8 @@
>> obj-spl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
>> obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
>>
>> -obj-tpl-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-tpl.o
>> -obj-tpl-$(CONFIG_ROCKCHIP_RK3368) += rk3368-board-tpl.o
>> -
>> -obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
>> -obj-spl-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board-spl.o
>> -obj-spl-$(CONFIG_ROCKCHIP_RK322X) += rk322x-board-spl.o
>> -obj-spl-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-spl.o
>> -obj-spl-$(CONFIG_ROCKCHIP_RK3368) += rk3368-board-spl.o
>> spl-boot-order.o
>> -obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o
>> spl-boot-order.o
>> +obj-tpl-y += tpl.o
>> +obj-spl-y += spl.o spl-boot-order.o
>>
>> ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
>>
>> @@ -28,21 +21,11 @@ ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
>> # we can have the preprocessor correctly recognise both 0x0 and 0
>> # meaning "turn it off".
>> obj-y += boot_mode.o
>> -
>> -obj-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board.o
>> -obj-$(CONFIG_ROCKCHIP_RK3128) += rk3128-board.o
>> -obj-$(CONFIG_ROCKCHIP_RK322X) += rk322x-board.o
>> -obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board.o
>> -obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board.o
>> -obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board.o
>> +obj-y += board.o
>> endif
>>
>> obj-$(CONFIG_$(SPL_TPL_)RAM) += sdram_common.o
>>
>> -ifndef CONFIG_ARM64
>> -obj-y += rk_timer.o
>> -endif
>
> This would need to have gone with the rk_timer.c removal.
> Otherwise things don't build between the earlier patch and here.
>
>> -
>> obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036/
>> obj-$(CONFIG_ROCKCHIP_RK3128) += r

[U-Boot] [PATCH 3/3] serial: Migrate CONFIG_ARM_DCC to Kconfig

2018-04-07 Thread Tuomas Tynkkynen
Signed-off-by: Tuomas Tynkkynen 
---
 arch/arm/Kconfig| 2 ++
 drivers/serial/Kconfig  | 5 +
 include/configs/xilinx_zynqmp.h | 1 -
 include/configs/zynq-common.h   | 2 --
 scripts/config_whitelist.txt| 1 -
 5 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 190f883aa8..44a4471b47 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -776,6 +776,7 @@ config ARCH_ZYNQ
select CLK
select SPL_CLK if SPL
select CLK_ZYNQ
+   imply ARM_DCC
imply CMD_CLK
imply FAT_WRITE
imply CMD_SPL
@@ -792,6 +793,7 @@ config ARCH_ZYNQMP
select SPL_BOARD_INIT if SPL
select SPL_CLK if SPL
select DM_USB if USB
+   imply ARM_DCC
imply FAT_WRITE
 
 config TEGRA
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 9387b642b3..41ce6dec8c 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -432,6 +432,11 @@ config AR933X_UART
  tree binding to operate, please refer to the document at
  doc/device-tree-bindings/serial/qca,ar9330-uart.txt.
 
+config ARM_DCC
+   bool "ARM DCC (Debug Communications Channel) serial console support"
+   help
+ Select this to enable a serial port using the ARM JTAG DCC port.
+
 config ATMEL_USART
bool "Atmel USART support"
help
diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index 8c0b5d9c06..312a2a83ff 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -42,7 +42,6 @@
 #define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + 0x200)
 
 /* Serial setup */
-#define CONFIG_ARM_DCC
 #define CONFIG_CPU_ARMV8
 
 #define CONFIG_SYS_BAUDRATE_TABLE \
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index 554fb66634..699c91d3c5 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -32,8 +32,6 @@
 #define CONFIG_SYS_BAUDRATE_TABLE  \
{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
 
-#define CONFIG_ARM_DCC
-
 /* Ethernet driver */
 #if defined(CONFIG_ZYNQ_GEM)
 # define CONFIG_MII
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 30da0122f0..417a978f0a 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -59,7 +59,6 @@ CONFIG_ARMV7_SECURE_MAX_SIZE
 CONFIG_ARMV7_SECURE_RESERVE_SIZE
 CONFIG_ARMV8_SWITCH_TO_EL1
 CONFIG_ARM_ARCH_CP15_ERRATA
-CONFIG_ARM_DCC
 CONFIG_ARM_FREQ
 CONFIG_ARM_GIC_BASE_ADDRESS
 CONFIG_ARM_PL180_MMCI_BASE
-- 
2.16.3

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


[U-Boot] [PATCH 2/3] serial: Migrate CONFIG_MCFUART

2018-04-07 Thread Tuomas Tynkkynen
Signed-off-by: Tuomas Tynkkynen 
---
 arch/Kconfig | 1 +
 drivers/serial/Kconfig   | 5 +
 include/configs/M5208EVBE.h  | 1 -
 include/configs/M52277EVB.h  | 1 -
 include/configs/M5235EVB.h   | 1 -
 include/configs/M5249EVB.h   | 1 -
 include/configs/M5253DEMO.h  | 1 -
 include/configs/M5253EVBE.h  | 1 -
 include/configs/M5272C3.h| 1 -
 include/configs/M5275EVB.h   | 1 -
 include/configs/M5282EVB.h   | 1 -
 include/configs/M53017EVB.h  | 1 -
 include/configs/M5329EVB.h   | 1 -
 include/configs/M5373EVB.h   | 1 -
 include/configs/M54418TWR.h  | 1 -
 include/configs/M54451EVB.h  | 1 -
 include/configs/M54455EVB.h  | 1 -
 include/configs/M5475EVB.h   | 1 -
 include/configs/M5485EVB.h   | 1 -
 include/configs/amcore.h | 1 -
 include/configs/astro_mcf5373l.h | 1 -
 include/configs/cobra5272.h  | 1 -
 include/configs/eb_cpu5282.h | 1 -
 include/configs/stmark2.h| 1 -
 scripts/config_whitelist.txt | 1 -
 25 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index e599e7a39c..c9310406c7 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -28,6 +28,7 @@ config M68K
select HAVE_PRIVATE_LIBGCC
select SYS_BOOT_GET_CMDLINE
select SYS_BOOT_GET_KBD
+   imply MCFUART
 
 config MICROBLAZE
bool "MicroBlaze architecture"
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 0a01399961..9387b642b3 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -467,6 +467,11 @@ config FSL_LPUART
  Select this to enable a Low Power UART for Freescale VF610 and
  QorIQ Layerscape devices.
 
+config MCFUART
+   bool "ColdFire UART support"
+   help
+ Select this to enable UART support on some ColdFire m68k SoCs.
+
 config MVEBU_A3700_UART
bool "UART support for Armada 3700"
default n
diff --git a/include/configs/M5208EVBE.h b/include/configs/M5208EVBE.h
index 3385dcb5b7..d7d21b5708 100644
--- a/include/configs/M5208EVBE.h
+++ b/include/configs/M5208EVBE.h
@@ -14,7 +14,6 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT   (0)
 
 #undef CONFIG_WATCHDOG
diff --git a/include/configs/M52277EVB.h b/include/configs/M52277EVB.h
index 7798b06625..16005f7ef5 100644
--- a/include/configs/M52277EVB.h
+++ b/include/configs/M52277EVB.h
@@ -19,7 +19,6 @@
  * (easy to change)
  */
 
-#define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT   (0)
 
 #undef CONFIG_WATCHDOG
diff --git a/include/configs/M5235EVB.h b/include/configs/M5235EVB.h
index d221f718f0..3600418907 100644
--- a/include/configs/M5235EVB.h
+++ b/include/configs/M5235EVB.h
@@ -19,7 +19,6 @@
  * (easy to change)
  */
 
-#define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT   (0)
 
 #undef CONFIG_WATCHDOG
diff --git a/include/configs/M5249EVB.h b/include/configs/M5249EVB.h
index 6b37e46c56..fa78918197 100644
--- a/include/configs/M5249EVB.h
+++ b/include/configs/M5249EVB.h
@@ -20,7 +20,6 @@
  */
 #define CONFIG_MCFTMR
 
-#define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT   (0)
 
 #undef  CONFIG_WATCHDOG
diff --git a/include/configs/M5253DEMO.h b/include/configs/M5253DEMO.h
index cf10f306c7..7b21e68dd1 100644
--- a/include/configs/M5253DEMO.h
+++ b/include/configs/M5253DEMO.h
@@ -9,7 +9,6 @@
 
 #define CONFIG_MCFTMR
 
-#define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT   (0)
 
 #undef CONFIG_WATCHDOG /* disable watchdog */
diff --git a/include/configs/M5253EVBE.h b/include/configs/M5253EVBE.h
index daa44b315b..4a23379be7 100644
--- a/include/configs/M5253EVBE.h
+++ b/include/configs/M5253EVBE.h
@@ -10,7 +10,6 @@
 
 #define CONFIG_MCFTMR
 
-#define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT   (0)
 
 #undef CONFIG_WATCHDOG /* disable watchdog */
diff --git a/include/configs/M5272C3.h b/include/configs/M5272C3.h
index 936a91e27d..bf02282e97 100644
--- a/include/configs/M5272C3.h
+++ b/include/configs/M5272C3.h
@@ -19,7 +19,6 @@
  */
 #define CONFIG_MCFTMR
 
-#define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT   (0)
 
 #undef CONFIG_WATCHDOG
diff --git a/include/configs/M5275EVB.h b/include/configs/M5275EVB.h
index 1babb72fd0..12836140c4 100644
--- a/include/configs/M5275EVB.h
+++ b/include/configs/M5275EVB.h
@@ -24,7 +24,6 @@
 
 #define CONFIG_MCFTMR
 
-#define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT   (0)
 
 /* Configuration for environment
diff --git a/include/configs/M5282EVB.h b/include/configs/M5282EVB.h
index b29515077a..5a31d3d860 100644
--- a/include/configs/M5282EVB.h
+++ b/include/configs/M5282EVB.h
@@ -19,7 +19,6 @@
  */
 #define CONFIG_MCFTMR
 
-#define CONFIG_MCFUART
 #define CONFIG_SYS_UART_PORT   (0)
 
 #undef CONFIG_MONITOR_IS_IN_RAM/* define if monitor is started from a 
pre-loader */
diff --git a/include/configs/M53017EVB.h b/include/c

[U-Boot] [PATCH 1/3] serial: Migrate CONFIG_ARC_SERIAL to Kconfig

2018-04-07 Thread Tuomas Tynkkynen
Signed-off-by: Tuomas Tynkkynen 
---
 arch/arc/Kconfig |  1 +
 drivers/serial/Kconfig   |  7 +++
 include/configs/nsim.h   | 10 --
 scripts/config_whitelist.txt |  1 -
 4 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index aee15d5353..fb91412150 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -143,6 +143,7 @@ config TARGET_TB100
 
 config TARGET_NSIM
bool "Support standalone nSIM & Free nSIM"
+   imply ARC_SERIAL
 
 config TARGET_AXS101
bool "Support Synopsys Designware SDP board AXS101"
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 3d5b2bf15f..0a01399961 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -416,6 +416,13 @@ config ALTERA_UART
  Select this to enable an UART for Altera devices. Please find
  details on the "Embedded Peripherals IP User Guide" of Altera.
 
+config ARC_SERIAL
+   bool "ARC UART support"
+   depends on DM_SERIAL && ARC
+   help
+ Select this to enable the support for UART on some ARC (Synopsys)
+ FPGA-based boards.
+
 config AR933X_UART
bool "QCA/Atheros ar933x UART support"
depends on DM_SERIAL && SOC_AR933X
diff --git a/include/configs/nsim.h b/include/configs/nsim.h
index 58d3e5f7de..e7fb35fe3b 100644
--- a/include/configs/nsim.h
+++ b/include/configs/nsim.h
@@ -25,16 +25,6 @@
 #define CONFIG_SYS_BOOTM_LEN   SZ_32M
 #define CONFIG_SYS_LOAD_ADDR   0x8200
 
-/*
- * UART configuration
- *
- */
-#define CONFIG_ARC_SERIAL
-
-/*
- * Command line configuration
- */
-
 /*
  * Environment settings
  */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 997ef771c7..831b4add54 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -48,7 +48,6 @@ CONFIG_ARCH_RMOBILE_EXTRAM_BOOT
 CONFIG_ARCH_TEGRA
 CONFIG_ARCH_USE_BUILTIN_BSWAP
 CONFIG_ARC_MMU_VER
-CONFIG_ARC_SERIAL
 CONFIG_ARIES_M28_V10
 CONFIG_ARMADA100
 CONFIG_ARMADA100_FEC
-- 
2.16.3

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


[U-Boot] [PATCH] treewide: fix up files incorrectly marked executable

2018-04-07 Thread Fabio Estevam
From: Fabio Estevam 

Inspired by the following kernel commit:

"commit 90fda63fa1156ec1bcfd7f9ca384cec221f70a21
Author: Linus Torvalds 
Date:   Sat Apr 7 13:31:23 2018 -0700

treewide: fix up files incorrectly marked executable

Joe Perches noted that we have a few source files that for some
inexplicable reason (read: I'm too lazy to even go look at the history)
are marked executable:

drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
drivers/net/ethernet/cadence/macb_ptp.c

A simple git command line to show executable C/asm/header files is this:
   
   git ls-files -s '*.[chsS]' | grep '^100755'

and then you can fix them up with scripting by just feeding that output
into:

  | cut -f2 | xargs chmod -x

and commit it.

Which is exactly what this commit does.

Reported-by: Joe Perches 
Signed-off-by: Linus Torvalds "

Do the same in the U-Boot source tree.

Signed-off-by: Fabio Estevam 
---
 drivers/video/anx9804.c   | 0
 include/configs/blanche.h | 0
 2 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100755 => 100644 drivers/video/anx9804.c
 mode change 100755 => 100644 include/configs/blanche.h

diff --git a/drivers/video/anx9804.c b/drivers/video/anx9804.c
old mode 100755
new mode 100644
diff --git a/include/configs/blanche.h b/include/configs/blanche.h
old mode 100755
new mode 100644
-- 
2.7.4

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


[U-Boot] [PATCH] ARM: rmobile: Enable HUSH on M2 Porter

2018-04-07 Thread Marek Vasut
Enable the HUSH shell, since it is far more capable.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
---
 configs/porter_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/porter_defconfig b/configs/porter_defconfig
index e4a2828ed4..7c58b136d4 100644
--- a/configs/porter_defconfig
+++ b/configs/porter_defconfig
@@ -37,6 +37,7 @@ CONFIG_TPL_SPI_FLASH_SUPPORT=y
 CONFIG_TPL_SPI_LOAD=y
 CONFIG_TPL_SPI_SUPPORT=y
 CONFIG_TPL_YMODEM_SUPPORT=y
+CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_XIMG is not set
-- 
2.16.2

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


[U-Boot] [PATCH] ARM: rmobile: Add JTAG recovery support for M2 Porter

2018-04-07 Thread Marek Vasut
Add JTAG recovery support into the M2 Porter TPL. This allows the
TPL to be loaded over JTAG, initialize the system, wait for the
JTAG debugger to load U-Boot image into RAM and then resume and
start U-Boot from RAM.

The procedure is as follows:
1) Load u-boot-tpl.bin to 0xe630
2) Write magic number 0x1337c0de to 0xe6300020
   TPL checks for this particular magic and starts JTAG recovery
   if this number is present. This is not present by default.
3) Start U-Boot TPL from 0xe630
4) Wait for a message from TPL on UART indicating JTAG boot:
   "JTAG boot detected!"
5) Halt the system in JTAG debugger
6) Load U-Boot image (u-boot.img) to 0x4fc0
7) Write magic number 0xb33fc0de to 0xe6300024
   TPL checks for this particular magic to verify that the U-Boot
   image was loaded into DRAM by the JTAG debugger.
8) Resume the system in JTAG debugger

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/mach-rmobile/include/mach/boot0.h | 24 
 board/renesas/porter/porter_spl.c  | 21 +
 configs/porter_defconfig   |  3 +++
 3 files changed, 48 insertions(+)
 create mode 100644 arch/arm/mach-rmobile/include/mach/boot0.h

diff --git a/arch/arm/mach-rmobile/include/mach/boot0.h 
b/arch/arm/mach-rmobile/include/mach/boot0.h
new file mode 100644
index 00..3edd461cbf
--- /dev/null
+++ b/arch/arm/mach-rmobile/include/mach/boot0.h
@@ -0,0 +1,24 @@
+/*
+ * Specialty padding for the RCar Gen2 TPL JTAG loading
+ *
+ * SPDX-License-Identifier:GPL-2.0
+ */
+
+#ifndef __BOOT0_H
+#define __BOOT0_H
+
+_start:
+   ARM_VECTORS
+
+#ifdef CONFIG_TPL_BUILD
+   .word   0x0badc0d3;
+   .word   0x0badc0d3;
+   .word   0x0badc0d3;
+   .word   0x0badc0d3;
+   .word   0x0badc0d3;
+   .word   0x0badc0d3;
+   .word   0x0badc0d3;
+   .word   0x0badc0d3;
+#endif
+
+#endif /* __BOOT0_H */
diff --git a/board/renesas/porter/porter_spl.c 
b/board/renesas/porter/porter_spl.c
index 533b0b41e9..f711aa9c35 100644
--- a/board/renesas/porter/porter_spl.c
+++ b/board/renesas/porter/porter_spl.c
@@ -463,6 +463,27 @@ void spl_board_init(void)
 
 void board_boot_order(u32 *spl_boot_list)
 {
+#ifdef CONFIG_TPL_BUILD
+   const u32 jtag_magic = 0x1337c0de;
+   const u32 load_magic = 0xb33fc0de;
+
+   /*
+* If JTAG probe sets special word at 0xe6300020, then it must
+* put U-Boot into RAM and TPL will start it from RAM.
+*/
+   if (readl(CONFIG_TPL_TEXT_BASE + 0x20) == jtag_magic) {
+   printf("JTAG boot detected!\n");
+
+   while (readl(CONFIG_TPL_TEXT_BASE + 0x24) != load_magic)
+   ;
+
+   spl_boot_list[0] = BOOT_DEVICE_RAM;
+   spl_boot_list[1] = BOOT_DEVICE_NONE;
+
+   return;
+   }
+#endif
+
/* Boot from SPI NOR with YMODEM UART fallback. */
spl_boot_list[0] = BOOT_DEVICE_SPI;
spl_boot_list[1] = BOOT_DEVICE_UART;
diff --git a/configs/porter_defconfig b/configs/porter_defconfig
index a0e44df5f8..e4a2828ed4 100644
--- a/configs/porter_defconfig
+++ b/configs/porter_defconfig
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK=y
 CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_TEXT_BASE=0x5000
 CONFIG_SPL_GPIO_SUPPORT=y
@@ -29,6 +30,8 @@ CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_TPL=y
 CONFIG_TPL_BOARD_INIT=y
 CONFIG_TPL_NEEDS_SEPARATE_TEXT_BASE=y
+CONFIG_TPL_RAM_SUPPORT=y
+CONFIG_TPL_RAM_DEVICE=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_TPL_SPI_FLASH_SUPPORT=y
 CONFIG_TPL_SPI_LOAD=y
-- 
2.16.2

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


[U-Boot] [PATCH] spl: ram: Add TPL Kconfig symbols

2018-04-07 Thread Marek Vasut
Add TPL config symbols for RAM loading matching the SPL ones.

Signed-off-by: Marek Vasut 
Cc: Tom Rini 
---
 common/spl/Kconfig | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 02457cb74b..4d27565566 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -910,6 +910,20 @@ config TPL_NAND_SUPPORT
help
  Enable support for NAND in TPL. See SPL_NAND_SUPPORT for details.
 
+config TPL_RAM_SUPPORT
+   bool "Support booting from RAM"
+   help
+ Enable booting of an image in RAM. The image can be preloaded or
+ it can be loaded by TPL directly into RAM (e.g. using USB).
+
+config TPL_RAM_DEVICE
+   bool "Support booting from preloaded image in RAM"
+   depends on TPL_RAM_SUPPORT
+   help
+ Enable booting of an image already loaded in RAM. The image has to
+ be already in memory when TPL takes over, e.g. loaded by the boot
+ ROM.
+
 config TPL_SERIAL_SUPPORT
bool "Support serial"
help
-- 
2.16.2

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


[U-Boot] [PATCH] spl: ram: Convert to CONFIG_IS_ENABLED

2018-04-07 Thread Marek Vasut
This patch is a preparation for adding TPL support for RAM loading.
CONFIG_IS_ENABLED allows for proper handling of the U-Boot/SPL/TPL
differences in config symbol names.

Signed-off-by: Marek Vasut 
Cc: Tom Rini 
---
 common/spl/spl_ram.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/spl/spl_ram.c b/common/spl/spl_ram.c
index d9db9f3a40..a15761e309 100644
--- a/common/spl/spl_ram.c
+++ b/common/spl/spl_ram.c
@@ -36,7 +36,7 @@ static int spl_ram_load_image(struct spl_image_info 
*spl_image,
 
header = (struct image_header *)CONFIG_SPL_LOAD_FIT_ADDRESS;
 
-#if defined(CONFIG_SPL_DFU_SUPPORT)
+#if CONFIG_IS_ENABLED(DFU_SUPPORT)
if (bootdev->boot_device == BOOT_DEVICE_DFU)
spl_dfu_cmd(0, "dfu_alt_info_ram", "ram", "0");
 #endif
@@ -74,10 +74,10 @@ static int spl_ram_load_image(struct spl_image_info 
*spl_image,
 
return 0;
 }
-#if defined(CONFIG_SPL_RAM_DEVICE)
+#if CONFIG_IS_ENABLED(RAM_DEVICE)
 SPL_LOAD_IMAGE_METHOD("RAM", 0, BOOT_DEVICE_RAM, spl_ram_load_image);
 #endif
-#if defined(CONFIG_SPL_DFU_SUPPORT)
+#if CONFIG_IS_ENABLED(DFU_SUPPORT)
 SPL_LOAD_IMAGE_METHOD("DFU", 0, BOOT_DEVICE_DFU, spl_ram_load_image);
 #endif
 
-- 
2.16.2

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


[U-Boot] [PATCH] ARM: rmobile: Add TPL support on R8A7791 M2 Porter

2018-04-07 Thread Marek Vasut
Add and enable TPL on M2 Porter. The TPL must fit into 16 kiB due
to the Gen2 BootROM restriction. The TPL is running from MERAM and
is capable of performing the initial initialization of PFC, Clock,
GPIO, LBSC, DBSC and QSPI NOR. DBSC is responsible for bringing up
the DDR DRAM access. The TPL is capable of loading the next stage,
U-Boot, from either SPI NOR or UART as a fallback. If either does
provide a valid U-Boot uImage, the system stops, which allows the
operator to load U-Boot ie. via JTAG and start it manually.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/mach-rmobile/Kconfig.32  |   1 +
 board/renesas/porter/porter_spl.c | 419 ++
 configs/porter_defconfig  |  17 ++
 include/configs/porter.h  |   6 +
 4 files changed, 443 insertions(+)

diff --git a/arch/arm/mach-rmobile/Kconfig.32 b/arch/arm/mach-rmobile/Kconfig.32
index a96938c01e..97260dfefb 100644
--- a/arch/arm/mach-rmobile/Kconfig.32
+++ b/arch/arm/mach-rmobile/Kconfig.32
@@ -70,6 +70,7 @@ config TARGET_PORTER
bool "Porter board"
select DM
select DM_SERIAL
+   select SUPPORT_TPL
select SUPPORT_SPL
select SPL_DM if SPL
 
diff --git a/board/renesas/porter/porter_spl.c 
b/board/renesas/porter/porter_spl.c
index eb34469a71..533b0b41e9 100644
--- a/board/renesas/porter/porter_spl.c
+++ b/board/renesas/porter/porter_spl.c
@@ -21,20 +21,439 @@
 #include 
 
 #define TMU0_MSTP125   BIT(25)
+#define SCIF0_MSTP721  BIT(21)
+#define QSPI_MSTP917   BIT(17)
 
 #define SD2CKCR0xE615026C
 #define SD_97500KHZ0x7
 
+#ifdef CONFIG_TPL_BUILD
+struct reg_config {
+   u16 off;
+   u32 val;
+};
+
+static void dbsc_wait(u16 reg)
+{
+   static const u32 dbsc3_0_base = DBSC3_0_BASE;
+   static const u32 dbsc3_1_base = DBSC3_0_BASE + 0x1;
+
+   while (!(readl(dbsc3_0_base + reg) & BIT(0)))
+   ;
+
+   while (!(readl(dbsc3_1_base + reg) & BIT(0)))
+   ;
+}
+
+static void tpl_init_sys(void)
+{
+   u32 r0 = 0;
+
+   writel(0xa5a5a500, 0xe6020004);
+   writel(0xa5a5a500, 0xe6030004);
+
+   asm volatile(
+   /* ICIALLU - Invalidate I$ to PoU */
+   "mcr15, 0, %0, cr7, cr5, 0  \n"
+   /* BPIALL - Invalidate branch predictors */
+   "mcr15, 0, %0, cr7, cr5, 6  \n"
+   /* Set SCTLR[IZ] */
+   "mrc15, 0, %0, cr1, cr0, 0  \n"
+   "orr%0, #0x1800 \n"
+   "mcr15, 0, %0, cr1, cr0, 0  \n"
+   "isbsy  \n"
+   :"=r"(r0));
+}
+
+static void tpl_init_pfc(void)
+{
+   static const struct reg_config pfc_with_unlock[] = {
+   { 0x0090, 0x6000 },
+   { 0x0094, 0x6000 },
+   { 0x0098, 0x00800200 },
+   { 0x009c, 0x },
+   { 0x0020, 0x },
+   { 0x0024, 0x },
+   { 0x0028, 0x000244c8 },
+   { 0x002c, 0x },
+   { 0x0030, 0x2400 },
+   { 0x0034, 0x0152 },
+   { 0x0038, 0x00724003 },
+   { 0x003c, 0x },
+   { 0x0040, 0x },
+   { 0x0044, 0x },
+   { 0x0048, 0x },
+   { 0x004c, 0x },
+   { 0x0050, 0x },
+   { 0x0054, 0x },
+   { 0x0058, 0x },
+   { 0x005c, 0x },
+   { 0x0160, 0x },
+   { 0x0004, 0x },
+   { 0x0008, 0x00ec3fff },
+   { 0x000c, 0x3bc001e7 },
+   { 0x0010, 0x5bff },
+   { 0x0014, 0x1ffb },
+   { 0x0018, 0x01b0 },
+   { 0x001c, 0xcf7f },
+   { 0x0074, 0x0381fc00 },
+   };
+
+   static const struct reg_config pfc_without_unlock[] = {
+   { 0x0100, 0xffdf },
+   { 0x0104, 0xc883c3ff },
+   { 0x0108, 0x1201f3c9 },
+   { 0x010c, 0x },
+   { 0x0110, 0xeb04 },
+   { 0x0114, 0xc003 },
+   { 0x0118, 0x080f },
+   { 0x011c, 0x00187ff0 },
+   };
+
+   static const u32 pfc_base = 0xe606;
+
+   unsigned int i;
+
+   for (i = 0; i < ARRAY_SIZE(pfc_with_unlock); i++) {
+   writel(~pfc_with_unlock[i].val, pfc_base);
+   writel(pfc_with_unlock[i].val,
+  pfc_base | pfc_with_unlock[i].off);
+   }
+
+   for (i = 0; i < ARRAY_SIZE(pfc_without_unlock); i++)
+   writel(pfc_without_unlock[i].val,
+  pfc_base | pfc_without_unlock[i].off);
+}
+
+static void tpl_init_gpio(void)
+{
+   static const u16 gpio_offs[] = {
+   0x1000, 0x2000, 0x3000, 0x4000, 0x5000, 0x5400, 0x5800
+   };
+
+ 

[U-Boot] [PATCH] ARM: Fix Makefile during SPL and TPL build

2018-04-07 Thread Marek Vasut
The tiny variants of memset and memcpy implementations can be
built for TPL as well, check whether a TPL build is in progress
and avoid including the default variants.

Signed-off-by: Marek Vasut 
Cc: Simon Glass 
Cc: Tom Rini 
---
 arch/arm/lib/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index b5d4e3..3d3085e917 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -41,8 +41,8 @@ obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
 obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o
 obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
 endif
-obj-$(CONFIG_$(SPL_)USE_ARCH_MEMSET) += memset.o
-obj-$(CONFIG_$(SPL_)USE_ARCH_MEMCPY) += memcpy.o
+obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMSET) += memset.o
+obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMCPY) += memcpy.o
 obj-$(CONFIG_SEMIHOSTING) += semihosting.o
 
 obj-y  += sections.o
-- 
2.16.2

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


[U-Boot] [PATCH] serial: Fix Makefile during SPL and TPL build

2018-04-07 Thread Marek Vasut
This patch fixes a situation where CONFIG_DM_SERIAL is enabled for
regular U-Boot and SPL, but not for TPL. In that case, the build
will try to include serial-uclass into the TPL nonetheless, because
CONFIG_DM_SERIAL is set.

The solution is to check if the build is for SPL or TPL and in that
case, check if CONFIG_$(SPL_TPL_)DM_SERIAL is also set. Only in that
case, include serial-uclass.c . If the build is for regular U-Boot,
CONFIG_BUILD is not set, so only check if CONFIG_DM_SERIAL is set
and if so, include serial-uclass.c

Signed-off-by: Marek Vasut 
Cc: Simon Glass 
Cc: Tom Rini 
---
 drivers/serial/Makefile | 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index cac9a8b312..6937ef9628 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -5,11 +5,27 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+ifdef CONFIG_SPL_BUILD
+
+ifeq ($(CONFIG_$(SPL_TPL_)BUILD)$(CONFIG_$(SPL_TPL_)DM_SERIAL),yy)
+obj-y += serial-uclass.o
+else
+obj-y += serial.o
+endif
+
+else
+
 ifdef CONFIG_DM_SERIAL
-obj-$(CONFIG_$(SPL_TPL_)DM_SERIAL) += serial-uclass.o
-obj-$(CONFIG_PL01X_SERIAL) += serial_pl01x.o
+obj-y += serial-uclass.o
 else
 obj-y += serial.o
+endif
+
+endif
+
+ifdef CONFIG_DM_SERIAL
+obj-$(CONFIG_PL01X_SERIAL) += serial_pl01x.o
+else
 obj-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
 obj-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
 obj-$(CONFIG_SYS_NS16550_SERIAL) += serial_ns16550.o
-- 
2.16.2

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


[U-Boot] [PATCH] ARM: rmobile: Do not init caches in TPL before DRAM

2018-04-07 Thread Marek Vasut
Skip the cache initialization, which can be done later on in U-Boot
proper, since this interferes with early DRAM initialization in TPL.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
---
 arch/arm/mach-rmobile/lowlevel_init_ca15.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-rmobile/lowlevel_init_ca15.S 
b/arch/arm/mach-rmobile/lowlevel_init_ca15.S
index a5dbbea9e1..ef2280bea4 100644
--- a/arch/arm/mach-rmobile/lowlevel_init_ca15.S
+++ b/arch/arm/mach-rmobile/lowlevel_init_ca15.S
@@ -11,6 +11,7 @@
 #include 
 
 ENTRY(lowlevel_init)
+#ifndef CONFIG_TPL_BUILD
mrc p15, 0, r4, c0, c0, 5 /* mpidr */
orr r4, r4, r4, lsr #6
and r4, r4, #7 /* id 0-3 = ca15.0,1,2,3 */
@@ -83,6 +84,7 @@ _exit_init_l2_a15:
bl s_init
 
ldr lr, [sp]
+#endif
mov pc, lr
nop
 ENDPROC(lowlevel_init)
-- 
2.16.2

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


[U-Boot] [PATCH] ARM: rmobile: Split U-Boot and SPL sources on Porter

2018-04-07 Thread Marek Vasut
Pull the SPL code from porter.c into a separate file in
preparation for the addition of system initialization code.
No functional change.

Signed-off-by: Marek Vasut 
Cc: Nobuhiro Iwamatsu 
---
 board/renesas/porter/Makefile |  4 +++
 board/renesas/porter/porter.c | 22 
 board/renesas/porter/porter_spl.c | 55 +++
 3 files changed, 59 insertions(+), 22 deletions(-)
 create mode 100644 board/renesas/porter/porter_spl.c

diff --git a/board/renesas/porter/Makefile b/board/renesas/porter/Makefile
index b0cfb1b06a..c237ee5ec7 100644
--- a/board/renesas/porter/Makefile
+++ b/board/renesas/porter/Makefile
@@ -7,4 +7,8 @@
 # SPDX-License-Identifier: GPL-2.0
 #
 
+ifdef CONFIG_SPL_BUILD
+obj-y  := porter_spl.o
+else
 obj-y  := porter.o qos.o
+endif
diff --git a/board/renesas/porter/porter.c b/board/renesas/porter/porter.c
index 320841f27b..acd4f91d59 100644
--- a/board/renesas/porter/porter.c
+++ b/board/renesas/porter/porter.c
@@ -136,25 +136,3 @@ void reset_cpu(ulong addr)
if (ret)
hang();
 }
-
-#ifdef CONFIG_SPL_BUILD
-#include 
-void board_init_f(ulong dummy)
-{
-   board_early_init_f();
-}
-
-void spl_board_init(void)
-{
-   /* UART clocks enabled and gd valid - init serial console */
-   preloader_console_init();
-}
-
-void board_boot_order(u32 *spl_boot_list)
-{
-   /* Boot from SPI NOR with YMODEM UART fallback. */
-   spl_boot_list[0] = BOOT_DEVICE_SPI;
-   spl_boot_list[1] = BOOT_DEVICE_UART;
-   spl_boot_list[2] = BOOT_DEVICE_NONE;
-}
-#endif
diff --git a/board/renesas/porter/porter_spl.c 
b/board/renesas/porter/porter_spl.c
new file mode 100644
index 00..eb34469a71
--- /dev/null
+++ b/board/renesas/porter/porter_spl.c
@@ -0,0 +1,55 @@
+/*
+ * board/renesas/porter/porter_spl.c
+ *
+ * Copyright (C) 2018 Marek Vasut 
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define TMU0_MSTP125   BIT(25)
+
+#define SD2CKCR0xE615026C
+#define SD_97500KHZ0x7
+
+void board_init_f(ulong dummy)
+{
+   mstp_clrbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
+
+   /*
+* SD0 clock is set to 97.5MHz by default.
+* Set SD2 to the 97.5MHz as well.
+*/
+   writel(SD_97500KHZ, SD2CKCR);
+}
+
+void spl_board_init(void)
+{
+   /* UART clocks enabled and gd valid - init serial console */
+   preloader_console_init();
+}
+
+void board_boot_order(u32 *spl_boot_list)
+{
+   /* Boot from SPI NOR with YMODEM UART fallback. */
+   spl_boot_list[0] = BOOT_DEVICE_SPI;
+   spl_boot_list[1] = BOOT_DEVICE_UART;
+   spl_boot_list[2] = BOOT_DEVICE_NONE;
+}
+
+void reset_cpu(ulong addr)
+{
+}
-- 
2.16.2

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


[U-Boot] [PATCH] tpl: ymodem: Add CONFIG_TPL_YMODEM_SUPPORT to Kconfig

2018-04-07 Thread Marek Vasut
Add Kconfig entry for CONFIG_TPL_YMODEM_SUPPORT symbol to match the SPL one.

Signed-off-by: Marek Vasut 
Cc: Tom Rini 
---
 common/spl/Kconfig | 8 
 1 file changed, 8 insertions(+)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index d0e7d389bb..02457cb74b 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -935,6 +935,14 @@ config TPL_SPI_SUPPORT
  Enable support for using SPI in TPL. See SPL_SPI_SUPPORT for
  details.
 
+config TPL_YMODEM_SUPPORT
+   bool "Support loading using Ymodem"
+   help
+ While loading from serial is slow it can be a useful backup when
+ there is no other option. The Ymodem protocol provides a reliable
+ means of transmitting U-Boot over a serial line for using in TPL,
+ with a checksum to ensure correctness.
+
 endif # TPL
 
 endif # SPL
-- 
2.16.2

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


[U-Boot] [PATCH] tpl: spi: Add CONFIG_TPL_SPI_LOAD to Kconfig

2018-04-07 Thread Marek Vasut
Add Kconfig entry for CONFIG_TPL_SPI_LOAD symbol to match the SPL one.

Signed-off-by: Marek Vasut 
Cc: Tom Rini 
---
 common/spl/Kconfig | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 9697173b83..d0e7d389bb 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -922,6 +922,13 @@ config TPL_SPI_FLASH_SUPPORT
  Enable support for using SPI flash in TPL. See SPL_SPI_FLASH_SUPPORT
  for details.
 
+config TPL_SPI_LOAD
+   bool "Support loading from SPI flash"
+   depends on TPL_SPI_FLASH_SUPPORT
+   help
+ Enable support for loading next stage, U-Boot or otherwise, from
+ SPI NOR in U-Boot TPL.
+
 config TPL_SPI_SUPPORT
bool "Support SPI drivers"
help
-- 
2.16.2

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


[U-Boot] [PATCH] spl: spi: Move CONFIG_SPL_SPI_LOAD to Kconfig

2018-04-07 Thread Marek Vasut
Add Kconfig entry for CONFIG_SPL_SPI_LOAD symbol and move all
configurations using it to Kconfig.

Signed-off-by: Marek Vasut 
Cc: Tom Rini 
---
 common/spl/Kconfig  | 7 +++
 configs/am335x_evm_spiboot_defconfig| 3 ++-
 configs/am57xx_evm_defconfig| 3 ++-
 configs/am57xx_hs_evm_defconfig | 3 ++-
 configs/brppt1_spi_defconfig| 3 ++-
 configs/cgtqmx6eval_defconfig   | 3 ++-
 configs/chromebit_mickey_defconfig  | 1 +
 configs/chromebook_jerry_defconfig  | 1 +
 configs/chromebook_minnie_defconfig | 1 +
 configs/cm_fx6_defconfig| 3 ++-
 configs/cm_t43_defconfig| 3 ++-
 configs/controlcenterdc_defconfig   | 3 ++-
 configs/da850_am18xxevm_defconfig   | 3 ++-
 configs/da850evm_defconfig  | 3 ++-
 configs/db-88f6720_defconfig| 3 ++-
 configs/db-88f6820-amc_defconfig| 3 ++-
 configs/db-88f6820-gp_defconfig | 3 ++-
 configs/db-mv784mp-gp_defconfig | 3 ++-
 configs/dh_imx6_defconfig   | 3 ++-
 configs/display5_defconfig  | 3 ++-
 configs/display5_factory_defconfig  | 3 ++-
 configs/dra7xx_evm_defconfig| 3 ++-
 configs/dra7xx_hs_evm_defconfig | 3 ++-
 configs/draco_defconfig | 3 ++-
 configs/ds414_defconfig | 3 ++-
 configs/etamin_defconfig| 3 ++-
 configs/k2e_evm_defconfig   | 3 ++-
 configs/k2g_evm_defconfig   | 3 ++-
 configs/k2hk_evm_defconfig  | 3 ++-
 configs/k2l_evm_defconfig   | 3 ++-
 configs/ma5d4evk_defconfig  | 3 ++-
 configs/maxbcm_defconfig| 3 ++-
 configs/ot1200_spl_defconfig| 3 ++-
 configs/pcm058_defconfig| 3 ++-
 configs/pfla02_defconfig| 3 ++-
 configs/porter_defconfig| 3 ++-
 configs/puma-rk3399_defconfig   | 1 +
 configs/pxm2_defconfig  | 3 ++-
 configs/rastaban_defconfig  | 3 ++-
 configs/rut_defconfig   | 3 ++-
 configs/sama5d2_xplained_spiflash_defconfig | 3 ++-
 configs/sama5d3xek_spiflash_defconfig   | 3 ++-
 configs/sama5d4_xplained_spiflash_defconfig | 3 ++-
 configs/sama5d4ek_spiflash_defconfig| 3 ++-
 configs/socfpga_arria10_defconfig   | 3 ++-
 configs/socfpga_arria5_defconfig| 3 ++-
 configs/socfpga_cyclone5_defconfig  | 3 ++-
 configs/socfpga_dbm_soc1_defconfig  | 3 ++-
 configs/socfpga_de0_nano_soc_defconfig  | 3 ++-
 configs/socfpga_de10_nano_defconfig | 3 ++-
 configs/socfpga_is1_defconfig   | 3 ++-
 configs/socfpga_mcvevk_defconfig| 3 ++-
 configs/socfpga_sockit_defconfig| 3 ++-
 configs/socfpga_socrates_defconfig  | 3 ++-
 configs/socfpga_sr1500_defconfig| 3 ++-
 configs/socfpga_vining_fpga_defconfig   | 3 ++-
 configs/theadorable_debug_defconfig | 3 ++-
 configs/thuban_defconfig| 3 ++-
 configs/topic_miami_defconfig   | 1 +
 configs/topic_miamilite_defconfig   | 1 +
 configs/topic_miamiplus_defconfig   | 1 +
 configs/turris_omnia_defconfig  | 3 ++-
 configs/zc5202_defconfig| 3 ++-
 configs/zc5601_defconfig| 3 ++-
 configs/zynq_cc108_defconfig| 1 +
 configs/zynq_cse_qspi_defconfig | 1 +
 configs/zynq_microzed_defconfig | 1 +
 configs/zynq_z_turn_defconfig   | 1 +
 configs/zynq_zc702_defconfig| 1 +
 configs/zynq_zc706_defconfig| 1 +
 configs/zynq_zc770_xm010_defconfig  | 1 +
 configs/zynq_zc770_xm013_defconfig  | 1 +
 configs/zynq_zed_defconfig  | 1 +
 configs/zynq_zybo_defconfig | 1 +
 include/configs/am335x_evm.h| 1 -
 include/configs/am57xx_evm.h| 1 -
 include/configs/at91sam9n12ek.h | 1 -
 include/configs/at91sam9x5ek.h  | 1 -
 include/configs/bav335x.h   | 1 -
 include/configs/brppt1.h| 1 -
 include/configs/cgtqmx6eval.h   | 1 -
 include/configs/cl-som-am57x.h  | 1 -
 include/configs/cl-som-imx7.h   | 1 -
 include/configs/clearfog.h  | 1 -
 include/configs/cm_fx6.h| 1 -
 include/configs/cm_t43.h| 1 -
 include/configs/controlcenterdc.h   | 1 -
 include/configs/da850evm.h  | 5 -
 include/configs/db-88f6720.h| 1 -
 include/configs/db-88f6820-amc.h| 1 -
 include/configs/db-88f6820-gp.h | 1 -
 include/configs/db-mv784mp-gp.h | 1 -
 include/configs/dh_imx6.h  

Re: [U-Boot] [PATCH v6] x86: Add 64-bit memory-mapped I/O functions

2018-04-07 Thread Andy Shevchenko
On Fri, 2018-04-06 at 14:43 -0700, Ivan Gorinov wrote:
> Add readq() and writeq() definitions for x86.
> 
> Please note: in 32-bit code readq/writeq will generate two 32-bit
> memory access instructions instead of one atomic 64-bit operation.
> 

Thanks!

FWIW,
Reviewed-by: Andy Shevchenko 

> Signed-off-by: Ivan Gorinov 
> ---
>  arch/x86/include/asm/io.h | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
> index 263dd8f..4ab0080 100644
> --- a/arch/x86/include/asm/io.h
> +++ b/arch/x86/include/asm/io.h
> @@ -61,16 +61,20 @@
>  #define readb(addr) (*(volatile unsigned char *) (addr))
>  #define readw(addr) (*(volatile unsigned short *) (addr))
>  #define readl(addr) (*(volatile unsigned int *) (addr))
> +#define readq(addr) (*(volatile unsigned long long *) (addr))
>  #define __raw_readb readb
>  #define __raw_readw readw
>  #define __raw_readl readl
> +#define __raw_readq readq
>  
>  #define writeb(b,addr) (*(volatile unsigned char *) (addr) = (b))
>  #define writew(b,addr) (*(volatile unsigned short *) (addr) = (b))
>  #define writel(b,addr) (*(volatile unsigned int *) (addr) = (b))
> +#define writeq(b,addr) (*(volatile unsigned long long *) (addr) =
> (b))
>  #define __raw_writeb writeb
>  #define __raw_writew writew
>  #define __raw_writel writel
> +#define __raw_writeq writeq
>  
>  #define memset_io(a,b,c) memset((a),(b),(c))
>  #define memcpy_fromio(a,b,c) memcpy((a),(b),(c))

-- 
Andy Shevchenko 
Intel Finland Oy
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/2] image: fit: Show information about OS type in firwmare case too

2018-04-07 Thread Tom Rini
On Mon, Mar 26, 2018 at 04:31:27PM +0200, Michal Simek wrote:

> SPL ATF implementation requires FIT image with partitions where the one
> is Firmware/ATF and another one Firmware/U-Boot. OS field is used for
> recording that difference that's why make sense to show values there for
> Firmware types.
> 
> For example:
>  Image 0 (atf)
>   Description:  ATF bl31.bin
>   Created:  Mon Mar 26 15:58:14 2018
>   Type: Firmware
>   Compression:  uncompressed
>   Data Size:51152 Bytes = 49.95 KiB = 0.05 MiB
>   Architecture: ARM
>   OS:   ARM Trusted Firmware
>   Load Address: 0xfffe
>   Hash algo:md5
>   Hash value:   36a4212bbb698126bf5a248f0f4b5336
>  Image 1 (uboot)
>   Description:  u-boot.bin
>   Created:  Mon Mar 26 15:58:14 2018
>   Type: Firmware
>   Compression:  uncompressed
>   Data Size:761216 Bytes = 743.38 KiB = 0.73 MiB
>   Architecture: ARM
>   OS:   U-Boot
>   Load Address: 0x0800
>   Hash algo:md5
>   Hash value:   f22960fe429be72296dc8dc59a47d566
> 
> Signed-off-by: Michal Simek 
> Reviewed-by: Simon Glass 
> Reviewed-by: Jun Nie 

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] cmd: ximg: Respect cache line size for flushing

2018-04-07 Thread Tom Rini
On Wed, Mar 28, 2018 at 02:39:10PM +0200, Mario Six wrote:

> Make sure that the cache line size if respected when flushing the cache.
> 
> Signed-off-by: Mario Six 

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] cmd: Add command for calculating binary operations

2018-04-07 Thread Tom Rini
On Wed, Mar 28, 2018 at 02:39:18PM +0200, Mario Six wrote:

> This patch adds a command that enables the calculation of bit operations
> (AND, OR, XOR) on binary data from the command line. Memory locations as
> well as the contents of environment variables are eligible as sources
> and destination of the binary data used in the operations.
> 
> The possible applications are manifold: Setting specific bits in
> registers using the regular read-OR-write pattern, masking out bits in
> bit values, implementation of simple OTP encryption using the XOR
> operation, etc.
> 
> Signed-off-by: Mario Six 

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/3] configs: k2g_hs_evm: Resync defconfig with non-HS defconfig

2018-04-07 Thread Tom Rini
On Thu, Mar 22, 2018 at 03:44:38PM -0500, Andrew F. Davis wrote:

> Signed-off-by: Andrew F. Davis 

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/4] stm32mp: add syscon for STGEN

2018-04-07 Thread Tom Rini
On Tue, Mar 20, 2018 at 11:45:14AM +0100, Patrick Delaunay wrote:

> Add STGEN as SYSCON device: allow access to device address
> defined in device tree
> 
> Signed-off-by: Patrick Delaunay 

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, 3/3] configs: k2hk_hs_evm: Resync defconfig with non-HS defconfig

2018-04-07 Thread Tom Rini
On Thu, Mar 22, 2018 at 03:44:40PM -0500, Andrew F. Davis wrote:

> Signed-off-by: Andrew F. Davis 
> 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, v1, 1/5] rtc: ds1307: remove redundant code in rtc_reset

2018-04-07 Thread Tom Rini
On Wed, Mar 21, 2018 at 03:40:33PM +1300, Chris Packham wrote:

> As of commit 1a1fa2406689 ("rtc: Set valid date after reset") the
> command "date reset" will set the date/time to 2000-01-01 0:00:00 after
> calling rtc_reset(). This means that the ds1307 implementation of
> rtc_reset() doesn't need to call rtc_set().
> 
> Signed-off-by: Chris Packham 
> Reviewed-by: Simon Glass 

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/4] arm: timer: get frequency for arch timer armv7 in cp15 cntfrq

2018-04-07 Thread Tom Rini
On Tue, Mar 20, 2018 at 11:41:23AM +0100, Patrick Delaunay wrote:

> Manage dynamic value for armv7 arch clock timer,
> when CONFIG_SYS_HZ_CLOCK is not defined.
> Get frequency from CP15 cntfrq information, initialized for example
> by first boot stage, clock driver or by BootRom.
> 
> Signed-off-by: Patrick Delaunay 

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/3] ARM: dts: Add new "generic" am4372 device tree file.

2018-04-07 Thread Tom Rini
On Mon, Mar 26, 2018 at 01:27:02PM +0530, Vignesh R wrote:

> With U-boot runtime board detect for DTB selection a "default" dtb needs
> to be created. This will be used temporarily until the "proper" dtb is
> selected.
> 
> Also, add -u-boot.dtsi for AM437x SK and IDK to enable I2C for
> board detection via DM_I2C.
> 
> Signed-off-by: Vignesh R 
> 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/3] configs: k2e_hs_evm: Resync defconfig with non-HS defconfig

2018-04-07 Thread Tom Rini
On Thu, Mar 22, 2018 at 03:44:39PM -0500, Andrew F. Davis wrote:

> Signed-off-by: Andrew F. Davis 

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/4] spl: spl_mmc: provide one weak function spl_boot_partition

2018-04-07 Thread Tom Rini
On Tue, Mar 20, 2018 at 10:54:51AM +0100, Patrick Delaunay wrote:

> The spl_boot_partition function has been added in order to have
> the possibility to boot on a same binary from different mmc devices
> with different partitions.
> 
> By default keep the current behavior, SPL use the partition defined
> by CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION.
> 
> Signed-off-by: Patrick Delaunay 
> Signed-off-by: Christophe KERELLO 
> Reviewed-by: Tom Rini 
> Reviewed-by: Lukasz Majewski 

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] gpio: uclass: Fix debug string

2018-04-07 Thread Tom Rini
On Wed, Mar 28, 2018 at 02:39:01PM +0200, Mario Six wrote:

> A debug string still has the old name of a function being called; update
> it.
> 
> Signed-off-by: Mario Six 
> Reviewed-by: Simon Glass 

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,3/4] stm32mp1: get boot mode from BootRom

2018-04-07 Thread Tom Rini
On Tue, Mar 20, 2018 at 10:54:53AM +0100, Patrick Delaunay wrote:

> SPL copy BootRom boot mode information
> in TAMP register 21.
> 
> This TAMP register information is used
> after relocation to set 2 env variables
> - boot_device
> - boot_instance
> 
> Signed-off-by: Patrick Delaunay 

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] bootvx: use program header for loading

2018-04-07 Thread Tom Rini
On Tue, Mar 20, 2018 at 02:18:25PM +0100, Christian Gmeiner wrote:

> The section header address is a VMA whereas the address found in
> the program header is a physical one. With this change it is
> possible to load and start a vx7 intel generic based image.
> 
> $ readelf -l /tmp/vx7
> 
> Elf file type is EXEC (Executable file)
> Entry point 0x408000
> There are 2 program headers, starting at offset 52
> 
> Program Headers:
>   Type   Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
>   LOAD   0x001000 0x00408000 0x00408000 0x04000 0x04000 RWE 0x1000
>   LOAD   0x005000 0xe040c000 0x0040c000 0x583a84 0x5ccc70 RWE 0x1000
> 
>  Section to Segment mapping:
>   Segment Sections...
>00 .text.locore .data.locore
>01 .text .eh_frame .wrs_build_vars .data .tls_data .tls_vars .bss
> 
> $ readelf -S /tmp/vx7
> There are 13 section headers, starting at offset 0x588af8:
> 
> Section Headers:
>   [Nr] Name  TypeAddr OffSize   ES Flg Lk Inf 
> Al
>   [ 0]   NULL 00 00 00  0   0 
>  0
>   [ 1] .text.locore  PROGBITS00408000 001000 00011e 00  AX  0   0 
> 16
>   [ 2] .data.locore  PROGBITS00409000 002000 003000 00  WA  0   0 
> 4096
>   [ 3] .text PROGBITSe040c000 005000 4802a0 00 WAX  0   0 
> 32
>   [ 4] .eh_frame PROGBITSe088c2a0 4852a0 0a1ed0 00   A  0   0 
>  4
>   [ 5] .wrs_build_vars   PROGBITSe092e170 527170 000190 00  Ax  0   0 
>  1
>   [ 6] .data PROGBITSe092f000 528000 060a70 00  WA  0   0 
> 4096
>   [ 7] .tls_data PROGBITSe098fa70 588a70 04 00   A  0   0 
>  4
>   [ 8] .tls_vars PROGBITSe098fa78 588a78 0c 00  WA  0   0 
>  4
>   [ 9] .bss  NOBITS  e098faa0 588a84 0491d0 00  WA  0   0 
> 32
>   [10] .shstrtab STRTAB   588a84 74 00  0   0 
>  1
>   [11] .symtab   SYMTAB   588d00 056ee0 10 12 
> 9758  4
>   [12] .strtab   STRTAB   5dfbe0 05f48a 00  0   0 
>  1
> Key to Flags:
>   W (write), A (alloc), X (execute), M (merge), S (strings)
>   I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
>   O (extra OS processing required) o (OS specific), p (processor specific)
> 
> For completeness here are the same information for an old vx5 based image. 
> After
> this change it is possible to boot vx5 and vx7 (intel generic) images.
> 
> $ readelf -l /tmp/vx5
> 
> Elf file type is EXEC (Executable file)
> Entry point 0x308000
> There are 1 program headers, starting at offset 52
> 
> Program Headers:
>  Type   Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
>  LOAD   0x60 0x00308000 0x00308000 0x3513a0 0x757860 RWE 0x20
> 
> Section to Segment mapping:
>  Segment Sections...
>   00 .text .data .bss
> [christian@chgm-pc ~]$ readelf -S /tmp/vx5
> There are 12 section headers, starting at offset 0x356580:
> 
> Section Headers:
>  [Nr] Name  TypeAddr OffSize   ES Flg Lk Inf 
> Al
>  [ 0]   NULL 00 00 00  0   0  > 0
>  [ 1] .text PROGBITS00308000 60 319b10 00 WAX  0   0 
> 32
>  [ 2] .data PROGBITS00621b20 319b80 037880 00  WA  0   0 
> 32
>  [ 3] .bss  NOBITS  006593a0 351400 4064c0 00  WA  0   0 
> 16
>  [ 4] .debug_arangesPROGBITS 351400 60 00  0   0  
> 1
>  [ 5] .debug_pubnames   PROGBITS 351460 00018b 00  0   0  
> 1
>  [ 6] .debug_info   PROGBITS 3515eb 003429 00  0   0  
> 1
>  [ 7] .debug_abbrev PROGBITS 354a14 000454 00  0   0  
> 1
>  [ 8] .debug_line   PROGBITS 354e68 0016a4 00  0   0  
> 1
>  [ 9] .shstrtab STRTAB   35650c 71 00  0   0  
> 1
>  [10] .symtab   SYMTAB   356760 0440e0 10 11 8574 
>  4
>  [11] .strtab   STRTAB   39a840 03e66c 00  0   0  
> 1
> Key to Flags:
>  W (write), A (alloc), X (execute), M (merge), S (strings)
>  I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
>  O (extra OS processing required) o (OS specific), p (processor specific)
> 
> Signed-off-by: Christian Gmeiner 
> Reviewed-by: Bin Meng 
> Tested-by: Bin Meng 

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, v1, 5/5] rtc: rx8025: remove redundant code in rtc_reset

2018-04-07 Thread Tom Rini
On Wed, Mar 21, 2018 at 03:40:37PM +1300, Chris Packham wrote:

> As of commit 1a1fa2406689 ("rtc: Set valid date after reset") the
> command "date reset" will set the date/time to 2000-01-01 0:00:00 after
> calling rtc_reset(). This means that the rx8025 implementation of
> rtc_reset() does not need to call rtc_set().
> 
> Signed-off-by: Chris Packham 

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, 3/4] clock: stm32mp1: add stgen clock source change support

2018-04-07 Thread Tom Rini
On Tue, Mar 20, 2018 at 11:41:25AM +0100, Patrick Delaunay wrote:

> The STGEN is the clock source for the Cortex A7 arch timer.
> So after modification of its frequency, CP15 cntfreq is updated
> and a new timer init is performed.
> 
> Signed-off-by: Patrick Delaunay 

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] watchdog: Fix Kconfig alignment for WDT_SANDBOX

2018-04-07 Thread Tom Rini
On Wed, Mar 28, 2018 at 12:57:54PM +0200, Michal Simek wrote:

> Fix Kconfig alignment which should be .
> 
> Signed-off-by: Michal Simek 
> Reviewed-by: Simon Glass 

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, v1, 4/5] rtc: rs5c372: remove redundant code in rtc_reset

2018-04-07 Thread Tom Rini
On Wed, Mar 21, 2018 at 03:40:36PM +1300, Chris Packham wrote:

> As of commit 1a1fa2406689 ("rtc: Set valid date after reset") the
> command "date reset" will set the date/time to 2000-01-01 0:00:00 after
> calling rtc_reset(). This means that the rs5c372 implementation of
> rtc_reset() does not need to call rtc_set().
> 
> Signed-off-by: Chris Packham 

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, v1, 3/5] rtc: mx27rtc: remove redundant code in rtc_reset

2018-04-07 Thread Tom Rini
On Wed, Mar 21, 2018 at 03:40:35PM +1300, Chris Packham wrote:

> As of commit 1a1fa2406689 ("rtc: Set valid date after reset") the
> command "date reset" will set the date/time to 2000-01-01 0:00:00 after
> calling rtc_reset(). This means that the mx27rtc implementation of
> rtc_reset() can be an empty stub function.
> 
> Signed-off-by: Chris Packham 

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/3] board: ti: am43xx: Define embedded_dtb_select for runtime DTB selection in U-boot

2018-04-07 Thread Tom Rini
On Mon, Mar 26, 2018 at 01:27:01PM +0530, Vignesh R wrote:

> AM437x QSPI boot is a single stage boot and hence needs runtime DTB
> selection to support AM437x-SK and AM437x-IDK with DM enabled. This is
> required to move am43xx_evm_qspiboot_defconfig to use DM/DT.
> 
> Signed-off-by: Vignesh R 
> 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/4] stm32mp1: add eMMC support for ED1

2018-04-07 Thread Tom Rini
On Tue, Mar 20, 2018 at 10:54:52AM +0100, Patrick Delaunay wrote:

> Add command GPT support
> Add EMMC boot support
> Add the 2 other SDMMC instances for ED1:
> - SDMMC2 = mmc 1, eMMC on the ED1 board
> - SDMMC3 = extension connector, deactivated by default
> 
> Signed-off-by: Patrick Delaunay 

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] stm32mp: handle SYSRESET

2018-04-07 Thread Tom Rini
On Tue, Mar 20, 2018 at 02:15:06PM +0100, Patrick Delaunay wrote:

> Add support of sysreset with generic driver "syscon-reboot"
> provided by RCC, for U-boot and for SPL.
> 
> Signed-off-by: Patrick Delaunay 

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, 3/3] configs: am43xx_evm_qspiboot_defconfig: Move to DM

2018-04-07 Thread Tom Rini
On Mon, Mar 26, 2018 at 01:27:03PM +0530, Vignesh R wrote:

> Move am43xx_evm_qspiboot_defconfig to DM. This is required as SPI core
> and TI QSPI driver no longer supports non DM interfaces.
> 
> Signed-off-by: Vignesh R 
> 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, 4/4] stm32mp1: change STGEN clock source to HSE

2018-04-07 Thread Tom Rini
On Tue, Mar 20, 2018 at 11:41:26AM +0100, Patrick Delaunay wrote:

> No more use static frequency HSI = 64MHz for STGEN clock
> but HSE (with higher accurency) by default.
> 
> Need to remove CONFIG_SYS_HZ_CLOCK as arch timer frequency
> is provided at boot by BootRom and cp15 cntfrq and modified
> during clock tree initialization if needed.
> 
> When HSI is no more used by any device, this internal
> oscillator can be switched off to reduce consumption.
> 
> Signed-off-by: Patrick Delaunay 

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] tools/mxsimage: Support building with LibreSSL

2018-04-07 Thread Tom Rini
On Sun, Mar 18, 2018 at 04:03:47PM +0100, Hauke Mehrtens wrote:

> The mxsimage utility fails to compile against LibreSSL version < 2.7.0
> because LibreSSL says it is OpenSSL 2.0, but it does not support the
> complete OpenSSL 1.1 interface.
> 
> LibreSSL defines OPENSSL_VERSION_NUMBER with 0x2000L and therefor
> claims to have an API compatible with OpenSSL 2.0, but it implements
> EVP_MD_CTX_new(), EVP_MD_CTX_free() and EVP_CIPHER_CTX_reset() only
> starting with version 2.7.0, which is not yet released. OpenSSL
> implements this function since version 1.1.0.
> 
> This commit will activate the compatibility code meant for
> OpenSSL < 1.1.0 also for LibreSSL version < 2.7.0.
> 
> Signed-off-by: Hauke Mehrtens 
> Reviewed-by: Jonathan Gray 

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] image: fit: Show firmware configuration property if present

2018-04-07 Thread Tom Rini
On Mon, Mar 26, 2018 at 04:31:26PM +0200, Michal Simek wrote:

> SPL ATF support requires to have firmware property which should be also
> listed by mkimage -l when images is created.
> 
> The patch is also using this macro in spl_fit to match keyword.
> 
> When image is created:
>  Default Configuration: 'config'
>  Configuration 0 (config)
>   Description:  ATF with full u-boot
>   Kernel:   unavailable
>   Firmware: atf
>   FDT:  dtb
> 
> Signed-off-by: Michal Simek 
> Reviewed-by: Simon Glass 
> Reviewed-by: Jun Nie 
> Reviewed-by: Philipp Tomsich 

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, 4/4] stm32mp1: select boot device and partition

2018-04-07 Thread Tom Rini
On Tue, Mar 20, 2018 at 10:54:54AM +0100, Patrick Delaunay wrote:

> Bootrom loads SPL from SDCARD or eMMC
> according BootPin selection.
> 
> Then SPL loads U-Boot on the same mmc device
> with the following predefined GPT partitioning:
> 
> on SDCARD: gpt partitioning
>   1: SPL
>   2: SPL#2
>   3: U-Boot
>   4: bootable partition
> 
> on eMMC:
>   The 2 boot partitions are used for SPL (2 copy)
> boot1: SPL
> boot2: SPL#2
>   The user partition use gpt partitioning
> 1: U-Boot
> 2: bootable partition
> 
> This patch select the correct SPL partition
> (3 for SDCARD on mmc0 and 1 for eMMC on mmc1)
> according the BootRom information saved in TAMP register
> and based on configuration flasg:
> - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
>   => for BOOT_DEVICE_MMC1 or mmc 0 in U-Boot
> - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2 (new)
>   => for BOOT_DEVICE_MMC2 or mmc 1 in U-Boot
> 
> And the correct boot_targets is selected according the environment
> variables boot_device and boot_instance, with preboot command,
> to search the bootable partition with kernel on this device
> (generic distro support).
> 
> Signed-off-by: Patrick Delaunay 

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] env: Properly check for BLK support

2018-04-07 Thread Tom Rini
On Thu, Mar 22, 2018 at 10:53:50PM +0100, Sjoerd Simons wrote:

> Use CONFIG_IS_ENABLED to see if CONFIG_BLK is enabled. Otherwise
> SPL compilation breaks on boards which do have CONFIG_BLK enabled but
> not DM_MMC for the SPL as follows:
> 
> env/mmc.c: In function ‘init_mmc_for_env’:
> env/mmc.c:164:6: warning: implicit declaration of function 
> ‘blk_get_from_parent’; did you mean ‘efi_get_ram_base’? 
> [-Wimplicit-function-declaration]
>   if (blk_get_from_parent(mmc->dev, &dev))
>   ^~~
>   efi_get_ram_base
> env/mmc.c:164:29: error: ‘struct mmc’ has no member named ‘dev’
>   if (blk_get_from_parent(mmc->dev, &dev))
>  ^~
> 
> Signed-off-by: Sjoerd Simons 
> Reviewed-by: Simon Glass 

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, v1, 2/5] rtc: ds1374: remove redundant code in rtc_reset

2018-04-07 Thread Tom Rini
On Wed, Mar 21, 2018 at 03:40:34PM +1300, Chris Packham wrote:

> As of commit 1a1fa2406689 ("rtc: Set valid date after reset") the
> command "date reset" will set the date/time to 2000-01-01 0:00:00 after
> calling rtc_reset(). This means that the ds1374 implementation of
> rtc_reset() doesn't need to call rtc_set().
> 
> Signed-off-by: Chris Packham 

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] rtc: rewrite isl1208 to support DM

2018-04-07 Thread Tom Rini
On Mon, Mar 19, 2018 at 08:32:05PM +0100, Klaus Goger wrote:

> Adds devicemodel support to the ISL1208 driver.
> This patch drops the non-dm API as no board was using it anyway.
> Also add it to Kconfig.
> 
> Signed-off-by: Klaus Goger 
> Reviewed-by: Philipp Tomsich 
> Reviewed-by: Simon Glass 

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] Allow providing default environment from file

2018-04-07 Thread Tom Rini
On Tue, Mar 20, 2018 at 11:38:45AM +0100, Rasmus Villemoes wrote:

> Modifying the default environment via CONFIG_EXTRA_ENV_SETTINGS is
> somewhat inflexible, partly because the cpp language does not allow
> appending to an existing macro. This prevents reuse of "environment
> fragments" for different boards, which in turn makes maintaining that
> environment consistently tedious and error-prone.
> 
> This implements a Kconfig option for allowing one to define the entire
> default environment in an external file, which can then, for example, be
> generated programmatically as part of a Yocto recipe, or simply be kept
> in version control separately from the U-boot repository.
> 
> Tested-by: Sean Nyekjaer 
> Signed-off-by: Rasmus Villemoes 
> Reviewed-by: Lukasz Majewski 

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] stm32mp: add check of cpu identifier

2018-04-07 Thread Tom Rini
On Mon, Mar 19, 2018 at 07:09:21PM +0100, Patrick Delaunay wrote:

> Add support of DBGMCU_IDC for cpu identifier
> and revision
> 
> Signed-off-by: Patrick Delaunay 

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/1] regulator: pbias: don't evaluate variable before assignment

2018-04-07 Thread Tom Rini
On Sun, Mar 18, 2018 at 12:01:06PM +0100, Heinrich Schuchardt wrote:

> We should not evaluate the value of reg before its value is set.
> 
> Signed-off-by: Heinrich Schuchardt 
> Reviewed-by: Simon Glass 

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] stm32mp: cleanup cpu.c

2018-04-07 Thread Tom Rini
On Mon, Mar 19, 2018 at 07:09:20PM +0100, Patrick Delaunay wrote:

> Move all defines at the beginning of the file
> 
> 
> Signed-off-by: Patrick Delaunay 

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,13/14] spi: atmel: Drop atmel_spi.h

2018-04-07 Thread Tom Rini
On Fri, Apr 06, 2018 at 04:29:50PM -0400, Tom Rini wrote:
> On Wed, Mar 14, 2018 at 06:46:43PM +0530, Jagan Teki wrote:
> 
> > atmel_spi.h has register offsets, and atmel_spi_slave
> > structure, move it into .c file for better readability
> > and drop atmel_spi.h
> > 
> > Signed-off-by: Jagan Teki 
> > Acked-by: Wenyou Yang 
> 
> Applied to u-boot/master, thanks!

Ah, oops, until we sort out how to handle the taurus boards, this was
premature, sorry, reverting.

-- 
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,12/14] spi: atmel: Drop non-dm code

2018-04-07 Thread Tom Rini
On Fri, Apr 06, 2018 at 04:29:47PM -0400, Tom Rini wrote:
> On Wed, Mar 14, 2018 at 06:46:42PM +0530, Jagan Teki wrote:
> 
> > All board configs are now enabled DM_SPI for SPL and
> > U-Boot proper, so now its time to drop non-dm code.
> > 
> > Signed-off-by: Jagan Teki 
> > Acked-by: Wenyou Yang 
> 
> Applied to u-boot/master, thanks!

Ah, oops, until we sort out how to handle the taurus boards, this was
premature, sorry, reverting.

-- 
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 06/17] warp7: Print out the OPTEE DRAM region

2018-04-07 Thread Breno Matheus Lima
Hi Bryan,

2018-04-02 19:42 GMT-03:00 Bryan O'Donoghue :
> Right now a region of 0x30 bytes is allocated at the end of DRAM for
> the purposes of loading an OPTEE firmware inside of it. This patch adds the
> printout of the relevant address ranges.
>
> Signed-off-by: Bryan O'Donoghue 

Just a quick question here, It was your intention to do not add
CONFIG_OPTEE_TZDRAM_SIZE=0x30 in your series? So users can setup
according their requirements?

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


Re: [U-Boot] [PATCH v2 09/17] warp7: defconfig: Enable CONFIG_BOOTM_TEE

2018-04-07 Thread Breno Matheus Lima
Hi Bryan,

2018-04-02 19:42 GMT-03:00 Bryan O'Donoghue :
> This patch enables CONFIG_BOOTM_TEE. Once enabled its possible to
> chain-load Linux through OPTEE.
>
> Loading kernel to 0x8080
> => run loadimage
>
> Load FDT to 0x8300
> => run loadfdt
>
> Load OPTEE to 0x8400
> => fatload mmc 0:5 0x8400 /lib/firmware/uTee.optee
>
> Then chain-load to the kernel via OPTEE
>
> => bootm 0x8400 - 0x8300
>
>Image Name:
>Image Type:   ARM Trusted Execution Environment Kernel Image (uncompressed)
>Data Size:249844 Bytes = 244 KiB
>Load Address: 9de4
>Entry Point:  9e00
>Verifying Checksum ... OK
>Loading Kernel Image ... OK


I'm seeing the following cache misaligned operation warning in my
environment, did I miss something on my OPTEE build?

=> bootm 0x8400 - 0x8300
## Booting kernel from Legacy Image at 8400 ...
   Image Name:
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:274844 Bytes = 268.4 KiB
   Load Address: 9de4
   Entry Point:  9e00
   Verifying Checksum ... OK
## Flattened Device Tree blob at 8300
   Booting using the fdt blob at 0x8300
   Loading Kernel Image ... OK
CACHE: Misaligned operation at range [9de4, 9e0431a4]
   Using Device Tree in place at 8300, end 830095b6

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


Re: [U-Boot] [PATCH v2 16/17] warp7: defconfig: Enable CMD_SETEXPR

2018-04-07 Thread Breno Matheus Lima
Hi Bryan,

2018-04-02 19:42 GMT-03:00 Bryan O'Donoghue :
> setexpr allows us to do arithmetic for env variables - something that is
> both useful and required when doing HAB authentication without hard-coding
> HAB load addresses.
>
> Enable setexpr in the secure defconfig - it's not required for the unsecure
> version.

I believe we can reword this sentence since the warp7_secure_defconfig
were removed :)

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


Re: [U-Boot] [PATCH v2 07/17] warp7: Specify CONFIG_OPTEE_LOAD_ADDR

2018-04-07 Thread Breno Matheus Lima
Hi Bryan,

2018-04-02 19:42 GMT-03:00 Bryan O'Donoghue :
> In order to sign images with the IMX code-signing-tool (CST) we need to
> know the load address of a given image. The best way to derive this load
> address is to make it into a define - so that u-boot.cfg contains the
> address - which we can then parse when generating the IMX CST headers.
>
> This patch makes the OPTEE_LOAD_ADDR available via u-boot.cfg for further
> parsing by external tools.
>
> Signed-off-by: Bryan O'Donoghue 
> Reviewed-by: Ryan Harkin 
> ---
>  configs/warp7_defconfig | 1 +
>  include/configs/warp7.h | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
> index 3dbcd69..c647cd0 100644
> --- a/configs/warp7_defconfig
> +++ b/configs/warp7_defconfig
> @@ -45,3 +45,4 @@ CONFIG_USB_ETH_CDC=y
>  CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
>  CONFIG_OF_LIBFDT=y
>  CONFIG_OPTEE=y
> +CONFIG_OPTEE_LOAD_ADDR=0x8400


I'm seeing the following in my U-Boot environment variables, seems
that CONFIG_OPTEE_LOAD_ADDR it's not being correctly defined:
...
mmcpart=1
optee_addr=CONFIG_OPTEE_LOAD_ADDR
rootpart=2
...

Moving CONFIG_OPTEE_LOAD_ADDR to Kconfig address this issue, can you
please check if the same is happening in your side?

--- a/board/warp7/Kconfig
+++ b/board/warp7/Kconfig
@@ -20,4 +20,10 @@ config SYS_FDT_ADDR
 help
   The address the FDT file should be loaded to.

+config OPTEE_LOAD_ADDR
+hex "OPTEE load address"
+default 0x8400
+help
+  The address the OPTEE binary should be loaded to.
+
 endif

--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1469,6 +1469,7 @@ CONFIG_OMAP_EHCI_PHY2_RESET_GPIO
 CONFIG_OMAP_EHCI_PHY3_RESET_GPIO
 CONFIG_OMAP_USB2PHY2_HOST
 CONFIG_OMAP_USB3PHY1_HOST
+CONFIG_OPTEE_LOAD_ADDR
 CONFIG_ORIGEN

U-Boot environment variables after applying the patch above:
...
mmcpart=1
optee_addr=0x8400
rootpart=2
...

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