Re: [U-Boot] rockchip: add support for backing to bootrom download mode

2017-09-12 Thread Philipp Tomsich



On Mon, 11 Sep 2017, Andy Yan wrote:


Rockchip bootrom will enter download mode if it returns from
spl/tpl with a none-zero value and couldn't find a valid image
in the backup partition.
This patch provide a method to instruct the system to back to
bootrom download mode by checking the BROM_DOWNLOAD_FLAG register.
As the bootrom download function relys on some modules such as
interrupts, so we need to back to bootrom as early as possbile
before the tpl/tps code override the interrupt settings.


I was not aware that the TPL/SPL overrides interrupt settings. What 
exactly does this comment refer to?




Signed-off-by: Andy Yan <andy@rock-chips.com>
Reviewed-by: Kever Yang <kever.y...@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

arch/arm/include/asm/arch-rockchip/bootrom.h |  2 +-
arch/arm/mach-rockchip/Kconfig   | 13 +++
arch/arm/mach-rockchip/bootrom.c |  2 +-
arch/arm/mach-rockchip/save_boot_param.S | 57 +++-
4 files changed, 63 insertions(+), 11 deletions(-)

diff --git a/arch/arm/include/asm/arch-rockchip/bootrom.h 
b/arch/arm/include/asm/arch-rockchip/bootrom.h
index 92eb878..6ae3e94 100644
--- a/arch/arm/include/asm/arch-rockchip/bootrom.h
+++ b/arch/arm/include/asm/arch-rockchip/bootrom.h
@@ -22,6 +22,6 @@ void back_to_bootrom(void);
/**
 * Assembler component for the above (do not call this directly)
 */
-void _back_to_bootrom_s(void);
+void _back_to_bootrom_s(int mode);


Please add documentation for externally visible functions.



#endif
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index d9b25d5..3ab0c30 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -113,6 +113,7 @@ config ROCKCHIP_RK3399
select SPL_SERIAL_SUPPORT
select SPL_DRIVERS_MISC_SUPPORT
select ENABLE_ARM_SOC_BOOT0_HOOK
+   select ROCKCHIP_BROM_HELPER
select DEBUG_UART_BOARD_INIT
help
  The Rockchip RK3399 is a ARM-based SoC with a dual-core Cortex-A72
@@ -149,6 +150,18 @@ config TPL_ROCKCHIP_BACK_TO_BROM
  SPL will return to the boot rom, which will then load the U-Boot
  binary to keep going on.

+config ROCKCHIP_BACK_TO_BROM_DOWNLOAD_REG
+   hex "Bootrom download mode flag register address"
+   default 0x200081c8 if ROCKCHIP_RK3036
+   default 0xff730094 if ROCKCHIP_RK3288
+   default 0xff738200 if ROCKCHIP_RK3368
+   default 0xff320300 if ROCKCHIP_RK3399
+   default 0x10300580 if ROCKCHIP_RV1108
+   default 0x00


If this is not user-configurable (i.e. if it is a per-chip constant), we 
should define this in a header file.  I would suggest to do the 
detection/mapping either in include/asm/arch-rockchip/bootrom.h or in a 
cpu-specific header that gets included from there.



+   help
+ The Soc will return to bootrom download mode if this register set
+ to BOOTROM_DOWNLOAD_FLAG.


Documenting here what BOOTROM_DOWNLOAD_FLAG is or where it can be found 
would be very helpful to anyone coming across this in the future.



+
config ROCKCHIP_SPL_RESERVE_IRAM
hex "Size of IRAM reserved in SPL"
default 0x4000
diff --git a/arch/arm/mach-rockchip/bootrom.c b/arch/arm/mach-rockchip/bootrom.c
index 8380e4e..6f0d583 100644
--- a/arch/arm/mach-rockchip/bootrom.c
+++ b/arch/arm/mach-rockchip/bootrom.c
@@ -12,5 +12,5 @@ void back_to_bootrom(void)
#if CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
puts("Returning to boot ROM...\n");
#endif
-   _back_to_bootrom_s();
+   _back_to_bootrom_s(0);
}
diff --git a/arch/arm/mach-rockchip/save_boot_param.S 
b/arch/arm/mach-rockchip/save_boot_param.S
index 50fce20..f1bed0b 100644
--- a/arch/arm/mach-rockchip/save_boot_param.S
+++ b/arch/arm/mach-rockchip/save_boot_param.S
@@ -7,11 +7,25 @@

#include 

+#define BACK_TO_BROM_DOWNLOAD_FLAG   0xEF08A53C


This looks like it should be defined in bootrom.h


+
#if defined(CONFIG_ARM64)
.globl  SAVE_SP_ADDR
SAVE_SP_ADDR:
.quad 0

+ENTRY(check_back_to_brom_dnl_flag)
+   ldr x8, =CONFIG_ROCKCHIP_BACK_TO_BROM_DOWNLOAD_REG
+   ldr x9, [x8]
+   ldr x0, =BACK_TO_BROM_DOWNLOAD_FLAG
+   cmp x9, x0
+   b.nesave_boot_params_ret
+   mov x9, xzr
+   str x9, [x8]/* clear flag */
+   mov x0, #1  /* indicate the bootrom to enter download mode 
*/
+   b   _back_to_bootrom_s


How does this ever get entered? If the download flag is already set prior 
to this code being executed, then the BROM would certainly not even come 
here?


If you just always save the boot_params and check the download flag later 
from C code, then you could have this implemented in C. This will remove 
the need to write two separate assembly functions (for AArch64 and 
AArch32) and generally be more readable. Please revise.



+ENDPROC(check_back_to_brom

[U-Boot] [RESEND PATCH 2/2] rockchip: dts: rk3399-puma: replace 'rockchip, vbus-gpio' with fixed regulator

2017-09-12 Thread Philipp Tomsich
On the RK3399-Q7, we need to turn on the on-module USB hub before using the
USB host interfaces (only the OTG interface is directly connected to the edge
connector).  This drops the deprecated 'rockchip,vbus-gpio' property and uses
a fixed regulator to turn on the USB hub.

References: 26a8b80 "usb: host: xhci-rockchip: use fixed regulator to control 
vbus"
Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 arch/arm/dts/rk3399-puma.dtsi | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi
index 85e00ec..3899b2a 100644
--- a/arch/arm/dts/rk3399-puma.dtsi
+++ b/arch/arm/dts/rk3399-puma.dtsi
@@ -108,6 +108,17 @@
regulator-max-microvolt = <180>;
};
 
+   usbhub_enable: usbhub_enable {
+   compatible = "regulator-fixed";
+   regulator-name = "usbhub_enable";
+   enable-active-low;
+   gpio = < 3 GPIO_ACTIVE_HIGH>;
+   regulator-always-on;
+   regulator-boot-on;
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   };
+
vccadc_ref: vccadc-ref {
compatible = "regulator-fixed";
regulator-name = "vcc1v8_sys";
@@ -533,7 +544,6 @@
 };
 
 _typec1 {
-   rockchip,vbus-gpio = < 3 GPIO_ACTIVE_LOW>;
status = "okay";
 };
 
-- 
2.1.4

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


[U-Boot] [RESEND PATCH 4/6] usb: dwc2: convert to livetree

2017-09-12 Thread Philipp Tomsich
Update the DWC2 USB driver to support a live tree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 drivers/usb/host/dwc2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index 64c42ac..0ed72d5 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -1245,7 +1245,7 @@ static int dwc2_usb_ofdata_to_platdata(struct udevice 
*dev)
struct dwc2_priv *priv = dev_get_priv(dev);
fdt_addr_t addr;
 
-   addr = devfdt_get_addr(dev);
+   addr = dev_read_addr(dev);
if (addr == FDT_ADDR_T_NONE)
return -EINVAL;
priv->regs = (struct dwc2_core_regs *)addr;
-- 
2.1.4

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


[U-Boot] [RESEND PATCH 6/6] rockchip: defconfig: puma-rk3399: enable OF_LIVE (live tree)

2017-09-12 Thread Philipp Tomsich
With the critical drivers ready for switching to a live tree, we can
not enable it in the defconfig for the RK3399-Q7.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 configs/puma-rk3399_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
index 861b8c6..62a8d7c 100644
--- a/configs/puma-rk3399_defconfig
+++ b/configs/puma-rk3399_defconfig
@@ -38,6 +38,7 @@ CONFIG_CMD_TIME=y
 CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_LIVE=y
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names interrupt-parent 
assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
-- 
2.1.4

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


[U-Boot] [RESEND PATCH 10/10] rockchip: defconfig: puma-rk3399: update for DM_REGULATOR support in SPL

2017-09-12 Thread Philipp Tomsich
The RK3399-Q7 requires DM regulator support in SPL, so we can use the
regulator framework to reenable the eMMC and SPI, if these had been
turned of by the BIOS_DISABLE signal.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 configs/puma-rk3399_defconfig | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
index 1badf80..861b8c6 100644
--- a/configs/puma-rk3399_defconfig
+++ b/configs/puma-rk3399_defconfig
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
+CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x4000
@@ -20,6 +21,8 @@ CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
+CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
@@ -62,8 +65,10 @@ CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_ROCKCHIP_RK3399=y
 CONFIG_DM_PMIC=y
 CONFIG_PMIC_RK8XX=y
-CONFIG_REGULATOR_PWM=y
+CONFIG_SPL_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_SPL_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_RAM=y
-- 
2.1.4

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


[U-Boot] [RESEND PATCH 00/10] rockchip: puma-rk3399: support 'same-as-spl' for boot-order and always power-up eMMC/SPI

2017-09-12 Thread Philipp Tomsich

For the RK3399-Q7, we have a few additional features in the SPL boot
path that we'd like to see supported in the mainline:
- The override signal BIOS_DISABLE keeps the on-module SPI and eMMC
  powered-down (actually: in reset) to force booting from external
  sources.  Before proceeding with the SPL boot, we thus need to
  power the devices up (actually: release the reset) in software.
  This is done using the regulator framework and a fixed regulator.
- Depending on the boot-sources and system configuration, we may
  want to insert the device the SPL stage was booted from at the
  start of the boot order, for these we introduce the special device
  select 'same-as-spl' for the boot-order.

This series contains the following changes:
* moves board-specific functionality for the RK3399 SPL stage from the
  shared SPL board support file to individual ones for the EVB and Puma.
* enables the power-regulator framework of Puma
* adds fixed regulator support for powering up the eMMC and SPI flashes
* adds support for the 'same-as-spl' specifier for the boot order (incl.
  updating the documentation for this


Philipp Tomsich (10):
  rockchip: rk3399: make spl_board_init board-specific
  rockchip: bootrom: add definitions to retrieve BROM boot-source
  rockchip: spl: add documentation for spl_node_to_boot_device()
  rockchip: spl: support a 'same-as-spl'-specifier in the spl-boot-order
  rockchip: spl: rk3399: implement chip-specific
board_spl_was_booted_from()
  rockchip: dts: rk3399-puma: add 'same-as-spl' to the front of the
boot-order
  rockchip: puma-rk3399: update board_init()
  rockchip: rk3399-puma: add boot-on regulator to override BIOS_DISABLE
  power: spl: add SPL_DM_REGULATOR_FIXED in Kconfig
  rockchip: defconfig: puma-rk3399: update for DM_REGULATOR support in
SPL

 arch/arm/dts/rk3399-puma.dtsi | 26 +-
 arch/arm/include/asm/arch-rockchip/bootrom.h  | 18 +++
 arch/arm/mach-rockchip/rk3399-board-spl.c | 51 +---
 arch/arm/mach-rockchip/spl-boot-order.c   | 48 +-
 board/rockchip/evb_rk3399/evb-rk3399.c| 32 +++-
 board/theobroma-systems/puma_rk3399/puma-rk3399.c | 59 +--
 configs/puma-rk3399_defconfig |  7 ++-
 doc/device-tree-bindings/chosen.txt   | 12 -
 drivers/power/regulator/Kconfig   |  7 +++
 9 files changed, 192 insertions(+), 68 deletions(-)

-- 
2.1.4

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


Re: [U-Boot] [U-Boot,01/10] lib: add TPL_OF_LIBFDT option for TPL

2017-09-12 Thread Philipp Tomsich
> TPL may need use libfdt for dt decode, add option for it.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> ---
> 
>  lib/Kconfig | 10 ++
>  1 file changed, 10 insertions(+)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 07/10] rockchip: rk322x: dts: enable uart2 for SPL/TPL

2017-09-12 Thread Philipp Tomsich
> When we use DM_SERIAL for serial driver, we need enable the
> dts node for the debug console.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> ---
> 
>  arch/arm/dts/rk3229-evb.dts | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,04/10] rockchip: rk322x: enable tpl support

2017-09-12 Thread Philipp Tomsich
> Move original spl to tpl, and add spl to load next stage firmware,
> adapt all the address and option for them.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> ---
> 
>  arch/arm/mach-rockchip/Kconfig   |  9 
>  arch/arm/mach-rockchip/Makefile  |  3 +-
>  arch/arm/mach-rockchip/rk322x-board-spl.c| 66 ++-
>  arch/arm/mach-rockchip/rk322x-board-tpl.c| 81 
> 
>  arch/arm/mach-rockchip/rk322x/u-boot-tpl.lds | 13 +
>  include/configs/rk322x_common.h  | 12 +++--
>  6 files changed, 128 insertions(+), 56 deletions(-)
>  create mode 100644 arch/arm/mach-rockchip/rk322x-board-tpl.c
>  create mode 100644 arch/arm/mach-rockchip/rk322x/u-boot-tpl.lds
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 08/10] rockchip: evb-rk3229: add fit source file for itb

2017-09-12 Thread Philipp Tomsich
> We package U-Boot and OP-TEE into one itb file for SPL,
> so that we can support OP-TEE in SPL.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> ---
> 
>  board/rockchip/evb_rk3229/fit_spl_optee.its | 48 
> +
>  1 file changed, 48 insertions(+)
>  create mode 100644 board/rockchip/evb_rk3229/fit_spl_optee.its
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/2] rockchip: rk3368: add the missing target and pinctrl config for sheep board

2017-09-12 Thread Philipp Tomsich
> Add the missing target and pinctrl config for rk3368 sheep board
> 
> Signed-off-by: Andy Yan <andy@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  configs/sheep-rk3368_defconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 3/3] rockchip: remove CONFIG_SPL_ATF_TEXT_BASE for all boards

2017-09-12 Thread Philipp Tomsich
> After update bl31_entry(), we don't need CONFIG_SPL_ATF_TEXT_BASE.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> ---
> 
>  configs/firefly-rk3399_defconfig | 1 -
>  configs/lion-rk3368_defconfig| 1 -
>  2 files changed, 2 deletions(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] rockchip: add support for backing to bootrom download mode

2017-09-12 Thread Philipp Tomsich
> Rockchip bootrom will enter download mode if it returns from
> spl/tpl with a none-zero value and couldn't find a valid image
> in the backup partition.
> This patch provide a method to instruct the system to back to
> bootrom download mode by checking the BROM_DOWNLOAD_FLAG register.
> As the bootrom download function relys on some modules such as
> interrupts, so we need to back to bootrom as early as possbile
> before the tpl/tps code override the interrupt settings.
> 
> Signed-off-by: Andy Yan <andy@rock-chips.com>
> Reviewed-by: Kever Yang <kever.y...@rock-chips.com>
> ---
> 
>  arch/arm/include/asm/arch-rockchip/bootrom.h |  2 +-
>  arch/arm/mach-rockchip/Kconfig   | 13 +++
>  arch/arm/mach-rockchip/bootrom.c |  2 +-
>  arch/arm/mach-rockchip/save_boot_param.S | 57 
> +++-
>  4 files changed, 63 insertions(+), 11 deletions(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 1/4] rockchip: rk3229: move usb gadget into defconfig

2017-09-12 Thread Philipp Tomsich
> Use the defconfig for all usb gadget and function related
> option instead of define then in header file.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
> Changes in v2: None
> 
>  configs/evb-rk3229_defconfig| 17 +
>  include/configs/evb_rk3229.h|  1 -
>  include/configs/rk322x_common.h | 20 
>  3 files changed, 17 insertions(+), 21 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 4/4] rockchip: enable rockusb for all rockchip SoCs

2017-09-12 Thread Philipp Tomsich
> Rockusb will be used by all the rockchip SoCs, enable it by
> default in Kconfig, and it can be work if USB gadget is available.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
> Changes in v2: None
> 
>  arch/arm/Kconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 3/3] rockchip: evb-rk3399: update document for board bring up

2017-09-12 Thread Philipp Tomsich
> Since we support ATF in SPL and add script for it, let's make the
> document up to date.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
> Changes in v2:
> - typo fix, evb-firefly->firefly-rk3399
> 
>  board/rockchip/evb_rk3399/README | 79 
> 
>  1 file changed, 63 insertions(+), 16 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 2/3] rockchip: firefly-rk3399: add FIT for rk3399

2017-09-12 Thread Philipp Tomsich
> Enable SPL_FIT_GENERATOR with path for it.
> With this patch you can get u-boot.itb for rk3399-firefly with:
> > make u-boot.itb
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Mark Kettenis <kette...@openbsd.org>
> Tested-by: Mark Kettenis <kette...@openbsd.org>
> ---
> 
> Changes in v2:
> - typo fix, rk3399-evb->rk3399-firefly
> 
>  configs/firefly-rk3399_defconfig | 1 +
>  1 file changed, 1 insertion(+)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 1/3] rockchip: rk3399-evb: add script for atf fit

2017-09-12 Thread Philipp Tomsich
> Add a script to generate binaries from bl31.elf, and generate
> u-boot.its file for FIT image including u-boot, dtb and atf binaries.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Mark Kettenis <kette...@openbsd.org>
> Tested-by: Mark Kettenis <kette...@openbsd.org>
> ---
> 
> Changes in v2: None
> 
>  board/rockchip/evb_rk3399/mk_fit_atf.sh | 110 
> 
>  1 file changed, 110 insertions(+)
>  create mode 100755 board/rockchip/evb_rk3399/mk_fit_atf.sh
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 06/10] spl: add support to booting with OP-TEE

2017-09-12 Thread Philipp Tomsich



On Wed, 6 Sep 2017, Kever Yang wrote:


OP-TEE is an open source trusted OS, in armv7, its loading and
running are like this:
loading:
- SPL load both OP-TEE and U-Boot
running:
- SPL run into OP-TEE in secure mode;
- OP-TEE run into U-Boot in non-secure mode;

More detail:
https://github.com/OP-TEE/optee_os
and search for 'boot arguments' for detail entry parameter in:
core/arch/arm/kernel/generic_entry_a32.S


Adding some documentation to U-Boot that documents the binary interface 
with OPTEE would be helpful.




Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

common/spl/Kconfig |  7 +++
common/spl/Makefile|  1 +
common/spl/spl.c   |  5 +
common/spl/spl_optee.S | 13 +
include/spl.h  |  9 +
5 files changed, 35 insertions(+)
create mode 100644 common/spl/spl_optee.S

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 582b685..85f8d66 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -700,6 +700,13 @@ config SPL_ATF_TEXT_BASE
help
  This is the base address in memory for ATF BL31 text and entry point.

+config SPL_OPTEE_SUPPORT
+   bool "Support OP-TEE Trusted OS"
+   depends on ARM
+   help
+ OP-TEE is an open source Trusted OS  which is loaded by SPL.
+ More detail at: https://github.com/OP-TEE/optee_os
+
config TPL
bool
depends on SUPPORT_TPL
diff --git a/common/spl/Makefile b/common/spl/Makefile
index fde0d09..ec37428 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -23,6 +23,7 @@ obj-$(CONFIG_$(SPL_TPL_)UBI) += spl_ubi.o
obj-$(CONFIG_$(SPL_TPL_)NET_SUPPORT) += spl_net.o
obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += spl_mmc.o
obj-$(CONFIG_$(SPL_TPL_)ATF_SUPPORT) += spl_atf.o
+obj-$(CONFIG_$(SPL_TPL_)OPTEE_SUPPORT) += spl_optee.o
obj-$(CONFIG_$(SPL_TPL_)USB_SUPPORT) += spl_usb.o
obj-$(CONFIG_$(SPL_TPL_)FAT_SUPPORT) += spl_fat.o
obj-$(CONFIG_$(SPL_TPL_)EXT_SUPPORT) += spl_ext.o
diff --git a/common/spl/spl.c b/common/spl/spl.c
index d245cfc..6ff390c 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -430,6 +430,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
bl31_entry();
}

+   if (CONFIG_IS_ENABLED(OPTEE_SUPPORT)) {
+   debug("loaded - jumping to U-Boot via OP-TEE.\n");
+   spl_optee_entry(0, 0, 0, (void *)spl_image.entry_point);
+   }
+


Shouldn't the fact that we will boot through the OPTEE tracked through 
spl_image->os and shouldn't there be a IH_OS_... constant that indicates 
that we are going to jump to an OPTEE?  This would allow the above switch 
statement to be extended for OPTEE.



debug("loaded - jumping to U-Boot...\n");
#ifdef CONFIG_BOOTSTAGE_STASH
int ret;
diff --git a/common/spl/spl_optee.S b/common/spl/spl_optee.S
new file mode 100644
index 000..4f7f8ba
--- /dev/null
+++ b/common/spl/spl_optee.S
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2017 Rockchip Electronic Co.,Ltd
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+
+ENTRY(spl_optee_entry)
+   ldr lr, =CONFIG_SYS_TEXT_BASE
+   mov pc, r3
+ENDPROC(spl_optee_entry)


This looks ARM-specific and shouldn't be in common/spl.

Please note that the next OS image will not always be a CONFIG_SYS_TEXT_BASE.
So the address of the "next image to boot" should be an argument to this
function (we will need to solve this cleanly anyway, as I am currently 
trying to address the same issue with booting through ATF where I have an 
entry address into the ATF and need to keep track of the next image's 
entry address as well).



diff --git a/include/spl.h b/include/spl.h
index ce4cf0a..13d46ed 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -270,6 +270,15 @@ int spl_mmc_load_image(struct spl_image_info *spl_image,
void bl31_entry(void);

/**
+ * spl_optee_entry - entry function for optee
+ * entry arg0, pagestore
+ * entry arg1, (ARMv7 standard bootarg #1)
+ * entry arg2, device tree address, (ARMv7 standard bootarg #2)
+ * entry arg3, non-secure entry address (ARMv7 bootarg #0)
+ */
+void spl_optee_entry(void *arg0, void *arg1, void *arg2, void *arg3);
+
+/**
 * board_return_to_bootrom - allow for boards to continue with the boot ROM
 *
 * If a board (e.g. the Rockchip RK3368 boards) provide some


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


Re: [U-Boot] [U-Boot, 07/10] rockchip: rk322x: dts: enable uart2 for SPL/TPL

2017-09-12 Thread Philipp Tomsich
> When we use DM_SERIAL for serial driver, we need enable the
> dts node for the debug console.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  arch/arm/dts/rk3229-evb.dts | 1 +
>  1 file changed, 1 insertion(+)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,01/10] lib: add TPL_OF_LIBFDT option for TPL

2017-09-12 Thread Philipp Tomsich
> TPL may need use libfdt for dt decode, add option for it.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  lib/Kconfig | 10 ++
>  1 file changed, 10 insertions(+)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,04/10] rockchip: rk322x: enable tpl support

2017-09-12 Thread Philipp Tomsich
> Move original spl to tpl, and add spl to load next stage firmware,
> adapt all the address and option for them.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  arch/arm/mach-rockchip/Kconfig   |  9 
>  arch/arm/mach-rockchip/Makefile  |  3 +-
>  arch/arm/mach-rockchip/rk322x-board-spl.c| 66 ++-
>  arch/arm/mach-rockchip/rk322x-board-tpl.c| 81 
> 
>  arch/arm/mach-rockchip/rk322x/u-boot-tpl.lds | 13 +
>  include/configs/rk322x_common.h  | 12 +++--
>  6 files changed, 128 insertions(+), 56 deletions(-)
>  create mode 100644 arch/arm/mach-rockchip/rk322x-board-tpl.c
>  create mode 100644 arch/arm/mach-rockchip/rk322x/u-boot-tpl.lds
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 10/10] rockchip: evb-rk322x: update defconfig with tpl and optee support

2017-09-12 Thread Philipp Tomsich
> Enable all the options for TPL/SPL and OPTEE.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  configs/evb-rk3229_defconfig | 28 
>  1 file changed, 24 insertions(+), 4 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 08/10] rockchip: evb-rk3229: add fit source file for itb

2017-09-12 Thread Philipp Tomsich
> We package U-Boot and OP-TEE into one itb file for SPL,
> so that we can support OP-TEE in SPL.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  board/rockchip/evb_rk3229/fit_spl_optee.its | 48 
> +
>  1 file changed, 48 insertions(+)
>  create mode 100644 board/rockchip/evb_rk3229/fit_spl_optee.its
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 02/10] arm: add option for TPL support in arm 32bit

2017-09-12 Thread Philipp Tomsich
> Some options like TPL_SYS_THUMB_BUILD, TPL_USE_ARCH_MEMCPY
> and TPL_USE_ARCH_MEMCPY are needed for TPL build in 32bit arm.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  arch/arm/Kconfig | 29 +
>  1 file changed, 29 insertions(+)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,03/10] arm: add a separate stack for TPL

2017-09-12 Thread Philipp Tomsich
> TPL stack may different from SPL and sys stack, add support for
> separate one when the board defines it.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  arch/arm/lib/crt0.S | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 05/10] sysreset: enable driver support in SPL/TPL

2017-09-12 Thread Philipp Tomsich
> SPL/TPL also need use sysreset for some feature like panic callback.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  drivers/sysreset/Kconfig  | 18 ++
>  drivers/sysreset/Makefile |  2 +-
>  2 files changed, 19 insertions(+), 1 deletion(-)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 00/19] rockchip: convert the RK3368 to OF_LIVE and validate on the RK3368-uQ7

2017-09-11 Thread Philipp Tomsich

This series converts all dependencies for the RK3368-uQ7 to support a
live tree and and tests w/ BOOTSTAGE enabled (thus introducing a few
additional changes to the Rockchip DM timer driver).

Note that updating the RK3399 support (which will have us look at
video) for a live tree is a separate series separate series (to be
applied on top of this one).

Changes in v3:
- [twice:] added Joe's Acked-by: tag (which I had lost)
- added Jagan's Reviewed-by: tag.
- added Heiko's Acked-by: tag.

Changes in v2:
- implements the dev_read_addr_ptr() function
- use the new dev_read_addr_ptr() function
- improve error handling, in case dev_read_addr_ptr returns NULL
- use the dev_read_addr_ptr function in rk_i2c.c

Philipp Tomsich (19):
  bootstage: adjust Makefile to allow including bootstage in SPL, but
not in TPL
  dm: timer: Convert to livetree
  dm: timer: handle being called before dm_root is ready
  dm: core: add dev_read_addr_ptr()
  net: designware: Convert to livetree
  net: phy: micrel: Convert to livetree
  rockchip: mmc: convert to livetree
  rockchip: timer: implement timer_get_boot_us
  rockchip: timer: Convert to livetree
  rockchip: clk: rk3368: Convert to livetree
  rockchip: pinctrl: rk3368: Convert to livetree
  rockchip: spi: Convert to livetree
  rockchip: sdhci: Convert to livetree
  rockchip: rk8xx: remove unused header includes
  rockchip: i2c: Convert to livetree
  rockchip: gpio: convert to livetree
  rockchip: gpio: remove outdated/misleading comment
  rockchip: dts: rk3368-lion: add /chosen/tick-timer
  rockchip: lion-rk3368: defconfig: resync w/ OF_LIVE and BOOTSTAGE
enabled

 arch/arm/dts/rk3368-lion-u-boot.dtsi  |  2 +
 common/Makefile   |  2 +-
 configs/lion-rk3368_defconfig |  7 +++
 drivers/clk/rockchip/clk_rk3368.c |  2 +-
 drivers/core/read.c   |  7 +++
 drivers/gpio/rk_gpio.c|  3 +-
 drivers/i2c/rk_i2c.c  |  2 +-
 drivers/mmc/rockchip_dw_mmc.c |  2 +-
 drivers/mmc/rockchip_sdhci.c  |  3 +-
 drivers/net/designware.c  | 11 ++---
 drivers/net/phy/micrel_ksz90x1.c  |  5 +-
 drivers/pinctrl/rockchip/pinctrl_rk3368.c |  3 +-
 drivers/power/pmic/rk8xx.c|  2 -
 drivers/spi/rk_spi.c  |  2 +-
 drivers/timer/rockchip_timer.c| 76 ---
 drivers/timer/timer-uclass.c  | 52 -
 include/dm/read.h | 15 ++
 17 files changed, 144 insertions(+), 52 deletions(-)

-- 
2.1.4

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


[U-Boot] [PATCH v3 02/19] dm: timer: Convert to livetree

2017-09-11 Thread Philipp Tomsich
This updates dm_timer_init to support a live tree and deals with
some fallout (i.e. the need to restructure the code such, that we
don't need multiple discontinuous #if CONFIG_IS_ENABLED blocks).

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

Changes in v3: None
Changes in v2: None

 drivers/timer/timer-uclass.c | 45 ++--
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c
index a84755f..62d6f0b 100644
--- a/drivers/timer/timer-uclass.c
+++ b/drivers/timer/timer-uclass.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -54,9 +55,10 @@ static int timer_pre_probe(struct udevice *dev)
if (IS_ERR_VALUE(ret))
return ret;
uc_priv->clock_rate = ret;
-   } else
-   uc_priv->clock_rate = fdtdec_get_int(gd->fdt_blob,
-   dev_of_offset(dev), "clock-frequency", 0);
+   } else {
+   uc_priv->clock_rate =
+   dev_read_u32_default(dev, "clock-frequency", 0);
+   }
 #endif
 
return 0;
@@ -83,9 +85,8 @@ u64 timer_conv_64(u32 count)
 
 int notrace dm_timer_init(void)
 {
-   __maybe_unused const void *blob = gd->fdt_blob;
struct udevice *dev = NULL;
-   int node = -ENOENT;
+   __maybe_unused ofnode node;
int ret;
 
if (gd->timer)
@@ -93,27 +94,27 @@ int notrace dm_timer_init(void)
 
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
/* Check for a chosen timer to be used for tick */
-   node = fdtdec_get_chosen_node(blob, "tick-timer");
+   node = ofnode_get_chosen_node("tick-timer");
+
+   if (ofnode_valid(node) &&
+   uclass_get_device_by_ofnode(UCLASS_TIMER, node, )) {
+   /*
+* If the timer is not marked to be bound before
+* relocation, bind it anyway.
+*/
+   if (!lists_bind_fdt(dm_root(), node, )) {
+   ret = device_probe(dev);
+   if (ret)
+   return ret;
+   }
+   }
 #endif
-   if (node < 0) {
-   /* No chosen timer, trying first available timer */
+
+   if (!dev) {
+   /* Fall back to the first available timer */
ret = uclass_first_device_err(UCLASS_TIMER, );
if (ret)
return ret;
-   } else {
-   if (uclass_get_device_by_of_offset(UCLASS_TIMER, node, )) {
-   /*
-* If the timer is not marked to be bound before
-* relocation, bind it anyway.
-*/
-   if (node > 0 &&
-   !lists_bind_fdt(gd->dm_root, offset_to_ofnode(node),
-   )) {
-   ret = device_probe(dev);
-   if (ret)
-   return ret;
-   }
-   }
}
 
if (dev) {
-- 
2.1.4

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


[U-Boot] [PATCH v3 04/19] dm: core: add dev_read_addr_ptr()

2017-09-11 Thread Philipp Tomsich
The dev_read_addr_ptr() mimics the behaviour of the devfdt_get_addr_ptr(),
retrieving the first address of the node's reg-property and returning
it as a pointer (or NULL on failure).

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>

---

Changes in v3: None
Changes in v2:
- implements the dev_read_addr_ptr() function

 drivers/core/read.c |  7 +++
 include/dm/read.h   | 15 +++
 2 files changed, 22 insertions(+)

diff --git a/drivers/core/read.c b/drivers/core/read.c
index 6acb333..065589a 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -57,6 +57,13 @@ fdt_addr_t dev_read_addr(struct udevice *dev)
return dev_read_addr_index(dev, 0);
 }
 
+void *dev_read_addr_ptr(struct udevice *dev)
+{
+   fdt_addr_t addr = dev_read_addr(dev);
+
+   return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
+}
+
 fdt_addr_t dev_read_addr_size(struct udevice *dev, const char *property,
fdt_size_t *sizep)
 {
diff --git a/include/dm/read.h b/include/dm/read.h
index 49d69c9..e7f7125 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -113,6 +113,16 @@ fdt_addr_t dev_read_addr_index(struct udevice *dev, int 
index);
 fdt_addr_t dev_read_addr(struct udevice *dev);
 
 /**
+ * dev_read_addr_ptr() - Get the reg property of a device
+ *   as a pointer
+ *
+ * @dev: Device to read from
+ *
+ * @return pointer or NULL if not found
+ */
+void *dev_read_addr_ptr(struct udevice *dev);
+
+/**
  * dev_read_addr_size() - get address and size from a device property
  *
  * This does no address translation. It simply reads an property that contains
@@ -417,6 +427,11 @@ static inline fdt_addr_t dev_read_addr(struct udevice *dev)
return devfdt_get_addr(dev);
 }
 
+static inline void *dev_read_addr_ptr(struct udevice *dev)
+{
+   return devfdt_get_addr_ptr(dev);
+}
+
 static inline fdt_addr_t dev_read_addr_size(struct udevice *dev,
const char *propname,
fdt_size_t *sizep)
-- 
2.1.4

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


[U-Boot] [PATCH v3 07/19] rockchip: mmc: convert to livetree

2017-09-11 Thread Philipp Tomsich
Update the Rockchip-specific wrapper for the Designware driver to
support a live device tree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>

Version-changes: 2
- use the dev_read_addr_ptr function in rockchip_dw_mmc.c

---

Changes in v3: None
Changes in v2: None

 drivers/mmc/rockchip_dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c
index e7fcf89..807dc9e 100644
--- a/drivers/mmc/rockchip_dw_mmc.c
+++ b/drivers/mmc/rockchip_dw_mmc.c
@@ -58,7 +58,7 @@ static int rockchip_dwmmc_ofdata_to_platdata(struct udevice 
*dev)
struct dwmci_host *host = >host;
 
host->name = dev->name;
-   host->ioaddr = (void *)devfdt_get_addr(dev);
+   host->ioaddr = dev_read_addr_ptr(dev);
host->buswidth = dev_read_u32_default(dev, "bus-width", 4);
host->get_mmc_clk = rockchip_dwmmc_get_mmc_clk;
host->priv = dev;
-- 
2.1.4

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


[U-Boot] [PATCH v3 05/19] net: designware: Convert to livetree

2017-09-11 Thread Philipp Tomsich
Update the Designware Ethernet MAC driver to support a live device
tree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Acked-by: Joe Hershberger <joe.hershber...@ni.com>

---

Changes in v3:
- added Joe's Acked-by: tag (which I had lost)

Changes in v2: None

 drivers/net/designware.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 521e4dd..036d231 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -737,16 +737,14 @@ int designware_eth_ofdata_to_platdata(struct udevice *dev)
 #endif
struct eth_pdata *pdata = _pdata->eth_pdata;
const char *phy_mode;
-   const fdt32_t *cell;
 #ifdef CONFIG_DM_GPIO
int reset_flags = GPIOD_IS_OUT;
 #endif
int ret = 0;
 
-   pdata->iobase = devfdt_get_addr(dev);
+   pdata->iobase = dev_read_addr(dev);
pdata->phy_interface = -1;
-   phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode",
-  NULL);
+   phy_mode = dev_read_string(dev, "phy-mode");
if (phy_mode)
pdata->phy_interface = phy_get_interface_by_name(phy_mode);
if (pdata->phy_interface == -1) {
@@ -754,10 +752,7 @@ int designware_eth_ofdata_to_platdata(struct udevice *dev)
return -EINVAL;
}
 
-   pdata->max_speed = 0;
-   cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL);
-   if (cell)
-   pdata->max_speed = fdt32_to_cpu(*cell);
+   pdata->max_speed = dev_read_u32_default(dev, "max-speed", 0);
 
 #ifdef CONFIG_DM_GPIO
if (dev_read_bool(dev, "snps,reset-active-low"))
-- 
2.1.4

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


[U-Boot] [PATCH v3 09/19] rockchip: timer: Convert to livetree

2017-09-11 Thread Philipp Tomsich
Update the Rockchip timer driver to support a live device tree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>

---

Changes in v3: None
Changes in v2:
- use the new dev_read_addr_ptr() function
- improve error handling, in case dev_read_addr_ptr returns NULL

 drivers/timer/rockchip_timer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/timer/rockchip_timer.c b/drivers/timer/rockchip_timer.c
index b19aaed..07d1448 100644
--- a/drivers/timer/rockchip_timer.c
+++ b/drivers/timer/rockchip_timer.c
@@ -101,7 +101,9 @@ static int rockchip_clk_ofdata_to_platdata(struct udevice 
*dev)
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
struct rockchip_timer_priv *priv = dev_get_priv(dev);
 
-   priv->timer = (struct rk_timer *)devfdt_get_addr(dev);
+   priv->timer = dev_read_addr_ptr(dev);
+   if (!priv->timer)
+   return -ENOENT;
 #endif
 
return 0;
-- 
2.1.4

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


[U-Boot] [PATCH v3 12/19] rockchip: spi: Convert to livetree

2017-09-11 Thread Philipp Tomsich
Update the Rockchip SPI driver to support a live device tree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Reviewed-by: Jagan Teki <ja...@openedev.com>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>

---

Changes in v3:
- added Jagan's Reviewed-by: tag.

Changes in v2: None

 drivers/spi/rk_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/rk_spi.c b/drivers/spi/rk_spi.c
index c70d636..b18db74 100644
--- a/drivers/spi/rk_spi.c
+++ b/drivers/spi/rk_spi.c
@@ -184,7 +184,7 @@ static int rockchip_spi_ofdata_to_platdata(struct udevice 
*bus)
struct rockchip_spi_priv *priv = dev_get_priv(bus);
int ret;
 
-   plat->base = devfdt_get_addr(bus);
+   plat->base = dev_read_addr(bus);
 
ret = clk_get_by_index(bus, 0, >clk);
if (ret < 0) {
-- 
2.1.4

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


[U-Boot] [PATCH v3 14/19] rockchip: rk8xx: remove unused header includes

2017-09-11 Thread Philipp Tomsich
Remove header file includes that have been left over after the
conversion to livetree-support.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

Changes in v3: None
Changes in v2: None

 drivers/power/pmic/rk8xx.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c
index eb3ec0f..735046d 100644
--- a/drivers/power/pmic/rk8xx.c
+++ b/drivers/power/pmic/rk8xx.c
@@ -8,8 +8,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 
-- 
2.1.4

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


[U-Boot] [PATCH v3 11/19] rockchip: pinctrl: rk3368: Convert to livetree

2017-09-11 Thread Philipp Tomsich
Update the pinctrl driver for the RK3368 to support a live device tree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

Changes in v3: None
Changes in v2: None

 drivers/pinctrl/rockchip/pinctrl_rk3368.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3368.c 
b/drivers/pinctrl/rockchip/pinctrl_rk3368.c
index 81ce2e3..b1f5704 100644
--- a/drivers/pinctrl/rockchip/pinctrl_rk3368.c
+++ b/drivers/pinctrl/rockchip/pinctrl_rk3368.c
@@ -632,8 +632,7 @@ static int rk3368_pinctrl_get_periph_id(struct udevice *dev,
u32 cell[3];
int ret;
 
-   ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph),
-  "interrupts", cell, ARRAY_SIZE(cell));
+   ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell));
if (ret < 0)
return -EINVAL;
 
-- 
2.1.4

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


[U-Boot] [PATCH v3 19/19] rockchip: lion-rk3368: defconfig: resync w/ OF_LIVE and BOOTSTAGE enabled

2017-09-11 Thread Philipp Tomsich
This adds OF_LIVE and BOOTSTAGE support for the RK3368-uQ7 and
regenerates the defconfig (picking up a few changes/reorderings) from
upstream Kconfig changes.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

Changes in v3: None
Changes in v2: None

 configs/lion-rk3368_defconfig | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/configs/lion-rk3368_defconfig b/configs/lion-rk3368_defconfig
index 45a12a8..c7ee7b3 100644
--- a/configs/lion-rk3368_defconfig
+++ b/configs/lion-rk3368_defconfig
@@ -19,6 +19,11 @@ CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_SOURCE="board/theobroma-systems/lion_rk3368/fit_spl_atf.its"
+CONFIG_BOOTSTAGE=y
+CONFIG_SPL_BOOTSTAGE=y
+CONFIG_BOOTSTAGE_REPORT=y
+CONFIG_BOOTSTAGE_FDT=y
+CONFIG_ENV_IS_IN_MMC=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_ARCH_EARLY_INIT_R=y
 CONFIG_SPL=y
@@ -37,10 +42,12 @@ CONFIG_TPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
+CONFIG_CMD_BOOTSTAGE=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_TPL_OF_CONTROL=y
+CONFIG_OF_LIVE=y
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names interrupt-parent"
 CONFIG_TPL_OF_PLATDATA=y
 CONFIG_ENV_IS_IN_MMC=y
-- 
2.1.4

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


[U-Boot] [PATCH v3 03/19] dm: timer: handle being called before dm_root is ready

2017-09-11 Thread Philipp Tomsich
When used with bootstage recording, dm_timer_init may be called
surprisingly early: i.e. before dm_root is ready. To deal with
this case, we explicitly check for this condition and return
-EAGAIN to the caller (refer to drivers/timer/rockchip_timer.c
for a case where this is needed/used).

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

Changes in v3: None
Changes in v2: None

 drivers/timer/timer-uclass.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c
index 62d6f0b..45397b2 100644
--- a/drivers/timer/timer-uclass.c
+++ b/drivers/timer/timer-uclass.c
@@ -92,6 +92,13 @@ int notrace dm_timer_init(void)
if (gd->timer)
return 0;
 
+   /*
+* Directly access gd->dm_root to suppress error messages, if the
+* virtual root driver does not yet exist.
+*/
+   if (gd->dm_root == NULL)
+   return -EAGAIN;
+
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
/* Check for a chosen timer to be used for tick */
node = ofnode_get_chosen_node("tick-timer");
-- 
2.1.4

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


[U-Boot] [PATCH v3 06/19] net: phy: micrel: Convert to livetree

2017-09-11 Thread Philipp Tomsich
Update the Micrel KSZ90x1 driver for a live tree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Acked-by: Joe Hershberger <joe.hershber...@ni.com>

---

Changes in v3:
- added Joe's Acked-by: tag (which I had lost)

Changes in v2: None

 drivers/net/phy/micrel_ksz90x1.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/micrel_ksz90x1.c b/drivers/net/phy/micrel_ksz90x1.c
index 0bb99e6..b350a61 100644
--- a/drivers/net/phy/micrel_ksz90x1.c
+++ b/drivers/net/phy/micrel_ksz90x1.c
@@ -9,11 +9,11 @@
  * (C) Copyright 2017 Adaptrum, Inc.
  * Written by Alexandru Gagniuc <ale...@adaptrum.com> for Adaptrum, Inc.
  */
+
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -120,8 +120,7 @@ static int ksz90x1_of_config_group(struct phy_device 
*phydev,
return -EOPNOTSUPP;
 
for (i = 0; i < ofcfg->grpsz; i++) {
-   val[i] = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev),
-ofcfg->grp[i].name, -1);
+   val[i] = dev_read_u32_default(dev, ofcfg->grp[i].name, ~0);
offset = ofcfg->grp[i].off;
if (val[i] == -1) {
/* Default register value for KSZ9021 */
-- 
2.1.4

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


[U-Boot] [PATCH v3 01/19] bootstage: adjust Makefile to allow including bootstage in SPL, but not in TPL

2017-09-11 Thread Philipp Tomsich
For timing our bootstages on the RK3368, which has a minimal TPL
(and where we consequently don't want to time the bootstages) and a
full-featured SPL (where we can bootstage recording), we need to
adjust the Makefile.

Use the $(SPL_TPL_) macro in the Makefile for bootstage.o

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

Changes in v3: None
Changes in v2: None

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

diff --git a/common/Makefile b/common/Makefile
index 1b56cf9..801ea31 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -63,7 +63,7 @@ obj-$(CONFIG_CMDLINE) += cli_readline.o cli_simple.o
 
 endif # !CONFIG_SPL_BUILD
 
-obj-$(CONFIG_$(SPL_)BOOTSTAGE) += bootstage.o
+obj-$(CONFIG_$(SPL_TPL_)BOOTSTAGE) += bootstage.o
 
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_DFU_SUPPORT) += dfu.o
-- 
2.1.4

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


[U-Boot] [PATCH v3 13/19] rockchip: sdhci: Convert to livetree

2017-09-11 Thread Philipp Tomsich
Update the Rockchip SDHCI wrapper to support a live device tree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>

Version-changes: 2
- use the dev_read_addr_ptr function in rockchip_sdhci.c

---

Changes in v3: None
Changes in v2: None

 drivers/mmc/rockchip_sdhci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c
index f31d329..346a42c 100644
--- a/drivers/mmc/rockchip_sdhci.c
+++ b/drivers/mmc/rockchip_sdhci.c
@@ -9,7 +9,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -82,7 +81,7 @@ static int arasan_sdhci_ofdata_to_platdata(struct udevice 
*dev)
struct sdhci_host *host = dev_get_priv(dev);
 
host->name = dev->name;
-   host->ioaddr = devfdt_get_addr_ptr(dev);
+   host->ioaddr = dev_read_addr_ptr(dev);
 #endif
 
return 0;
-- 
2.1.4

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


[U-Boot] [PATCH v3 18/19] rockchip: dts: rk3368-lion: add /chosen/tick-timer

2017-09-11 Thread Philipp Tomsich
To support bootstage recording, we want to mark our DM timer as the
tick-timer; this triggers the support for 'trying harder' to read the
timer in the Rockchip DM timer driver, even if the device model isn't
ready yet.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

Changes in v3: None
Changes in v2: None

 arch/arm/dts/rk3368-lion-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/dts/rk3368-lion-u-boot.dtsi 
b/arch/arm/dts/rk3368-lion-u-boot.dtsi
index dbf614c..a9b7f81 100644
--- a/arch/arm/dts/rk3368-lion-u-boot.dtsi
+++ b/arch/arm/dts/rk3368-lion-u-boot.dtsi
@@ -13,6 +13,7 @@
chosen {
stdout-path = "serial0:115200n8";
u-boot,spl-boot-order = , 
+   tick-timer = "/timer@ff81";
};
 
 };
@@ -88,6 +89,7 @@
  {
u-boot,dm-pre-reloc;
clock-frequency = <2400>;
+   status = "okay";
 };
 
 
-- 
2.1.4

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


[U-Boot] [PATCH v3 10/19] rockchip: clk: rk3368: Convert to livetree

2017-09-11 Thread Philipp Tomsich
Update the clock driver for the RK3368 to support a live device tree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>

Version-changes: 2
- use the dev_read_addr_ptr function in clk_rk3368.c

---

Changes in v3: None
Changes in v2: None

 drivers/clk/rockchip/clk_rk3368.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk_rk3368.c 
b/drivers/clk/rockchip/clk_rk3368.c
index 0160d50..e274781 100644
--- a/drivers/clk/rockchip/clk_rk3368.c
+++ b/drivers/clk/rockchip/clk_rk3368.c
@@ -485,7 +485,7 @@ static int rk3368_clk_ofdata_to_platdata(struct udevice 
*dev)
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
struct rk3368_clk_priv *priv = dev_get_priv(dev);
 
-   priv->cru = (struct rk3368_cru *)devfdt_get_addr(dev);
+   priv->cru = dev_read_addr_ptr(dev);
 #endif
 
return 0;
-- 
2.1.4

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


[U-Boot] [PATCH v3 15/19] rockchip: i2c: Convert to livetree

2017-09-11 Thread Philipp Tomsich
Update the Rockchip I2C driver to support livetree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Acked-by: Heiko Schocher <h...@denx.de>

---

Changes in v3:
- added Heiko's Acked-by: tag.

Changes in v2:
- use the dev_read_addr_ptr function in rk_i2c.c

 drivers/i2c/rk_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/rk_i2c.c b/drivers/i2c/rk_i2c.c
index 68e6653..840b3f6 100644
--- a/drivers/i2c/rk_i2c.c
+++ b/drivers/i2c/rk_i2c.c
@@ -382,7 +382,7 @@ static int rockchip_i2c_probe(struct udevice *bus)
 {
struct rk_i2c *priv = dev_get_priv(bus);
 
-   priv->regs = (void *)devfdt_get_addr(bus);
+   priv->regs = dev_read_addr_ptr(bus);
 
return 0;
 }
-- 
2.1.4

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


[U-Boot] [PATCH v3 17/19] rockchip: gpio: remove outdated/misleading comment

2017-09-11 Thread Philipp Tomsich
Remove a comment claiming that this driver only supports the RK3288,
as we also use it on the RK3368, RK3399 and (most likely) on other
variants.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>

Version-changes: 2
- use the dev_read_addr_ptr function in rk_gpio.c

---

Changes in v3: None
Changes in v2: None

 drivers/gpio/rk_gpio.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpio/rk_gpio.c b/drivers/gpio/rk_gpio.c
index a6b83b2..11fc3e2 100644
--- a/drivers/gpio/rk_gpio.c
+++ b/drivers/gpio/rk_gpio.c
@@ -103,7 +103,6 @@ static int rockchip_gpio_probe(struct udevice *dev)
char *end;
int ret;
 
-   /* This only supports RK3288 at present */
priv->regs = dev_read_addr_ptr(dev);
ret = uclass_first_device_err(UCLASS_PINCTRL, >pinctrl);
if (ret)
-- 
2.1.4

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


Re: [U-Boot] [U-Boot,3/3] rk3288: spl: Add dram_init_banksize

2017-09-11 Thread Philipp Tomsich
> From: Jagan Teki <ja...@amarulasolutions.com>
> 
> Falcon mode, is updating DDR dt node configuration through
> spl_fixup_fdt() so add appropriate DDR base and size through
> dram_init_banksize.
> 
> Signed-off-by: Jagan Teki <ja...@amarulasolutions.com>
> ---
>  arch/arm/mach-rockchip/rk3288-board-spl.c | 17 +
>  1 file changed, 17 insertions(+)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,2/3] rk3288: vyasa: Add falcon mode support

2017-09-11 Thread Philipp Tomsich
> From: Jagan Teki <ja...@amarulasolutions.com>
> 
> Add Falcon mode support in vyasa rk3288 board.
> 
> Signed-off-by: Jagan Teki <ja...@amarulasolutions.com>
> ---
>  board/amarula/vyasa-rk3288/vyasa-rk3288.c | 13 +
>  include/configs/vyasa-rk3288.h| 17 +
>  2 files changed, 30 insertions(+)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v3] rk3288: Add Vyasa initial board support

2017-09-11 Thread Philipp Tomsich
> From: Jagan Teki <ja...@amarulasolutions.com>
> 
> This patch adds support for Vyasa RK3288 initial board
> from Amarula Solutions.
> 
> Boot from SDMMC:
> ---
> U-Boot SPL 2017.09-rc1-00111-g3656991-dirty (Aug 10 2017 - 11:40:45)
> Trying to boot from MMC1
> 
> U-Boot 2017.09-rc1-00111-g3656991-dirty (Aug 10 2017 - 11:40:45 +0530)
> 
> Model: Amarula Vyasa-RK3288
> DRAM:  2 GiB
> MMC:   dwmmc@ff0c: 1
> *** Warning - bad CRC, using default environment
> 
> In:serial@ff69
> Out:   serial@ff69
> Err:   serial@ff69
> Model: Amarula Vyasa-RK3288
> Net:   Net Initialization Skipped
> No ethernet found.
> Hit any key to stop autoboot:  0
> =>
> 
> Reviewed-by: Simon Glass <s...@chromium.org>
> Signed-off-by: Jagan Teki <ja...@amarulasolutions.com>
> ---
> Changes for v3:
> - Remove CONFIG_ENV_IS_IN_MMC from include file
> - Update commit message with company name
> - Fix proper board name on MAINTAINERS file
> Changes for v2:
> - Fix commit message
> - Move CONFIG_ENV_IS_IN_MMC to configs
> 
>  arch/arm/dts/Makefile |   1 +
>  arch/arm/dts/rk3288-vyasa.dts | 327 
> ++
>  arch/arm/mach-rockchip/rk3288/Kconfig |  11 +
>  board/amarula/vyasa-rk3288/Kconfig|  12 ++
>  board/amarula/vyasa-rk3288/MAINTAINERS|   6 +
>  board/amarula/vyasa-rk3288/Makefile   |   7 +
>  board/amarula/vyasa-rk3288/vyasa-rk3288.c |   7 +
>  configs/vyasa-rk3288_defconfig|  63 ++
>  include/configs/vyasa-rk3288.h|  22 ++
>  9 files changed, 456 insertions(+)
>  create mode 100644 arch/arm/dts/rk3288-vyasa.dts
>  create mode 100644 board/amarula/vyasa-rk3288/Kconfig
>  create mode 100644 board/amarula/vyasa-rk3288/MAINTAINERS
>  create mode 100644 board/amarula/vyasa-rk3288/Makefile
>  create mode 100644 board/amarula/vyasa-rk3288/vyasa-rk3288.c
>  create mode 100644 configs/vyasa-rk3288_defconfig
>  create mode 100644 include/configs/vyasa-rk3288.h
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 1/2] rockchip: board: lion_rk3368: update README flash instructions

2017-09-11 Thread Philipp Tomsich
> Add a section to the README on how to flash the on-board eMMC
> with the rkdeveloptool.
> 
> Signed-off-by: Klaus Goger <klaus.go...@theobroma-systems.com>
> Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
> Changes in v2: None
> 
>  board/theobroma-systems/lion_rk3368/README | 24 ++--
>  1 file changed, 22 insertions(+), 2 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 1/2] rockchip: board: lion_rk3368: update README flash instructions

2017-09-11 Thread Philipp Tomsich
> Add a section to the README on how to flash the on-board eMMC
> with the rkdeveloptool.
> 
> Signed-off-by: Klaus Goger <klaus.go...@theobroma-systems.com>
> Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
> Changes in v2: None
> 
>  board/theobroma-systems/lion_rk3368/README | 24 ++--
>  1 file changed, 22 insertions(+), 2 deletions(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 2/2] rockchip: board: puma_rk3399: update README flash instructions

2017-09-11 Thread Philipp Tomsich
> Puma supports other boot sources then SD-Card. Update README to include
> the required steps.
> 
>  * how to package a SPI-NOR SPL
>  * how to flash eMMC with rkdeveloptool
> 
> Signed-off-by: Klaus Goger <klaus.go...@theobroma-systems.com>
> Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
> Changes in v2:
> - add missing ./configure step while building rkdeveloptool
> 
>  board/theobroma-systems/puma_rk3399/README | 51 
> +-
>  1 file changed, 43 insertions(+), 8 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 2/2] rockchip: board: puma_rk3399: update README flash instructions

2017-09-11 Thread Philipp Tomsich
> Puma supports other boot sources then SD-Card. Update README to include
> the required steps.
> 
>  * how to package a SPI-NOR SPL
>  * how to flash eMMC with rkdeveloptool
> 
> Signed-off-by: Klaus Goger <klaus.go...@theobroma-systems.com>
> Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
> Changes in v2:
> - add missing ./configure step while building rkdeveloptool
> 
>  board/theobroma-systems/puma_rk3399/README | 51 
> +-
>  1 file changed, 43 insertions(+), 8 deletions(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,3/3] rk3288: spl: Add dram_init_banksize

2017-09-11 Thread Philipp Tomsich
> From: Jagan Teki <ja...@amarulasolutions.com>
> 
> Falcon mode, is updating DDR dt node configuration through
> spl_fixup_fdt() so add appropriate DDR base and size through
> dram_init_banksize.
> 
> Signed-off-by: Jagan Teki <ja...@amarulasolutions.com>
> Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
>  arch/arm/mach-rockchip/rk3288-board-spl.c | 17 +
>  1 file changed, 17 insertions(+)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v3] rk3288: Add Vyasa initial board support

2017-09-11 Thread Philipp Tomsich
> From: Jagan Teki <ja...@amarulasolutions.com>
> 
> This patch adds support for Vyasa RK3288 initial board
> from Amarula Solutions.
> 
> Boot from SDMMC:
> ---
> U-Boot SPL 2017.09-rc1-00111-g3656991-dirty (Aug 10 2017 - 11:40:45)
> Trying to boot from MMC1
> 
> U-Boot 2017.09-rc1-00111-g3656991-dirty (Aug 10 2017 - 11:40:45 +0530)
> 
> Model: Amarula Vyasa-RK3288
> DRAM:  2 GiB
> MMC:   dwmmc@ff0c: 1
> *** Warning - bad CRC, using default environment
> 
> In:serial@ff69
> Out:   serial@ff69
> Err:   serial@ff69
> Model: Amarula Vyasa-RK3288
> Net:   Net Initialization Skipped
> No ethernet found.
> Hit any key to stop autoboot:  0
> =>
> 
> Reviewed-by: Simon Glass <s...@chromium.org>
> Signed-off-by: Jagan Teki <ja...@amarulasolutions.com>
> Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> Changes for v3:
> - Remove CONFIG_ENV_IS_IN_MMC from include file
> - Update commit message with company name
> - Fix proper board name on MAINTAINERS file
> Changes for v2:
> - Fix commit message
> - Move CONFIG_ENV_IS_IN_MMC to configs
> 
>  arch/arm/dts/Makefile |   1 +
>  arch/arm/dts/rk3288-vyasa.dts | 327 
> ++
>  arch/arm/mach-rockchip/rk3288/Kconfig |  11 +
>  board/amarula/vyasa-rk3288/Kconfig|  12 ++
>  board/amarula/vyasa-rk3288/MAINTAINERS|   6 +
>  board/amarula/vyasa-rk3288/Makefile   |   7 +
>  board/amarula/vyasa-rk3288/vyasa-rk3288.c |   7 +
>  configs/vyasa-rk3288_defconfig|  63 ++
>  include/configs/vyasa-rk3288.h|  22 ++
>  9 files changed, 456 insertions(+)
>  create mode 100644 arch/arm/dts/rk3288-vyasa.dts
>  create mode 100644 board/amarula/vyasa-rk3288/Kconfig
>  create mode 100644 board/amarula/vyasa-rk3288/MAINTAINERS
>  create mode 100644 board/amarula/vyasa-rk3288/Makefile
>  create mode 100644 board/amarula/vyasa-rk3288/vyasa-rk3288.c
>  create mode 100644 configs/vyasa-rk3288_defconfig
>  create mode 100644 include/configs/vyasa-rk3288.h
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,2/3] rk3288: vyasa: Add falcon mode support

2017-09-11 Thread Philipp Tomsich
> From: Jagan Teki <ja...@amarulasolutions.com>
> 
> Add Falcon mode support in vyasa rk3288 board.
> 
> Signed-off-by: Jagan Teki <ja...@amarulasolutions.com>
> Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
>  board/amarula/vyasa-rk3288/vyasa-rk3288.c | 13 +
>  include/configs/vyasa-rk3288.h| 17 +
>  2 files changed, 30 insertions(+)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,V9,1/4] usb: rockchip: add the rockusb gadget

2017-09-11 Thread Philipp Tomsich
> this patch implement rockusb protocol on the device side. this is based on USB
> download gadget infrastructure. the rockusb function implements the rd, wl, 
> rid
> commands. it can work with rkdeveloptool
> 
> Signed-off-by: Eddie Cai <eddie.cai.li...@gmail.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> 
> Changes in v9:
>   
> -fix compile error
> 
> Changes in v8:
>   
> -none
> 
> Changes in v7:
> -none
> 
> Changes in v6:
> -move some data to f_rockusb structure
> 
> Changes in v5:
> -fix build error when build non-rockchip board
> -fix checkpatch error
> 
> Changes in v4:
> -use enum instead of macro define
> -move some structure define and macro to f_rockusb.h
> -add some function comment as Simon required
> -address other comment from Simon
> -fix build error as Lukasz point out
> ---
>  arch/arm/include/asm/arch-rockchip/f_rockusb.h | 132 +
>  drivers/usb/gadget/Kconfig |   8 +
>  drivers/usb/gadget/Makefile|   1 +
>  drivers/usb/gadget/f_rockusb.c | 691 
> +
>  4 files changed, 832 insertions(+)
>  create mode 100644 arch/arm/include/asm/arch-rockchip/f_rockusb.h
>  create mode 100644 drivers/usb/gadget/f_rockusb.c
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, V9, 3/4] rockchip:usb: add a simple readme for rockusb

2017-09-11 Thread Philipp Tomsich
> add a simple readme to introduce rockusb and tell people how to use it
> 
> Signed-off-by: Eddie Cai <eddie.cai.li...@gmail.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> 
> Changes in v9:
>   
> -none
> 
> Changes in v8:
>   
> -none
> 
> Changes in v7:
> -none
> 
> Changes in v6:
> -none
> 
> Changes in v5:
> -none
> 
> Changes in v4:
> -add some blank line to make it look better
> 
> Changes in v3:
> -fix checkpatch error
> ---
>  doc/README.rockusb | 51 +++
>  1 file changed, 51 insertions(+)
>  create mode 100644 doc/README.rockusb
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,V9,2/4] usb: rockchip: add rockusb command

2017-09-11 Thread Philipp Tomsich
> this patch add rockusb command. the usage is
> rockusb   <dev[:part]>
> e.g. rockusb 0 mmc 0
> 
> Signed-off-by: Eddie Cai <eddie.cai.li...@gmail.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> 
> Changes in v9:
>   
> -none
> 
> Changes in v8:
>   
> -none
> 
> Changes in v7:
> -none
> 
> Changes in v6:
> -none
> 
> Changes in v5:
> -none
> 
> Changes in v4:
> -move USB_FUNCTION_ROCKUSB to drivers/usb/gadget/Kconfig
> -modify the dependence
> 
> Changes in v3:
> -fix comment from Simon and Lukasz
> -fix checkpactch error
> ---
>  cmd/Kconfig   |  9 
>  cmd/Makefile  |  1 +
>  cmd/rockusb.c | 74 
> +++++++++++
>  3 files changed, 84 insertions(+)
>  create mode 100644 cmd/rockusb.c
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 08/19] rockchip: timer: implement timer_get_boot_us

2017-09-11 Thread Philipp Tomsich
To make the Rockchip DM timer driver useful for the timing of
bootstages, we need a few enhancements:
 - This implements timer_get_boot_us.
 - This avoids reinitialising the timer, if it has already been
   set up (e.g. by our TPL and SPL stages). Now, we have a single
   timebase ticking from TPL through the full U-Boot.
 - This adds support for reading the timer even before the
   device-model is ready: we find the timer via /chosen/tick-timer,
   then read its address and clock-frequency, and finally read the
   timeval directly).

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

Changes in v3: None
Changes in v2: None

 drivers/timer/rockchip_timer.c | 72 +++---
 1 file changed, 67 insertions(+), 5 deletions(-)

diff --git a/drivers/timer/rockchip_timer.c b/drivers/timer/rockchip_timer.c
index cd349ca..b19aaed 100644
--- a/drivers/timer/rockchip_timer.c
+++ b/drivers/timer/rockchip_timer.c
@@ -6,6 +6,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -25,17 +26,72 @@ struct rockchip_timer_priv {
struct rk_timer *timer;
 };
 
-static int rockchip_timer_get_count(struct udevice *dev, u64 *count)
+static inline int64_t rockchip_timer_get_curr_value(struct rk_timer *timer)
 {
-   struct rockchip_timer_priv *priv = dev_get_priv(dev);
uint64_t timebase_h, timebase_l;
uint64_t cntr;
 
-   timebase_l = readl(>timer->timer_curr_value0);
-   timebase_h = readl(>timer->timer_curr_value1);
+   timebase_l = readl(>timer_curr_value0);
+   timebase_h = readl(>timer_curr_value1);
 
-   /* timers are down-counting */
cntr = timebase_h << 32 | timebase_l;
+   return cntr;
+}
+
+#if CONFIG_IS_ENABLED(BOOTSTAGE)
+ulong timer_get_boot_us(void)
+{
+   uint64_t  ticks = 0;
+   uint32_t  rate;
+   uint64_t  us;
+   int ret;
+
+   ret = dm_timer_init();
+
+   if (!ret) {
+   /* The timer is available */
+   rate = timer_get_rate(gd->timer);
+   timer_get_count(gd->timer, );
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
+   } else if (ret == -EAGAIN) {
+   /* We have been called so early that the DM is not ready,... */
+   ofnode node = offset_to_ofnode(-1);
+   struct rk_timer *timer = NULL;
+
+   /*
+* ... so we try to access the raw timer, if it is specified
+* via the tick-timer property in /chosen.
+*/
+   node = ofnode_get_chosen_node("tick-timer");
+   if (!ofnode_valid(node)) {
+   debug("%s: no /chosen/tick-timer\n", __func__);
+   return 0;
+   }
+
+   timer = (struct rk_timer *)ofnode_get_addr(node);
+
+   /* This timer is down-counting */
+   ticks = ~0uLL - rockchip_timer_get_curr_value(timer);
+   if (ofnode_read_u32(node, "clock-frequency", )) {
+   debug("%s: could not read clock-frequency\n", __func__);
+   return 0;
+   }
+#endif
+   } else {
+   return 0;
+   }
+
+   us = (ticks * 1000) / rate;
+   return us;
+}
+#endif
+
+static int rockchip_timer_get_count(struct udevice *dev, u64 *count)
+{
+   struct rockchip_timer_priv *priv = dev_get_priv(dev);
+   uint64_t cntr = rockchip_timer_get_curr_value(priv->timer);
+
+   /* timers are down-counting */
*count = ~0ull - cntr;
return 0;
 }
@@ -58,6 +114,12 @@ static int rockchip_timer_start(struct udevice *dev)
const uint32_t reload_val_l = reload_val & 0x;
const uint32_t reload_val_h = reload_val >> 32;
 
+   /* don't reinit, if the timer is already running and set up */
+   if ((readl(>timer->timer_ctrl_reg) & 1) == 1 &&
+   (readl(>timer->timer_load_count0) == reload_val_l) &&
+   (readl(>timer->timer_load_count1) == reload_val_h))
+   return 0;
+
/* disable timer and reset all control */
writel(0, >timer->timer_ctrl_reg);
/* write reload value */
-- 
2.1.4

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


Re: [U-Boot] [U-Boot,1/3] rk3288: vyasa: Add TPL support

2017-09-11 Thread Philipp Tomsich



On Mon, 28 Aug 2017, Jagan Teki wrote:


From: Jagan Teki <ja...@amarulasolutions.com>

Since the size of SPL can't be exceeded 0x8000 bytes in RK3288,

  ^^^

it is not possible add new SPL features like Falcon mode or etc.

So add TPL stage so-that adding new features to SPL is possible.
- TPL: DRAM init, clocks
- SPL: MMC, falcon, etc

Booting from SD with TPL:

U-Boot TPL 2017.09-rc2-13369-gfa72baf-dirty (Aug 26 2017 - 15:48:54)
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2017.09-rc2-13369-gfa72baf-dirty (Aug 26 2017 - 15:48:54)
Trying to boot from MMC1

U-Boot 2017.09-rc2-13369-gfa72baf-dirty (Aug 26 2017 - 15:48:54 +0530)

Model: Amarula Vyasa-RK3288
DRAM:  2 GiB
MMC:   dwmmc@ff0c: 1
Using default environment

In:serial@ff69
Out:   serial@ff69
Err:   serial@ff69
Model: Amarula Vyasa-RK3288
Net:   Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot:  0
=>


I think the console output does not provide any useful info as part of
the commit message.



Signed-off-by: Jagan Teki <ja...@amarulasolutions.com>


Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>


---
Note:
Right now TPL added in vyasa board, ie reason some clock code
is duplicate in SPL and TPL. Once all rk3288 agree the will remove
duplicates.

arch/arm/mach-rockchip/Makefile   |   1 +
arch/arm/mach-rockchip/rk3288-board-spl.c |   3 +
arch/arm/mach-rockchip/rk3288-board-tpl.c | 124 ++
arch/arm/mach-rockchip/rk3288/Kconfig |  15 
configs/vyasa-rk3288_defconfig|   2 +
doc/README.rockchip   |  18 +
include/configs/rk3288_common.h   |   8 +-
7 files changed, 170 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/mach-rockchip/rk3288-board-tpl.c

diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index 79e9704..daafc8d 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -12,6 +12,7 @@ obj-spl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o 
save_boot_param.o
obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o save_boot_param.o

obj-tpl-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board-tpl.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
diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c 
b/arch/arm/mach-rockchip/rk3288-board-spl.c
index 6b7bf85..febc1ef 100644
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
@@ -243,12 +243,15 @@ void board_init_f(ulong dummy)
}
#endif

+#if !defined(CONFIG_SUPPORT_TPL)


Should this be CONFIG_TPL_BUILD?


debug("\nspl:init dram\n");
ret = uclass_get_device(UCLASS_RAM, 0, );
if (ret) {
debug("DRAM init failed: %d\n", ret);
return;
}
+#endif
+
#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
back_to_bootrom();
#endif


Could this be done using BOOT_DEVICE_BOOTROM?


diff --git a/arch/arm/mach-rockchip/rk3288-board-tpl.c 
b/arch/arm/mach-rockchip/rk3288-board-tpl.c
new file mode 100644
index 000..7a7fd05
--- /dev/null
+++ b/arch/arm/mach-rockchip/rk3288-board-tpl.c
@@ -0,0 +1,124 @@
+/*
+ * (C) Copyright 2015 Google, Inc


Are you sure?


+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* read L2 control register (L2CTLR) */
+static inline uint32_t read_l2ctlr(void)


Could this be shared between rk3288-board-spl.c and rk3288-board-tpl.c?
I am not particularily keen on duplicating code.

An even better idea: can this mave a armv7-wide function that can be 
shared across all cores that need to read/write the L2CTRL in p15?

I've found the same inline assemly in a few other places...


+{
+   uint32_t val = 0;
+
+   asm volatile ("mrc p15, 1, %0, c9, c0, 2" : "=r" (val));
+
+   return val;
+}
+
+/* write L2 control register (L2CTLR) */
+static inline void write_l2ctlr(uint32_t val)


Same as above.


+{
+   /*
+* Note: L2CTLR can only be written when the L2 memory system
+* is idle, ie before the MMU is enabled.
+*/
+   asm volatile("mcr p15, 1, %0, c9, c0, 2" : : "r" (val) : "memory");
+   isb();
+}
+
+static void configure_l2ctlr(void)
+{
+   uint32_t l2ctlr;
+
+   l2ctlr = read_l2ctlr();
+   l2ctlr &= 0xfffc; /* clear bit0~bit17 */
+
+   /*
+   * Data RAM write latency: 2 cycles
+   * Data RAM read latency: 2 cycles
+   * Data RAM setup latency: 1 cycle
+   * Tag RAM write latency: 1 cycle
+  

[U-Boot] [PATCH v3 16/19] rockchip: gpio: convert to livetree

2017-09-11 Thread Philipp Tomsich
Update the Rockchip GPIO-bank driver to support a live tree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>

Version-changes: 2
- use the dev_read_addr_ptr function in rk_gpio.c

---

Changes in v3: None
Changes in v2: None

 drivers/gpio/rk_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/rk_gpio.c b/drivers/gpio/rk_gpio.c
index 6f7366a..a6b83b2 100644
--- a/drivers/gpio/rk_gpio.c
+++ b/drivers/gpio/rk_gpio.c
@@ -104,7 +104,7 @@ static int rockchip_gpio_probe(struct udevice *dev)
int ret;
 
/* This only supports RK3288 at present */
-   priv->regs = (struct rockchip_gpio_regs *)devfdt_get_addr(dev);
+   priv->regs = dev_read_addr_ptr(dev);
ret = uclass_first_device_err(UCLASS_PINCTRL, >pinctrl);
if (ret)
return ret;
-- 
2.1.4

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


Re: [U-Boot] [U-Boot, 2/2] rockchip: rk3368: add the missing target and pinctrl config for sheep board

2017-09-12 Thread Philipp Tomsich
> Add the missing target and pinctrl config for rk3368 sheep board
> 
> Signed-off-by: Andy Yan <andy@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  configs/sheep-rk3368_defconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 

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


[U-Boot] [RESEND PATCH 1/2] rockchip: clk: rk3399: add clk_enable function and support USB HOST0/1

2017-09-12 Thread Philipp Tomsich
The generic ehci-driver (ehci-generic.c) will try to enable the clocks
listed in the DTSI. If this fails (e.g. due to clk_enable not being
implemented in a driver and -ENOSYS being returned by the clk-uclass),
the driver will bail our and print an error message.

This implements a minimal clk_enable for the RK3399 and supports the
clocks mandatory for the EHCI controllers; as these are enabled by
default we simply return success.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 drivers/clk/rockchip/clk_rk3399.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/drivers/clk/rockchip/clk_rk3399.c 
b/drivers/clk/rockchip/clk_rk3399.c
index 04f0b3f..a2a1607 100644
--- a/drivers/clk/rockchip/clk_rk3399.c
+++ b/drivers/clk/rockchip/clk_rk3399.c
@@ -950,9 +950,24 @@ static ulong rk3399_clk_set_rate(struct clk *clk, ulong 
rate)
return ret;
 }
 
+static int rk3399_clk_enable(struct clk *clk)
+{
+   switch (clk->id) {
+   case HCLK_HOST0:
+   case HCLK_HOST0_ARB:
+   case HCLK_HOST1:
+   case HCLK_HOST1_ARB:
+   return 0;
+   }
+
+   debug("%s: unsupported clk %ld\n", __func__, clk->id);
+   return -ENOENT;
+}
+
 static struct clk_ops rk3399_clk_ops = {
.get_rate = rk3399_clk_get_rate,
.set_rate = rk3399_clk_set_rate,
+   .enable = rk3399_clk_enable,
 };
 
 static int rk3399_clk_probe(struct udevice *dev)
-- 
2.1.4

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


[U-Boot] [RESEND PATCH 0/2] rockchip: rk3399-puma: migrate from 'rockchip, vbus-gpio' to a fixed regulator

2017-09-12 Thread Philipp Tomsich

On recent bootloader versions, the USB hub on the RK3399-Q7 was never
brought out of reset, due to the 'rockchip,vbus-gpio' property not
being supported any longer (since 26a8b80).

This series rectifies the situation by using a fixed regulator in the
device tree to turn the USB hub on.


Philipp Tomsich (2):
  rockchip: clk: rk3399: add clk_enable function and support USB HOST0/1
  rockchip: dts: rk3399-puma: replace 'rockchip,vbus-gpio' with fixed
regulator

 arch/arm/dts/rk3399-puma.dtsi | 12 +++-
 drivers/clk/rockchip/clk_rk3399.c | 15 +++
 2 files changed, 26 insertions(+), 1 deletion(-)

-- 
2.1.4

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


[U-Boot] [RESEND PATCH 0/6] rockchip: enable live tree on the RK3399 and validate on the RK3399-Q7

2017-09-12 Thread Philipp Tomsich

This series repeats the same exercise as for the RK3368 and adapts any
lingering dependencies necessary to move the RK3399-based boards over
to use a live tree.  Validated on the RK3399-Q7 (Puma).

Resent, due to an apparent patchworks hick-up yesterday that "ate my series".


Philipp Tomsich (6):
  rockchip: clk: rk3399: Convert to livetree
  rockchip: xhci: Convert to livetree
  rockchip: efuse: change to use dev_read_addr_ptr
  usb: dwc2: convert to livetree
  usb: host: ehci-generic: convert to livetree
  rockchip: defconfig: puma-rk3399: enable OF_LIVE (live tree)

 configs/puma-rk3399_defconfig | 1 +
 drivers/clk/rockchip/clk_rk3399.c | 4 ++--
 drivers/misc/rockchip-efuse.c | 2 +-
 drivers/usb/host/dwc2.c   | 2 +-
 drivers/usb/host/ehci-generic.c   | 2 +-
 drivers/usb/host/xhci-rockchip.c  | 4 +---
 6 files changed, 7 insertions(+), 8 deletions(-)

-- 
2.1.4

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


[U-Boot] [RESEND PATCH 5/6] usb: host: ehci-generic: convert to livetree

2017-09-12 Thread Philipp Tomsich
Update the generic EHCI driver to support a live tree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 drivers/usb/host/ehci-generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
index 03f8d32..18e1e0e 100644
--- a/drivers/usb/host/ehci-generic.c
+++ b/drivers/usb/host/ehci-generic.c
@@ -108,7 +108,7 @@ static int ehci_usb_probe(struct udevice *dev)
}
}
 
-   hccr = map_physmem(devfdt_get_addr(dev), 0x100, MAP_NOCACHE);
+   hccr = map_physmem(dev_read_addr(dev), 0x100, MAP_NOCACHE);
hcor = (struct ehci_hcor *)((uintptr_t)hccr +
HC_LENGTH(ehci_readl(>cr_capbase)));
 
-- 
2.1.4

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


[U-Boot] [RESEND PATCH 08/10] rockchip: rk3399-puma: add boot-on regulator to override BIOS_DISABLE

2017-09-12 Thread Philipp Tomsich
The (Qseven) BIOS_DISABLE signal on the RK3399-Q7 (Puma) keeps the
eMMC and SPI in reset initially and we need to write a GPIO to turn
them on before continuing the boot-up.

This adds the DTS entries for the additional regulator and makes
pinctrl and gpio3 available during SPL.  It also adds a hook to the
spl_board_init() to ensure that the regulator gets probed and enabled.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 arch/arm/dts/rk3399-puma.dtsi | 23 +++
 board/theobroma-systems/puma_rk3399/puma-rk3399.c | 10 ++
 2 files changed, 33 insertions(+)

diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi
index edb9424..85e00ec 100644
--- a/arch/arm/dts/rk3399-puma.dtsi
+++ b/arch/arm/dts/rk3399-puma.dtsi
@@ -90,6 +90,24 @@
};
};
 
+   /*
+* The Qseven BIOS_DISABLE signal on the RK3399-Q7 keeps the on-module
+* eMMC and SPI flash powered-down initially (in fact it keeps the
+* reset signal asserted).  Even though it is an enable signal, we
+* model this as a regulator.
+*/
+   bios_enable: bios_enable {
+   compatible = "regulator-fixed";
+   u-boot,dm-pre-reloc;
+   regulator-name = "bios_enable";
+   enable-active-low;
+   gpio = < 29 GPIO_ACTIVE_HIGH>;
+   regulator-always-on;
+   regulator-boot-on;
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   };
+
vccadc_ref: vccadc-ref {
compatible = "regulator-fixed";
regulator-name = "vcc1v8_sys";
@@ -523,10 +541,15 @@
status = "okay";
 };
 
+ {
+   u-boot,dm-pre-reloc;
+};
+
  {
/* Pins that are not explicitely used by any devices */
pinctrl-names = "default";
pinctrl-0 = <_pin_hog>;
+
hog {
puma_pin_hog: puma_pin_hog {
rockchip,pins =
diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c 
b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
index cc572b5..b49fa66 100644
--- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
+++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
@@ -34,6 +34,16 @@ int board_init(void)
 
 void spl_board_init(void)
 {
+   int  ret;
+
+   /*
+* Turning the eMMC and SPI back on (if disabled via the Qseven
+* BIOS_ENABLE) signal is done through a always-on regulator).
+*/
+   ret = regulators_enable_boot_on(false);
+   if (ret)
+   debug("%s: Cannot enable boot on regulator\n", __func__);
+
preloader_console_init();
return;
 }
-- 
2.1.4

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


[U-Boot] [RESEND PATCH 09/10] power: spl: add SPL_DM_REGULATOR_FIXED in Kconfig

2017-09-12 Thread Philipp Tomsich
The Makefile already tests for SPL_DM_REGULATOR_FIXED, but Kconfig
does not provide it.  This adds SPL_DM_REGULATOR_FIXED to Kconfig.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 drivers/power/regulator/Kconfig | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig
index c82a936..a11408f 100644
--- a/drivers/power/regulator/Kconfig
+++ b/drivers/power/regulator/Kconfig
@@ -77,6 +77,13 @@ config DM_REGULATOR_FIXED
features for fixed value regulators. The driver implements get/set api
for enable and get only for voltage value.
 
+config SPL_DM_REGULATOR_FIXED
+   bool "Enable Driver Model for REGULATOR Fixed value in SPL"
+   depends on DM_REGULATOR_FIXED
+   ---help---
+   This config enables implementation of driver-model regulator uclass
+   features for fixed value regulators in SPL.
+
 config DM_REGULATOR_GPIO
bool "Enable Driver Model for GPIO REGULATOR"
depends on DM_REGULATOR
-- 
2.1.4

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


[U-Boot] [RESEND PATCH 06/10] rockchip: dts: rk3399-puma: add 'same-as-spl' to the front of the boot-order

2017-09-12 Thread Philipp Tomsich
In the general case, we want to continue booting the full U-Boot
(contained in a discoverable FIT image) from the same device the SPL
stage was loaded from.  This prepends the 'same-as-spl' specifier to
our configurable boot-order to make this the default behaviour.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 arch/arm/dts/rk3399-puma.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi
index dd1baea..edb9424 100644
--- a/arch/arm/dts/rk3399-puma.dtsi
+++ b/arch/arm/dts/rk3399-puma.dtsi
@@ -20,7 +20,8 @@
 
chosen {
stdout-path = "serial0:115200n8";
-   u-boot,spl-boot-order = , , 
+   u-boot,spl-boot-order = \
+   "same-as-spl", , , 
};
 
aliases {
-- 
2.1.4

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


Re: [U-Boot] [U-Boot, 02/10] arm: add option for TPL support in arm 32bit

2017-09-12 Thread Philipp Tomsich
> Some options like TPL_SYS_THUMB_BUILD, TPL_USE_ARCH_MEMCPY
> and TPL_USE_ARCH_MEMCPY are needed for TPL build in 32bit arm.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> ---
> 
>  arch/arm/Kconfig | 29 +
>  1 file changed, 29 insertions(+)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 05/10] sysreset: enable driver support in SPL/TPL

2017-09-12 Thread Philipp Tomsich
> SPL/TPL also need use sysreset for some feature like panic callback.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> ---
> 
>  drivers/sysreset/Kconfig  | 18 ++
>  drivers/sysreset/Makefile |  2 +-
>  2 files changed, 19 insertions(+), 1 deletion(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 06/10] spl: add support to booting with OP-TEE

2017-09-12 Thread Philipp Tomsich
> OP-TEE is an open source trusted OS, in armv7, its loading and
> running are like this:
> loading:
> - SPL load both OP-TEE and U-Boot
> running:
> - SPL run into OP-TEE in secure mode;
> - OP-TEE run into U-Boot in non-secure mode;
> 
> More detail:
> https://github.com/OP-TEE/optee_os
> and search for 'boot arguments' for detail entry parameter in:
> core/arch/arm/kernel/generic_entry_a32.S
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> ---
> 
>  common/spl/Kconfig |  7 +++
>  common/spl/Makefile|  1 +
>  common/spl/spl.c   |  5 +
>  common/spl/spl_optee.S | 13 +
>  include/spl.h  |  9 +
>  5 files changed, 35 insertions(+)
>  create mode 100644 common/spl/spl_optee.S
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 10/10] rockchip: evb-rk322x: update defconfig with tpl and optee support

2017-09-12 Thread Philipp Tomsich
> Enable all the options for TPL/SPL and OPTEE.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> ---
> 
>  configs/evb-rk3229_defconfig | 28 
>  1 file changed, 24 insertions(+), 4 deletions(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v3,1/2] rockchip: rk322x: add sdram driver

2017-09-12 Thread Philipp Tomsich
> Add driver for rk322x to support sdram initialize in SPL.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> ---
> 
> Changes in v3:
> - move rk332x sdram driver to driver/ram
> - do the ram init in TPL instad of SPL
> 
>  arch/arm/include/asm/arch-rockchip/sdram_rk322x.h | 581 +++
>  drivers/ram/rockchip/Makefile |   1 +
>  drivers/ram/rockchip/sdram_rk322x.c   | 855 
> ++
>  3 files changed, 1437 insertions(+)
>  create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_rk322x.h
>  create mode 100644 drivers/ram/rockchip/sdram_rk322x.c
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/2] rockchip: ram: rk3399: update reg map for of-platdata

2017-09-12 Thread Philipp Tomsich
> After Simon's patch, the dtoc can work with 64bit address,
> so we need to fix reg number for it.
> Depend on Simon's patch set:
> https://patchwork.ozlabs.org/cover/807266/
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  drivers/ram/rockchip/sdram_rk3399.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 3/4] rockchip: add BOOT_LOADER support for boot mode

2017-09-12 Thread Philipp Tomsich



On Tue, 22 Aug 2017, Kever Yang wrote:


Rockchip using rockusb for flash emmc via USB, people
use 'reboot loader' in kernel and then want to get a rockusb
device in bootloader for firmware update.

Signed-off-by: Kever Yang <kever.y...@rock-chips.com>


Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>

See blow for requested changes.


---

Changes in v2:
- use env_set() instead of setenv()

arch/arm/mach-rockchip/rk3036-board.c | 4 
arch/arm/mach-rockchip/rk322x-board.c | 4 
arch/arm/mach-rockchip/rk3288-board.c | 4 
3 files changed, 12 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3036-board.c 
b/arch/arm/mach-rockchip/rk3036-board.c
index a3457f3..1f11f8e 100644
--- a/arch/arm/mach-rockchip/rk3036-board.c
+++ b/arch/arm/mach-rockchip/rk3036-board.c
@@ -40,6 +40,10 @@ static void setup_boot_mode(void)
printf("enter UMS!\n");
env_set("preboot", "setenv preboot; ums mmc 0");
break;
+   case BOOT_LOADER:
+   printf("enter Rockusb!\n");
+   env_set("preboot", "setenv preboot; rockusb 0 mmc 0");
+   break;


Looks like this is duplicated code across all our boards.
Can you please factor this out and call into common code for this?


}
}

diff --git a/arch/arm/mach-rockchip/rk322x-board.c 
b/arch/arm/mach-rockchip/rk322x-board.c
index 91e3c90..8c77977 100644
--- a/arch/arm/mach-rockchip/rk322x-board.c
+++ b/arch/arm/mach-rockchip/rk322x-board.c
@@ -36,6 +36,10 @@ static void setup_boot_mode(void)
printf("enter UMS!\n");
env_set("preboot", "setenv preboot; ums mmc 0");
break;
+   case BOOT_LOADER:
+   printf("enter Rockusb!\n");
+   env_set("preboot", "setenv preboot; rockusb 0 mmc 0");
+   break;
}
}

diff --git a/arch/arm/mach-rockchip/rk3288-board.c 
b/arch/arm/mach-rockchip/rk3288-board.c
index 74c6cc1..a08658a 100644
--- a/arch/arm/mach-rockchip/rk3288-board.c
+++ b/arch/arm/mach-rockchip/rk3288-board.c
@@ -44,6 +44,10 @@ static void setup_boot_mode(void)
env_set("preboot", "setenv preboot; if mmc dev 0;"
   "then ums mmc 0; else ums mmc 1;fi");
break;
+   case BOOT_LOADER:
+   printf("enter Rockusb!\n");
+   env_set("preboot", "setenv preboot; rockusb 0 mmc 0");
+   break;
}
}



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


[U-Boot] [RESEND PATCH 1/6] rockchip: clk: rk3399: Convert to livetree

2017-09-12 Thread Philipp Tomsich
Update the clock driver for the RK3399  to support a live device tree.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 drivers/clk/rockchip/clk_rk3399.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/rockchip/clk_rk3399.c 
b/drivers/clk/rockchip/clk_rk3399.c
index 3edafea..04f0b3f 100644
--- a/drivers/clk/rockchip/clk_rk3399.c
+++ b/drivers/clk/rockchip/clk_rk3399.c
@@ -975,7 +975,7 @@ static int rk3399_clk_ofdata_to_platdata(struct udevice 
*dev)
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
struct rk3399_clk_priv *priv = dev_get_priv(dev);
 
-   priv->cru = (struct rk3399_cru *)devfdt_get_addr(dev);
+   priv->cru = dev_read_addr_ptr(dev);
 #endif
return 0;
 }
@@ -1159,7 +1159,7 @@ static int rk3399_pmuclk_ofdata_to_platdata(struct 
udevice *dev)
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
struct rk3399_pmuclk_priv *priv = dev_get_priv(dev);
 
-   priv->pmucru = (struct rk3399_pmucru *)devfdt_get_addr(dev);
+   priv->pmucru = dev_read_addr_ptr(dev);
 #endif
return 0;
 }
-- 
2.1.4

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


[U-Boot] [RESEND PATCH 3/6] rockchip: efuse: change to use dev_read_addr_ptr

2017-09-12 Thread Philipp Tomsich
With the dev_read_addr_ptr function available, we can change the
efuse driver to use it (and eliminate the explicit type-cast).

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 drivers/misc/rockchip-efuse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/rockchip-efuse.c b/drivers/misc/rockchip-efuse.c
index 2e3bc91..a2203bf 100644
--- a/drivers/misc/rockchip-efuse.c
+++ b/drivers/misc/rockchip-efuse.c
@@ -142,7 +142,7 @@ static int rockchip_efuse_ofdata_to_platdata(struct udevice 
*dev)
 {
struct rockchip_efuse_platdata *plat = dev_get_platdata(dev);
 
-   plat->base = (void *)dev_read_addr(dev);
+   plat->base = dev_read_addr_ptr(dev);
return 0;
 }
 
-- 
2.1.4

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


[U-Boot] [RESEND PATCH 07/10] rockchip: puma-rk3399: update board_init()

2017-09-12 Thread Philipp Tomsich
The original initialisation code for board_init() was largely lifted
from the code on the EVB.  However, the RK3399-Q7 can do with a much
more concise init sequence.

This cleans up the board_init() by updating it to the essentials for
the RK3399-Q7 and getting rid of the accumulated cruft.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 board/theobroma-systems/puma_rk3399/puma-rk3399.c | 36 +++
 1 file changed, 4 insertions(+), 32 deletions(-)

diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c 
b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
index 01b90e3..cc572b5 100644
--- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
+++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
@@ -19,44 +19,16 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int board_init(void)
 {
-   struct udevice *pinctrl, *regulator;
int ret;
 
/*
-* The PWM does not have decicated interrupt number in dts and can
-* not get periph_id by pinctrl framework, so let's init them here.
-* The PWM2 and PWM3 are for pwm regulators.
+* We need to call into regulators_enable_boot_on() again, as the call
+* during SPL may have not included all regulators.
 */
-   ret = uclass_get_device(UCLASS_PINCTRL, 0, );
-   if (ret) {
-   debug("%s: Cannot find pinctrl device\n", __func__);
-   goto out;
-   }
-
-   ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM2);
-   if (ret) {
-   debug("%s PWM2 pinctrl init fail!\n", __func__);
-   goto out;
-   }
-
-   /* rk3399 need to init vdd_center to get the correct output voltage */
-   ret = regulator_get_by_platname("vdd_center", );
+   ret = regulators_enable_boot_on(false);
if (ret)
-   debug("%s: Cannot get vdd_center regulator\n", __func__);
-
-   ret = regulator_get_by_platname("vcc5v0_host", );
-   if (ret) {
-   debug("%s vcc5v0_host init fail! ret %d\n", __func__, ret);
-   goto out;
-   }
-
-   ret = regulator_set_enable(regulator, true);
-   if (ret) {
-   debug("%s vcc5v0-host-en set fail!\n", __func__);
-   goto out;
-   }
+   debug("%s: Cannot enable boot on regulator\n", __func__);
 
-out:
return 0;
 }
 
-- 
2.1.4

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


[U-Boot] [RESEND PATCH 05/10] rockchip: spl: rk3399: implement chip-specific board_spl_was_booted_from()

2017-09-12 Thread Philipp Tomsich
To support the new "same-as-spl" specifier in the boot-order on the
RK3399, this implements the chip-specific mapping from the information
obtainable from the BROM to a OF path name.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 arch/arm/mach-rockchip/rk3399-board-spl.c | 24 
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c 
b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 8e38ef1..9c20f56 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -26,6 +26,30 @@ void board_return_to_bootrom(void)
back_to_bootrom();
 }
 
+static const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
+   [BROM_BOOTSOURCE_EMMC] = "/sdhci@fe33",
+   [BROM_BOOTSOURCE_SPINOR] = "/spi@ff1d",
+   [BROM_BOOTSOURCE_SD] = "/dwmmc@fe32",
+};
+
+const char *board_spl_was_booted_from(void)
+{
+   u32  bootdevice_brom_id = readl(RK3399_BROM_BOOTSOURCE_ID_ADDR);
+   const char *bootdevice_ofpath = NULL;
+
+   if (bootdevice_brom_id < ARRAY_SIZE(boot_devices))
+   bootdevice_ofpath = boot_devices[bootdevice_brom_id];
+
+   if (bootdevice_ofpath)
+   debug("%s: brom_bootdevice_id %x maps to '%s'\n",
+ __func__, bootdevice_brom_id, bootdevice_ofpath);
+   else
+   debug("%s: failed to resolve brom_bootdevice_id %x\n",
+ __func__, bootdevice_brom_id);
+
+   return bootdevice_ofpath;
+}
+
 u32 spl_boot_device(void)
 {
u32 boot_device = BOOT_DEVICE_MMC1;
-- 
2.1.4

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


[U-Boot] [RESEND PATCH 04/10] rockchip: spl: support a 'same-as-spl'-specifier in the spl-boot-order

2017-09-12 Thread Philipp Tomsich
It is often desirable to configure the spl-boot-order (i.e. the order
that SPL probes devices to find the FIT image containing a full U-Boot)
such that it contains 'the same device the SPL stage was booted from'
early on.  To support this, we introduce the 'same-as-spl' specifier
for the spl-boot-order property.

This commit adds:
 - documentation for the new board_spl_was_booted_from() function that
   individual SoCs/boards should provide, if they can determine where
   the SPL was booted from
 - implements the new board_spl_was_booted_from() stub function
 - adds support for handling the 'same-as-spl' specifier and calling
   into the per-SoC/per-board support code.

This also updates the documentation for the 'u-boot,spl-boot-order'
property.

Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
---

 arch/arm/mach-rockchip/spl-boot-order.c | 29 -
 doc/device-tree-bindings/chosen.txt | 12 +++-
 2 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-rockchip/spl-boot-order.c 
b/arch/arm/mach-rockchip/spl-boot-order.c
index 0bb9a73..843998d 100644
--- a/arch/arm/mach-rockchip/spl-boot-order.c
+++ b/arch/arm/mach-rockchip/spl-boot-order.c
@@ -76,6 +76,24 @@ static int spl_node_to_boot_device(int node)
return -1;
 }
 
+/**
+ * board_spl_was_booted_from() - retrieves the of-path the SPL was loaded from
+ *
+ * To support a 'same-as-spl' specification in the search-order for the next
+ * stage, we need a SoC- or board-specific way to handshake with what 'came
+ * before us' (either a BROM or TPL stage) and map the info retrieved onto
+ * a OF path.
+ *
+ * Returns
+ *   NULL, on failure or if the device could not be identified
+ *   a of_path (a string), on success
+ */
+__weak const char *board_spl_was_booted_from(void)
+{
+   debug("%s: no support for 'same-as-spl' for this board\n", __func__);
+   return NULL;
+}
+
 void board_boot_order(u32 *spl_boot_list)
 {
const void *blob = gd->fdt_blob;
@@ -97,8 +115,17 @@ void board_boot_order(u32 *spl_boot_list)
 (conf = fdt_stringlist_get(blob, chosen_node,
"u-boot,spl-boot-order", elem, NULL));
 elem++) {
+   const char *alias;
+
+   /* Handle the case of 'same device the SPL was loaded from' */
+   if (strncmp(conf, "same-as-spl", 11) == 0) {
+   conf = board_spl_was_booted_from();
+   if (!conf)
+   continue;
+   }
+
/* First check if the list element is an alias */
-   const char *alias = fdt_get_alias(blob, conf);
+   alias = fdt_get_alias(blob, conf);
if (alias)
conf = alias;
 
diff --git a/doc/device-tree-bindings/chosen.txt 
b/doc/device-tree-bindings/chosen.txt
index 5625d21..c96b8f7 100644
--- a/doc/device-tree-bindings/chosen.txt
+++ b/doc/device-tree-bindings/chosen.txt
@@ -56,10 +56,20 @@ Each list element of the property should specify a device 
to be probed
 in the order they are listed: references (i.e. implicit paths), a full
 path or an alias is expected for each entry.
 
+A special specifier "same-as-spl" can be used at any position in the
+boot-order to direct U-Boot to insert the device the SPL was booted
+from there.  Whether this is indeed inserted or silently ignored (if
+it is not supported on any given SoC/board or if the boot-device is
+not available to continue booting from) is implementation-defined.
+Note that if "same-as-spl" expands to an actual node for a given
+board, the corresponding node may appear multiple times in the
+boot-order (as there currently exists no mechanism to suppress
+duplicates from the list).
+
 Example
 ---
 / {
chosen {
-   u-boot,spl-boot-order = , "/sdhci@fe33";
+   u-boot,spl-boot-order = "same-as-spl", , 
"/sdhci@fe33";
};
 };
-- 
2.1.4

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


Re: [U-Boot] [U-Boot,03/10] arm: add a separate stack for TPL

2017-09-12 Thread Philipp Tomsich
> TPL stack may different from SPL and sys stack, add support for
> separate one when the board defines it.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> ---
> 
>  arch/arm/lib/crt0.S | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 1/2] rockchip: rk3368: add ENV_MEM_LAYOUT to extra env settings

2017-09-12 Thread Philipp Tomsich
> Add the ENV_MEM_LAYOUT_SETTINGS to CONFIG_EXTRA_ENV_SETTINGS
> 
> Signed-off-by: Andy Yan <andy@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  include/configs/rk3368_common.h | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 09/10] rockchip: evb-rk3229: add README file for OP-TEE support

2017-09-12 Thread Philipp Tomsich
> Detail of step by step to bring up the board with OP-TEE support.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> ---
> 
>  board/rockchip/evb_rk3229/README | 72 
> 
>  1 file changed, 72 insertions(+)
>  create mode 100644 board/rockchip/evb_rk3229/README
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 1/2] rockchip: sdhci: update reg map for of-platdata

2017-09-12 Thread Philipp Tomsich
> After Simon's patch, the dtoc can work with 64bit address,
> so we need to fix reg number for it.
> Depend on Simon's patch set:
> https://patchwork.ozlabs.org/cover/807266/
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> ---
> 
>  drivers/mmc/rockchip_sdhci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v3, 2/2] rockchip: dts: rk3229: remove dram channel info

2017-09-12 Thread Philipp Tomsich
> The dram channel info will be auto detect by the driver,
> we do not need it.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> ---
> 
> Changes in v3: None
> 
>  arch/arm/dts/rk3229-evb.dts | 1 -
>  1 file changed, 1 deletion(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/3] spl: remove SPL_ATF_TEXT_BASE config option

2017-09-12 Thread Philipp Tomsich
> We don't need SPL_ATF_TEXT_BASE since we can get the bl31 entry
> from spl_image.entry_point.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> ---
> 
>  common/spl/Kconfig | 6 --
>  1 file changed, 6 deletions(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 1/3] spl: update bl31_entry() with new name and parameter

2017-09-12 Thread Philipp Tomsich
> Rename the bl31_entry() function with 'spl_' prefix and add one
> parameter for bl31 entry address since we can get it from spl_image header.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> ---
> 
>  common/spl/spl.c | 2 +-
>  common/spl/spl_atf.c | 4 ++--
>  include/spl.h| 6 +-
>  3 files changed, 8 insertions(+), 4 deletions(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,1/3] rockchip: rk3399: detect boot mode

2017-09-12 Thread Philipp Tomsich



On Tue, 22 Aug 2017, Kever Yang wrote:


U-Boot fastboot, kernel may reboot with parameter which require
bootloader to get into different boot mode, detect it and enter
proper mode.

Signed-off-by: Kever Yang <kever.y...@rock-chips.com>


Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>

Requested changes below.


---

Changes in v2:
- use env_set() instead of setenv()

arch/arm/mach-rockchip/rk3399/Kconfig  |  1 +
arch/arm/mach-rockchip/rk3399/rk3399.c | 42 +-
2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig 
b/arch/arm/mach-rockchip/rk3399/Kconfig
index 415466a..c4a6d46 100644
--- a/arch/arm/mach-rockchip/rk3399/Kconfig
+++ b/arch/arm/mach-rockchip/rk3399/Kconfig
@@ -5,6 +5,7 @@ choice

config TARGET_EVB_RK3399
bool "RK3399 evaluation board"
+   select BOARD_LATE_INIT


With the changes below, we can make this a default for all RK3399 boards.
So let's imply BOARD_LATE_INIT from the RK3399 selection.


help
  RK3399evb is a evaluation board for Rockchp rk3399,
  with full function and phisical connectors support like type-C ports,
diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c 
b/arch/arm/mach-rockchip/rk3399/rk3399.c
index dbc248f..3a5e4f9 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -5,9 +5,13 @@
 */

#include 
+#include 
#include 
-#include 
+#include 
+#include 
+#include 
#include 
+#include 

DECLARE_GLOBAL_DATA_PTR;

@@ -55,3 +59,39 @@ int arch_cpu_init(void)

return 0;
}
+
+static void setup_boot_mode(void)
+{
+   struct rk3399_pmugrf_regs *pmugrf;
+   int boot_mode;
+
+   pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
+   boot_mode = readl(>os_reg0);
+   debug("boot mode %x\n", boot_mode);
+
+   /* Clear boot mode */
+   writel(BOOT_NORMAL, >os_reg0);
+
+   switch (boot_mode) {
+   case BOOT_FASTBOOT:
+   printf("enter fastboot!\n");


I would use a debug() here...


+   env_set("preboot", "setenv preboot; fastboot usb0");


Could we just set a more neutral (than 'preboot') environment variable 
that can then be run by bootscripts? This would allow custom boot scripts 
to either run this or not (while 'preboot' is unconditional).


Alternatively, you could just set an environment variable indicating that
the 'fastboot'-flag was set and then a bootscript could test this and 
forward into fastboot mode.



+   break;
+   case BOOT_UMS:
+   printf("enter UMS!\n");
+   env_set("preboot", "setenv preboot; if mmc dev 0;"
+  "then ums mmc 0; else ums mmc 1;fi");


Same.


+   break;
+   case BOOT_LOADER:
+   printf("enter Rockusb!\n");
+   env_set("preboot", "setenv preboot; rockusb 0 mmc 0");


Same.


+   break;
+   }
+}
+
+int board_late_init(void)
+{
+   setup_boot_mode();
+
+   return 0;
+}


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


Re: [U-Boot] [U-Boot, v2, 2/5] armv7: rk3288: Move configure_l2ctlr to common

2017-09-29 Thread Philipp Tomsich
> From: Jagan Teki <ja...@amarulasolutions.com>
> 
> configure_l2ctlr will be shared between SPL and TPL so
> move them into asm/arch/sys_proto.h
> 
> Signed-off-by: Jagan Teki <ja...@amarulasolutions.com>
> ---
> Changes for v2:
> - New patch
> 
>  arch/arm/include/asm/arch-rockchip/sys_proto.h | 23 +++
>  arch/arm/mach-rockchip/rk3288-board-spl.c  | 21 +
>  2 files changed, 24 insertions(+), 20 deletions(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 1/5] armv7: Move L2CTLR read/write to common

2017-09-29 Thread Philipp Tomsich
> From: Jagan Teki <ja...@amarulasolutions.com>
> 
> L2CTLR read/write functions are common to armv7 so, move
> them in to include/asm/armv7.h and use them where ever it need.
> 
> Cc: Tom Warren <twar...@nvidia.com>
> Signed-off-by: Jagan Teki <ja...@amarulasolutions.com>
> ---
> Changes for v2:
> - New patch
> 
>  arch/arm/include/asm/armv7.h  | 21 +
>  arch/arm/mach-rockchip/rk3288-board-spl.c | 22 +-
>  arch/arm/mach-tegra/cache.c   |  5 +++--
>  3 files changed, 25 insertions(+), 23 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] rockchip: rk322x: fix pd_bus hclk/pclk

2017-09-29 Thread Philipp Tomsich
> The pd_bus hclk/pclk source is pd_bus aclk, not the PLL.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> ---
> 
>  drivers/clk/rockchip/clk_rk322x.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 3/5] power: pmic: rk805: support rk805 pmic

2017-09-29 Thread Philipp Tomsich
> From: Elaine Zhang <zhangq...@rock-chips.com>
> 
> RK805 have 4 DCDC, 4 LDO, RTC.
> The configuration parameters are the same with RK816.
> 
> The RK805 most used with rk312x/rk322x/rk332x products which do not
> need charger and fuel guage.
> 
> Signed-off-by: Elaine Zhang <zhangq...@rock-chips.com>
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> ---
> 
> Changes in v2:
> - add introduce info for RK816 in commit message
> 
>  drivers/power/pmic/rk8xx.c  | 1 +
>  drivers/power/regulator/rk8xx.c | 6 ++
>  include/power/rk8xx_pmic.h  | 1 +
>  3 files changed, 8 insertions(+)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 2/5] armv7: rk3288: Move configure_l2ctlr to common

2017-09-29 Thread Philipp Tomsich
> From: Jagan Teki <ja...@amarulasolutions.com>
> 
> configure_l2ctlr will be shared between SPL and TPL so
> move them into asm/arch/sys_proto.h
> 
> Signed-off-by: Jagan Teki <ja...@amarulasolutions.com>
> ---
> Changes for v2:
> - New patch
> 
>  arch/arm/include/asm/arch-rockchip/sys_proto.h | 23 +++
>  arch/arm/mach-rockchip/rk3288-board-spl.c  | 21 +
>  2 files changed, 24 insertions(+), 20 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, 1/1] evb-rk3399: avoid redefinition of CONFIG_ENV_OFFSET

2017-09-29 Thread Philipp Tomsich
> CONFIG_ENV_OFFSET is already defined in
> include/configs/rockchip-common.h
> 
> For CONFIG_ROCKCHIP_BACK_TO_BROM=y we redefine CONFIG_ENV_OFFSET
> to an unsuitable value. We were lucky to get a compiler warning.
> 
> Remove the incorrect redefinition.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.g...@gmx.de>
> ---
>  include/configs/evb_rk3399.h | 6 --
>  1 file changed, 6 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] rockchip: pinctrl: rk3368: add pinctrl for SDMMC0

2017-09-29 Thread Philipp Tomsich
> Apparently, our earlier assumption that the BROM will always set up
> the iomux for SDcard communication does not always hold true: when
> booting U-Boot from the on-module (on the RK3368-uQ7) eMMC, the SDcard
> pins are not set up and need to be configured by the pinctrl driver to
> allow SD card access.
> 
> This change implements support for setting up the SDMMC pins in
> pinctrl for the RK3368.
> 
> Reported-by: Klaus Goger <klaus.go...@theobroma-systems.com>
> Signed-off-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> ---
> 
>  drivers/pinctrl/rockchip/pinctrl_rk3368.c | 39 
> +++
>  1 file changed, 34 insertions(+), 5 deletions(-)
> 

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


Re: [U-Boot] [U-Boot, v2, 1/5] rockchip: i2c: rk3328: support i2c for rk3328 SoC

2017-09-29 Thread Philipp Tomsich
> From: Elaine Zhang <zhangq...@rock-chips.com>
> 
> Add compatible to support rk3328 i2c
> 
> Signed-off-by: Elaine Zhang <zhangq...@rock-chips.com>
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> Acked-by: Heiko Schocher<h...@denx.de>
> ---
> 
> Changes in v2: None
> 
>  drivers/i2c/rk_i2c.c | 1 +
>  1 file changed, 1 insertion(+)
> 

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


Re: [U-Boot] rockchip: rk322x: fix pd_bus hclk/pclk

2017-09-29 Thread Philipp Tomsich
> The pd_bus hclk/pclk source is pd_bus aclk, not the PLL.
> 
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
>  drivers/clk/rockchip/clk_rk322x.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 

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


Re: [U-Boot] [U-Boot, v2, 1/5] armv7: Move L2CTLR read/write to common

2017-09-29 Thread Philipp Tomsich
> From: Jagan Teki <ja...@amarulasolutions.com>
> 
> L2CTLR read/write functions are common to armv7 so, move
> them in to include/asm/armv7.h and use them where ever it need.
> 
> Cc: Tom Warren <twar...@nvidia.com>
> Signed-off-by: Jagan Teki <ja...@amarulasolutions.com>
> ---
> Changes for v2:
> - New patch
> 
>  arch/arm/include/asm/armv7.h  | 21 +
>  arch/arm/mach-rockchip/rk3288-board-spl.c | 22 +-
>  arch/arm/mach-tegra/cache.c   |  5 +++--
>  3 files changed, 25 insertions(+), 23 deletions(-)
> 

Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 4/5] configs: rk3328: add support for pmic rk8xx and regulator and i2c driver

2017-09-29 Thread Philipp Tomsich
> From: Elaine Zhang <zhangq...@rock-chips.com>
> 
> Add defconfig for rk8xx and regulator and i2c controller.
> 
> Signed-off-by: Elaine Zhang <zhangq...@rock-chips.com>
> Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> Reviewed-by: Philipp Tomsich <philipp.toms...@theobroma-systems.com>
> ---
> 
> Changes in v2: None
> 
>  configs/evb-rk3328_defconfig | 6 ++
>  1 file changed, 6 insertions(+)
> 

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


<    9   10   11   12   13   14   15   16   17   18   >