From 1ade3a9013164eeeb4be32cbb92db85ba3506bd2 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Tue, 1 Aug 2017 09:40:04 +0800 Subject: [PATCH 1/8] rockchip: dts: rk3399-firefly: update gmac parameter Update the tx_delay and rx_delay to match the timing for rk3399-firefly board to improve the stability of gmac data transfer. Signed-off-by: Kever Yang Acked-by: Philipp Tomsich Reviewed-by: Philipp Tomsich --- arch/arm/dts/rk3399-firefly.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/dts/rk3399-firefly.dts b/arch/arm/dts/rk3399-firefly.dts index 3d3f507934..31e3ba8a47 100644 --- a/arch/arm/dts/rk3399-firefly.dts +++ b/arch/arm/dts/rk3399-firefly.dts @@ -211,8 +211,8 @@ snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; snps,reset-active-low; snps,reset-delays-us = <0 10000 50000>; - tx_delay = <0x28>; - rx_delay = <0x11>; + tx_delay = <0x33>; + rx_delay = <0x45>; status = "okay"; }; From b5c4d81b3507b3abb239ea8323515fce09dc378f Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Thu, 17 Aug 2017 10:06:59 +0200 Subject: [PATCH 2/8] spl: fix Makefile for NOR, XIP and YMODEM During the the conversion to $(SPL_TPL_), the SPL_ fragment was left over for the NOR, XIP and YMODEM boot methods in SPL, making these unselectable. This commit fixes this by dropping the spurious 'SPL_' fragment from each line. Signed-off-by: Philipp Tomsich Reported-by: Bo Shen Fixes: f94e643 (spl: consistently use $(SPL_TPL_) to select features for SPL and TPL builds) --- common/spl/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/spl/Makefile b/common/spl/Makefile index 112b3e6022..fde0d09a5a 100644 --- a/common/spl/Makefile +++ b/common/spl/Makefile @@ -12,9 +12,9 @@ ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_FRAMEWORK) += spl.o obj-$(CONFIG_$(SPL_TPL_)BOOTROM_SUPPORT) += spl_bootrom.o obj-$(CONFIG_$(SPL_TPL_)LOAD_FIT) += spl_fit.o -obj-$(CONFIG_$(SPL_TPL_)SPL_NOR_SUPPORT) += spl_nor.o -obj-$(CONFIG_$(SPL_TPL_)SPL_XIP_SUPPORT) += spl_xip.o -obj-$(CONFIG_$(SPL_TPL_)SPL_YMODEM_SUPPORT) += spl_ymodem.o +obj-$(CONFIG_$(SPL_TPL_)NOR_SUPPORT) += spl_nor.o +obj-$(CONFIG_$(SPL_TPL_)XIP_SUPPORT) += spl_xip.o +obj-$(CONFIG_$(SPL_TPL_)YMODEM_SUPPORT) += spl_ymodem.o ifndef CONFIG_SPL_UBI obj-$(CONFIG_$(SPL_TPL_)NAND_SUPPORT) += spl_nand.o obj-$(CONFIG_$(SPL_TPL_)ONENAND_SUPPORT) += spl_onenand.o From caa6b3b5308a031cf3021a7c169da222c0afe681 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Wed, 9 Aug 2017 18:51:30 +0800 Subject: [PATCH 3/8] rockchip: dts: rk3399-evb: remove redundant gmac node There are two same gmac node, remove one. Signed-off-by: Kever Yang Reviewed-by: Simon Glass Reviewed-by: Philipp Tomsich Acked-by: Philipp Tomsich --- arch/arm/dts/rk3399-evb.dts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/arch/arm/dts/rk3399-evb.dts b/arch/arm/dts/rk3399-evb.dts index bff00c3283..be0c6d98bd 100644 --- a/arch/arm/dts/rk3399-evb.dts +++ b/arch/arm/dts/rk3399-evb.dts @@ -276,19 +276,3 @@ rx_delay = <0x10>; status = "okay"; }; - -&gmac { - phy-supply = <&vcc_phy>; - phy-mode = "rgmii"; - clock_in_out = "input"; - snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; - snps,reset-active-low; - snps,reset-delays-us = <0 10000 50000>; - assigned-clocks = <&cru SCLK_RMII_SRC>; - assigned-clock-parents = <&clkin_gmac>; - pinctrl-names = "default"; - pinctrl-0 = <&rgmii_pins>; - tx_delay = <0x10>; - rx_delay = <0x10>; - status = "okay"; -}; From a299a4879e4da3d4dfa9b7ee555978e67bcf1335 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Wed, 16 Aug 2017 19:24:02 +0200 Subject: [PATCH 4/8] rockchip: rk3399: spl: remove unused header inclusion fdtdec.h is included, but not used in rk3399-board-spl.c: remove the '#include'-statement. Signed-off-by: Philipp Tomsich --- arch/arm/mach-rockchip/rk3399-board-spl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c index a13b717bbd..d6bf74f7ad 100644 --- a/arch/arm/mach-rockchip/rk3399-board-spl.c +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include From 44c5ba557bee98ec531715d3f04e9ede5599d18e Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Fri, 21 Jul 2017 18:21:07 +0800 Subject: [PATCH 5/8] rockchip: rk322x: update dram bank size The DRAM start address is not 0, so need to update the last bank size as: DRAM start addr + DRAM_SIZE - last bank start addr Signed-off-by: Kever Yang Acked-by: Philipp Tomsich Reviewed-by: Philipp Tomsich Reviewed-by: Simon Glass --- arch/arm/mach-rockchip/rk322x-board.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-rockchip/rk322x-board.c b/arch/arm/mach-rockchip/rk322x-board.c index 1e79c19309..c0ac2e9b56 100644 --- a/arch/arm/mach-rockchip/rk322x-board.c +++ b/arch/arm/mach-rockchip/rk322x-board.c @@ -72,11 +72,13 @@ int board_init(void) int dram_init_banksize(void) { - /* Reserve 0x200000 for OPTEE */ - gd->bd->bi_dram[0].start = 0x60000000; + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->bd->bi_dram[0].size = 0x8400000; - gd->bd->bi_dram[1].start = 0x6a400000; - gd->bd->bi_dram[1].size = gd->ram_size - gd->bd->bi_dram[1].start; + /* Reserve 0x200000 for OPTEE */ + gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE + + gd->bd->bi_dram[0].size + 0x200000; + gd->bd->bi_dram[1].size = gd->bd->bi_dram[0].start + + gd->ram_size - gd->bd->bi_dram[1].start; return 0; } From a80b3b0378fdd700649124cb2f9cfe8c58390b73 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Thu, 3 Aug 2017 20:07:45 +0800 Subject: [PATCH 6/8] rockchip: rk322x: update MACRO for mmc clksel reg The description for eMMC/SDIO/SDMMC src is not correct, update the CRU_CLKSEL11_CON value definition according to TRM. Signed-off-by: Kever Yang Acked-by: Philipp Tomsich Reviewed-by: Philipp Tomsich --- arch/arm/include/asm/arch-rockchip/cru_rk322x.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/cru_rk322x.h b/arch/arm/include/asm/arch-rockchip/cru_rk322x.h index 2a2f804f67..a7999ca5af 100644 --- a/arch/arm/include/asm/arch-rockchip/cru_rk322x.h +++ b/arch/arm/include/asm/arch-rockchip/cru_rk322x.h @@ -162,20 +162,17 @@ enum { /* CRU_CLKSEL11_CON */ EMMC_PLL_SHIFT = 12, EMMC_PLL_MASK = 3 << EMMC_PLL_SHIFT, - EMMC_SEL_APLL = 0, - EMMC_SEL_DPLL, + EMMC_SEL_CPLL = 0, EMMC_SEL_GPLL, EMMC_SEL_24M, SDIO_PLL_SHIFT = 10, SDIO_PLL_MASK = 3 << SDIO_PLL_SHIFT, - SDIO_SEL_APLL = 0, - SDIO_SEL_DPLL, + SDIO_SEL_CPLL = 0, SDIO_SEL_GPLL, SDIO_SEL_24M, MMC0_PLL_SHIFT = 8, MMC0_PLL_MASK = 3 << MMC0_PLL_SHIFT, - MMC0_SEL_APLL = 0, - MMC0_SEL_DPLL, + MMC0_SEL_CPLL = 0, MMC0_SEL_GPLL, MMC0_SEL_24M, MMC0_DIV_SHIFT = 0, From a634236b8d571df7db35ae70bd9a0573fbbec8d2 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Thu, 17 Aug 2017 15:17:35 +0800 Subject: [PATCH 7/8] rockchip: rk322x: pinctrl: using compatible name same with dts The dts from kernel is using rk3228-pinctrl as compatible name, need to sync with it to make the driver work. Signed-off-by: Kever Yang Reviewed-by: Philipp Tomsich --- drivers/pinctrl/rockchip/pinctrl_rk322x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/rockchip/pinctrl_rk322x.c b/drivers/pinctrl/rockchip/pinctrl_rk322x.c index 7aaf4b5801..d9f8614810 100644 --- a/drivers/pinctrl/rockchip/pinctrl_rk322x.c +++ b/drivers/pinctrl/rockchip/pinctrl_rk322x.c @@ -279,12 +279,12 @@ static int rk322x_pinctrl_probe(struct udevice *dev) } static const struct udevice_id rk322x_pinctrl_ids[] = { - { .compatible = "rockchip,rk322x-pinctrl" }, + { .compatible = "rockchip,rk3228-pinctrl" }, { } }; -U_BOOT_DRIVER(pinctrl_rk322x) = { - .name = "pinctrl_rk322x", +U_BOOT_DRIVER(pinctrl_rk3228) = { + .name = "pinctrl_rk3228", .id = UCLASS_PINCTRL, .of_match = rk322x_pinctrl_ids, .priv_auto_alloc_size = sizeof(struct rk322x_pinctrl_priv), From 957b4ee3f3114663f120f5003d14e4fa366198fd Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Thu, 17 Aug 2017 15:17:36 +0800 Subject: [PATCH 8/8] rockchip: rk322x: pinctrl: fix IO MASK error on sdcard pin Fix the IOMUX setting for SDcard CMD pin at the same time. Signed-off-by: Kever Yang Reviewed-by: Philipp Tomsich --- drivers/pinctrl/rockchip/pinctrl_rk322x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/rockchip/pinctrl_rk322x.c b/drivers/pinctrl/rockchip/pinctrl_rk322x.c index d9f8614810..576b03739f 100644 --- a/drivers/pinctrl/rockchip/pinctrl_rk322x.c +++ b/drivers/pinctrl/rockchip/pinctrl_rk322x.c @@ -168,7 +168,7 @@ static void pinctrl_rk322x_sdmmc_config(struct rk322x_grf *grf, int mmc_id) rk_clrsetreg(&grf->gpio1b_iomux, GPIO1B6_MASK | GPIO1B7_MASK, GPIO1B6_SDMMC_PWREN << GPIO1B6_SHIFT | - GPIO1B7_SDMMC_CMD << GPIO1B6_SHIFT); + GPIO1B7_SDMMC_CMD << GPIO1B7_SHIFT); rk_clrsetreg(&grf->gpio1c_iomux, 0xfff, GPIO1C5_SDMMC_D3 << GPIO1C5_SHIFT | GPIO1C4_SDMMC_D2 << GPIO1C4_SHIFT |