summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile12
-rw-r--r--arch/arm/dts/rk3399-rockpro64-u-boot.dtsi5
-rw-r--r--arch/arm/mach-rockchip/Makefile8
-rw-r--r--board/theobroma-systems/lion_rk3368/README4
-rw-r--r--doc/README.rockchip21
-rw-r--r--drivers/clk/rockchip/clk_rk3288.c23
-rw-r--r--drivers/clk/rockchip/clk_rk3328.c12
-rw-r--r--drivers/clk/rockchip/clk_rk3368.c19
-rw-r--r--drivers/clk/rockchip/clk_rk3399.c37
-rw-r--r--drivers/usb/host/ehci-generic.c2
-rw-r--r--drivers/usb/host/ohci-generic.c2
11 files changed, 24 insertions, 121 deletions
diff --git a/Makefile b/Makefile
index ae56e47b2c..57d0700227 100644
--- a/Makefile
+++ b/Makefile
@@ -882,6 +882,10 @@ ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy)
ALL-y += u-boot-with-dtb.bin
endif
+ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy)
+ALL-y += idbloader.img
+endif
+
LDFLAGS_u-boot += $(LDFLAGS_FINAL)
# Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.
@@ -1314,6 +1318,14 @@ OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
$(call if_changed,pad_cat)
+ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
+MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T rksd
+tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE
+ $(call if_changed,mkimage)
+idbloader.img: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE
+ $(call if_changed,cat)
+endif
+
ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
diff --git a/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi b/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
index f7f26d584f..a073ea25f5 100644
--- a/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
@@ -5,6 +5,11 @@
#include "rk3399-u-boot.dtsi"
#include "rk3399-sdram-lpddr4-100.dtsi"
+/ {
+ chosen {
+ u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci;
+ };
+};
&vdd_log {
regulator-init-microvolt = <950000>;
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index 207f900011..45d9b06233 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0+
#
# Copyright (c) 2014 Google, Inc
+# Copyright (c) 2019 Rockchip Electronics Co., Ltd.
# We don't want the bootrom-helper present in a full U-Boot build, as
# this may have entered from ATF with the stack-pointer pointing to
@@ -21,19 +22,14 @@ ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
# meaning "turn it off".
obj-y += boot_mode.o
obj-$(CONFIG_ROCKCHIP_COMMON_BOARD) += board.o
+obj-$(CONFIG_MISC_INIT_R) += misc.o
endif
obj-$(CONFIG_$(SPL_TPL_)RAM) += sdram_common.o
-ifdef CONFIG_MISC_INIT_R
-obj-y += misc.o
-endif
-
obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036/
obj-$(CONFIG_ROCKCHIP_RK3128) += rk3128/
-ifndef CONFIG_TPL_BUILD
obj-$(CONFIG_ROCKCHIP_RK3188) += rk3188/
-endif
obj-$(CONFIG_ROCKCHIP_RK322X) += rk322x/
obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288/
obj-$(CONFIG_ROCKCHIP_RK3328) += rk3328/
diff --git a/board/theobroma-systems/lion_rk3368/README b/board/theobroma-systems/lion_rk3368/README
index 83e4332984..ad3ac93bd4 100644
--- a/board/theobroma-systems/lion_rk3368/README
+++ b/board/theobroma-systems/lion_rk3368/README
@@ -18,8 +18,6 @@ Build the TPL/SPL stage
=======================
> make CROSS_COMPILE=aarch64-unknown-elf- ARCH=arm
- > tools/mkimage -n rk3368 -T rksd -d tpl/u-boot-tpl.bin spl-3368.img
- > cat spl/u-boot-spl-dtb.bin >> spl-3368.img
Build the full U-Boot and a FIT image including the ATF
=======================================================
@@ -35,7 +33,7 @@ Copy the SPL to offset 32k and the FIT image containing the payloads
SD-Card
-------
- > dd if=spl-3368.img of=/dev/sdb seek=64
+ > dd if=idbloader.img of=/dev/sdb seek=64
> dd if=u-boot.itb of=/dev/sdb seek=512
eMMC
diff --git a/doc/README.rockchip b/doc/README.rockchip
index 531a062c9e..d17afeabdd 100644
--- a/doc/README.rockchip
+++ b/doc/README.rockchip
@@ -275,9 +275,7 @@ As of now TPL is added on Vyasa-RK3288 board.
To write an image that boots from an SD card (assumed to be /dev/mmcblk0):
- ./tools/mkimage -n rk3288 -T rksd -d ./tpl/u-boot-tpl.bin out &&
- cat ./spl/u-boot-spl-dtb.bin >> out &&
- sudo dd if=out of=/dev/mmcblk0 seek=64 &&
+ sudo dd if=idbloader.img of=/dev/mmcblk0 seek=64 &&
sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 seek=16384
Booting from an SD card on RK3188
@@ -310,11 +308,6 @@ Booting from an SD card on Pine64 Rock64 (RK3328)
For Rock64 rk3328 board the following three parts are required:
TPL, SPL, and the u-boot image tree blob.
- - Create TPL/SPL image
-
- => tools/mkimage -n rk3328 -T rksd -d tpl/u-boot-tpl.bin idbloader.img
- => cat spl/u-boot-spl.bin >> idbloader.img
-
- Write TPL/SPL image at 64 sector
=> sudo dd if=idbloader.img of=/dev/mmcblk0 seek=64
@@ -473,19 +466,9 @@ Hit any key to stop autoboot: 0
Option 3: Package the image with TPL:
- - Prefix rk3399 header to TPL image
-
- => cd /path/to/u-boot
- => ./tools/mkimage -n rk3399 -T rksd -d tpl/u-boot-tpl-dtb.bin out
-
- - Concatinate tpl with spl
-
- => cd /path/to/u-boot
- => cat ./spl/u-boot-spl-dtb.bin >> out
-
- Write tpl+spl at 64th sector
- => sudo dd if=out of=/dev/sdc seek=64
+ => sudo dd if=idbloader.img of=/dev/sdc seek=64
- Write U-Boot proper at 16384 sector
diff --git a/drivers/clk/rockchip/clk_rk3288.c b/drivers/clk/rockchip/clk_rk3288.c
index 375d7f8acb..0122381633 100644
--- a/drivers/clk/rockchip/clk_rk3288.c
+++ b/drivers/clk/rockchip/clk_rk3288.c
@@ -940,35 +940,12 @@ static int __maybe_unused rk3288_clk_set_parent(struct clk *clk, struct clk *par
return -ENOENT;
}
-static int rk3288_clk_enable(struct clk *clk)
-{
- switch (clk->id) {
- case HCLK_USBHOST0:
- case HCLK_HSIC:
- return 0;
-
- case SCLK_MAC:
- case SCLK_MAC_RX:
- case SCLK_MAC_TX:
- case SCLK_MACREF:
- case SCLK_MACREF_OUT:
- case ACLK_GMAC:
- case PCLK_GMAC:
- /* Required to successfully probe the Designware GMAC driver */
- return 0;
- }
-
- debug("%s: unsupported clk %ld\n", __func__, clk->id);
- return -ENOENT;
-}
-
static struct clk_ops rk3288_clk_ops = {
.get_rate = rk3288_clk_get_rate,
.set_rate = rk3288_clk_set_rate,
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
.set_parent = rk3288_clk_set_parent,
#endif
- .enable = rk3288_clk_enable,
};
static int rk3288_clk_ofdata_to_platdata(struct udevice *dev)
diff --git a/drivers/clk/rockchip/clk_rk3328.c b/drivers/clk/rockchip/clk_rk3328.c
index 5957a00402..a89e2ecc4a 100644
--- a/drivers/clk/rockchip/clk_rk3328.c
+++ b/drivers/clk/rockchip/clk_rk3328.c
@@ -745,22 +745,10 @@ static int rk3328_clk_set_parent(struct clk *clk, struct clk *parent)
return -ENOENT;
}
-static int rk3328_clk_enable(struct clk *clk)
-{
- switch (clk->id) {
- case HCLK_HOST0:
- /* Required to successfully probe the ehci generic driver */
- return 0;
- }
-
- return -ENOENT;
-}
-
static struct clk_ops rk3328_clk_ops = {
.get_rate = rk3328_clk_get_rate,
.set_rate = rk3328_clk_set_rate,
.set_parent = rk3328_clk_set_parent,
- .enable = rk3328_clk_enable,
};
static int rk3328_clk_probe(struct udevice *dev)
diff --git a/drivers/clk/rockchip/clk_rk3368.c b/drivers/clk/rockchip/clk_rk3368.c
index 89cbae59c5..c1a867b2ed 100644
--- a/drivers/clk/rockchip/clk_rk3368.c
+++ b/drivers/clk/rockchip/clk_rk3368.c
@@ -566,31 +566,12 @@ static int __maybe_unused rk3368_clk_set_parent(struct clk *clk, struct clk *par
return -ENOENT;
}
-static int rk3368_clk_enable(struct clk *clk)
-{
- switch (clk->id) {
- case SCLK_MAC:
- case SCLK_MAC_RX:
- case SCLK_MAC_TX:
- case SCLK_MACREF:
- case SCLK_MACREF_OUT:
- case ACLK_GMAC:
- case PCLK_GMAC:
- /* Required to successfully probe the Designware GMAC driver */
- return 0;
- }
-
- debug("%s: unsupported clk %ld\n", __func__, clk->id);
- return -ENOENT;
-}
-
static struct clk_ops rk3368_clk_ops = {
.get_rate = rk3368_clk_get_rate,
.set_rate = rk3368_clk_set_rate,
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
.set_parent = rk3368_clk_set_parent,
#endif
- .enable = rk3368_clk_enable,
};
static int rk3368_clk_probe(struct udevice *dev)
diff --git a/drivers/clk/rockchip/clk_rk3399.c b/drivers/clk/rockchip/clk_rk3399.c
index d9950c159b..a273bd1beb 100644
--- a/drivers/clk/rockchip/clk_rk3399.c
+++ b/drivers/clk/rockchip/clk_rk3399.c
@@ -1062,49 +1062,12 @@ static int __maybe_unused rk3399_clk_set_parent(struct clk *clk,
return -ENOENT;
}
-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;
-
- case SCLK_MAC:
- case SCLK_MAC_RX:
- case SCLK_MAC_TX:
- case SCLK_MACREF:
- case SCLK_MACREF_OUT:
- case ACLK_GMAC:
- case PCLK_GMAC:
- /* Required to successfully probe the Designware GMAC driver */
- return 0;
-
- case SCLK_USB3OTG0_REF:
- case SCLK_USB3OTG1_REF:
- case SCLK_USB3OTG0_SUSPEND:
- case SCLK_USB3OTG1_SUSPEND:
- case ACLK_USB3OTG0:
- case ACLK_USB3OTG1:
- case ACLK_USB3_RKSOC_AXI_PERF:
- case ACLK_USB3:
- case ACLK_USB3_GRF:
- /* Required to successfully probe the Designware USB3 driver */
- 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,
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
.set_parent = rk3399_clk_set_parent,
#endif
- .enable = rk3399_clk_enable,
};
#ifdef CONFIG_SPL_BUILD
diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
index 0270f3bc95..682a070306 100644
--- a/drivers/usb/host/ehci-generic.c
+++ b/drivers/usb/host/ehci-generic.c
@@ -96,7 +96,7 @@ static int ehci_usb_probe(struct udevice *dev)
if (err < 0)
break;
err = clk_enable(&priv->clocks[i]);
- if (err) {
+ if (err && err != -ENOSYS) {
dev_err(dev, "failed to enable clock %d\n", i);
clk_free(&priv->clocks[i]);
goto clk_err;
diff --git a/drivers/usb/host/ohci-generic.c b/drivers/usb/host/ohci-generic.c
index 24b5c3156f..916ea0b955 100644
--- a/drivers/usb/host/ohci-generic.c
+++ b/drivers/usb/host/ohci-generic.c
@@ -95,7 +95,7 @@ static int ohci_usb_probe(struct udevice *dev)
break;
err = clk_enable(&priv->clocks[i]);
- if (err) {
+ if (err && err != -ENOSYS) {
dev_err(dev, "failed to enable clock %d\n", i);
clk_free(&priv->clocks[i]);
goto clk_err;