- add idbloader.img target for rockchip tpl+spl;
- usb ehci/ohci: go on process if clock driver don't have clk_enable();
- remove clk_enable() for rockchip clock drivers;
- add boot order for rockpro64
This commit is contained in:
Tom Rini 2019-09-11 23:08:34 -04:00
commit 5ba8b12543
11 changed files with 24 additions and 121 deletions

View File

@ -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)

View File

@ -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>;

View File

@ -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/

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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;

View File

@ -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;