rk3188 uboot support
Subsystems (8)
Heiko Stuebner
maintainerv4 cover rk3188 uboot support
Hi,
thanks to Kever finding the needle in the haystack (wrong resets in sdram driver actually resetting the sdmmc controller) the rk3188 can now actually load uboot into memory from spl ... yay .
So this v4 does hopefully addresses all last review comments from Simon and includes of course the newly received tags so far.
Heiko
Heiko Stuebner (21):
dm: allow limiting pre-reloc markings to spl or tpl
clk: rk3288: limit gpll and cpll init to SPL build
rockchip: rk3288: sdram: use constants in ddrconf table
rockchip: rk3288: sdram: style fixes from rk3188 sdram review
rockchip: Move bootrom helper compilation to a hidden option
rockchip: Move bootrom-related declarations to a header
rockchip: mkimage: Allow encoding of loader code in spl images
rockchip: mkimage: Add support rk3188 serial
rockchip: serial: Adapt rockchip of-platdata driver for rk3188
rockchip: rk3188: Add header files for PMU and GRF
rockchip: rk3188: Add pinctrl driver
rockchip: rk3188: Add sysreset driver
rockchip: rk3188: Add rk3066/rk3188 clock bindings
rockchip: rk3188: Add clock driver
rockchip: rk3188: Add core devicetree files
rockchip: rk3188: Add core support
rockchip: rk3188: Add sdram driver
rockchip: rk3188: Add main, spl and tpl boards
rockchip: rk3188: Add Radxa Rock board
rockchip: rk3188: add README.rockchip paragraph describing sd boot Add a temporary script that can create a bootimage for rk3188
arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3188-radxarock.dts | 382 +++++++++ arch/arm/dts/rk3188.dtsi | 601 ++++++++++++++ arch/arm/dts/rk3xxx.dtsi | 417 ++++++++++ arch/arm/include/asm/arch-rockchip/bootrom.h | 22 + arch/arm/include/asm/arch-rockchip/cru_rk3188.h | 191 +++++ arch/arm/include/asm/arch-rockchip/ddr_rk3188.h | 25 + arch/arm/include/asm/arch-rockchip/ddr_rk3288.h | 8 + arch/arm/include/asm/arch-rockchip/grf_rk3188.h | 589 ++++++++++++++ arch/arm/include/asm/arch-rockchip/pmu_rk3188.h | 36 + arch/arm/mach-rockchip/Kconfig | 20 + arch/arm/mach-rockchip/Makefile | 14 +- arch/arm/mach-rockchip/rk3036-board-spl.c | 3 +- arch/arm/mach-rockchip/rk3188-board-spl.c | 218 ++++++ arch/arm/mach-rockchip/rk3188-board-tpl.c | 86 ++ arch/arm/mach-rockchip/rk3188-board.c | 71 ++ arch/arm/mach-rockchip/rk3188/Kconfig | 35 + arch/arm/mach-rockchip/rk3188/Makefile | 11 + arch/arm/mach-rockchip/rk3188/clk_rk3188.c | 33 + arch/arm/mach-rockchip/rk3188/sdram_rk3188.c | 995 ++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3188/syscon_rk3188.c | 55 ++ arch/arm/mach-rockchip/rk3288-board-spl.c | 3 +- arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 59 +- board/radxa/rock/Kconfig | 15 + board/radxa/rock/MAINTAINERS | 6 + board/radxa/rock/Makefile | 7 + board/radxa/rock/rock.c | 7 + configs/rock_defconfig | 56 ++ doc/README.rockchip | 26 + doc/driver-model/README.txt | 4 + drivers/clk/at91/pmc.c | 3 +- drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk_rk3188.c | 527 +++++++++++++ drivers/clk/rockchip/clk_rk3288.c | 2 + drivers/core/root.c | 2 +- drivers/core/util.c | 25 + drivers/pinctrl/Kconfig | 9 + drivers/pinctrl/pinctrl-uclass.c | 3 +- drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl_rk3188.c | 611 +++++++++++++++ drivers/serial/serial_rockchip.c | 19 +- drivers/sysreset/Makefile | 1 + drivers/sysreset/sysreset_rk3188.c | 47 ++ include/configs/rk3188_common.h | 125 +++ include/configs/rock.h | 30 + include/dm/util.h | 26 + include/dt-bindings/clock/rk3066a-cru.h | 32 + include/dt-bindings/clock/rk3188-cru-common.h | 256 ++++++ include/dt-bindings/clock/rk3188-cru.h | 48 ++ mkuboot | 35 + scripts/Makefile.spl | 7 +- tools/dtoc/dtoc.py | 2 + tools/rkcommon.c | 34 +- tools/rkcommon.h | 22 + tools/rkimage.c | 3 + tools/rksd.c | 4 + tools/rkspi.c | 4 + 57 files changed, 5833 insertions(+), 42 deletions(-) create mode 100644 arch/arm/dts/rk3188-radxarock.dts create mode 100644 arch/arm/dts/rk3188.dtsi create mode 100644 arch/arm/dts/rk3xxx.dtsi create mode 100644 arch/arm/include/asm/arch-rockchip/bootrom.h create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/ddr_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/pmu_rk3188.h create mode 100644 arch/arm/mach-rockchip/rk3188-board-spl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board-tpl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board.c create mode 100644 arch/arm/mach-rockchip/rk3188/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3188/Makefile create mode 100644 arch/arm/mach-rockchip/rk3188/clk_rk3188.c create mode 100644 arch/arm/mach-rockchip/rk3188/sdram_rk3188.c create mode 100644 arch/arm/mach-rockchip/rk3188/syscon_rk3188.c create mode 100644 board/radxa/rock/Kconfig create mode 100644 board/radxa/rock/MAINTAINERS create mode 100644 board/radxa/rock/Makefile create mode 100644 board/radxa/rock/rock.c create mode 100644 configs/rock_defconfig create mode 100644 drivers/clk/rockchip/clk_rk3188.c create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3188.c create mode 100644 drivers/sysreset/sysreset_rk3188.c create mode 100644 include/configs/rk3188_common.h create mode 100644 include/configs/rock.h create mode 100644 include/dt-bindings/clock/rk3066a-cru.h create mode 100644 include/dt-bindings/clock/rk3188-cru-common.h create mode 100644 include/dt-bindings/clock/rk3188-cru.h create mode 100755 mkuboot
Signature · 1 line
2.11.0
Heiko Stuebner
maintainerPATCH v4 1/20 dm: allow limiting pre-reloc markings to spl or tpl
Right now the u-boot,dm-pre-reloc flag will make each marked node always appear in both spl and tpl. But systems needing an additional tpl might have special constraints for each, like the spl needing to be very tiny.
So introduce two additional flags to mark nodes for only spl or tpl environments and introduce a function dm_fdt_pre_reloc to automate the necessary checks in code instances checking for pre-relocation flags.
The behaviour of the original flag stays untouched and still marks a node for both spl and tpl.
--- doc/driver-model/README.txt | 4 ++++ drivers/clk/at91/pmc.c | 3 ++- drivers/core/root.c | 2 +- drivers/core/util.c | 25 +++++++++++++++++++++++++ drivers/pinctrl/pinctrl-uclass.c | 3 ++- include/dm/util.h | 26 ++++++++++++++++++++++++++ scripts/Makefile.spl | 7 ++++++- tools/dtoc/dtoc.py | 2 ++ 8 files changed, 68 insertions(+), 4 deletions(-)
doc/driver-model/README.txt +4 -0
@@ -825,6 +825,10 @@ drivers marked with DM_FLAG_PRE_RELOC or the device tree 'u-boot,dm-pre-reloc' flag are initialised prior to relocation. This helps to reduce the driver model overhead. +It is possible to limit this to specific relocation steps, by using +the more specialized 'u-boot,dm-spl' and 'u-boot,dm-tpl' flags +in the devicetree. + Then post relocation we throw that away and re-init driver model again. For drivers which require some sort of continuity between pre- and post-relocation devices, we can provide access to the pre-relocation
drivers/clk/at91/pmc.c +2 -1
@@ -10,6 +10,7 @@#include <dm/device.h> #include <dm/lists.h> #include <dm/root.h> +#include <dm/util.h> #include "pmc.h" DECLARE_GLOBAL_DATA_PTR ;
@@ -56,7 +57,7 @@ int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name) offset >0 ; offset = fdt_next_subnode(fdt, offset)) {if (pre_reloc_only && - !fdt_getprop (fdt, offset,"u-boot,dm-pre-reloc" ,NULL )) + !dm_fdt_pre_reloc (fdt, offset))continue ;/* * If this node has "compatible" property, this is not
drivers/core/root.c +1 -1
@@ -205,7 +205,7 @@ int dm_scan_fdt_node(struct udevice *parent, const void *blob, int offset, offset >0 ; offset = fdt_next_subnode(blob, offset)) {if (pre_reloc_only && - !fdt_getprop (blob, offset,"u-boot,dm-pre-reloc" ,NULL )) + !dm_fdt_pre_reloc (blob, offset))continue ;if (!fdtdec_get_is_enabled (blob, offset)) {dm_dbg (" - ignoring disabled device\n" );
drivers/core/util.c +25 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <libfdt.h> #include <vsprintf.h> void dm_warn (const char *fmt, ...)
@@ -35,3 +36,27 @@ int list_count_items(struct list_head *head)return count; } + +int dm_fdt_pre_reloc (const void *blob,int offset) +{ +if (fdt_getprop (blob, offset,"u-boot,dm-pre-reloc" ,NULL )) +return 1 ; + +#ifdef CONFIG_TPL_BUILD +if (fdt_getprop (blob, offset,"u-boot,dm-tpl" ,NULL )) +return 1 ; +#elif defined(CONFIG_SPL_BUILD ) +if (fdt_getprop (blob, offset,"u-boot,dm-spl" ,NULL )) +return 1 ; +#else +/* +* In regular builds individual spl and tpl handling both +* count as handled pre-relocation for later second init. +*/ +if (fdt_getprop (blob, offset,"u-boot,dm-spl" ,NULL ) || +fdt_getprop (blob, offset,"u-boot,dm-tpl" ,NULL )) +return 1 ; +#endif + +return 0 ; +}
drivers/pinctrl/pinctrl-uclass.c +2 -1
@@ -12,6 +12,7 @@#include <dm/lists.h> #include <dm/pinctrl.h> #include <dm/uclass.h> +#include <dm/util.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -131,7 +132,7 @@ static int pinconfig_post_bind(struct udevice *dev) offset >0 ; offset = fdt_next_subnode(fdt, offset)) {if (pre_reloc_only && - !fdt_getprop (fdt, offset,"u-boot,dm-pre-reloc" ,NULL )) + !dm_fdt_pre_reloc (fdt, offset))continue ;/* * If this node has "compatible" property, this is not
include/dm/util.h +26 -0
@@ -48,4 +48,30 @@ static inline void dm_dump_devres(void) }#endif +/** +* Check if a dt node should be or was bound before relocation. +* +* Devicetree nodes can be marked as needed to be bound +* in the loader stages via special devicetree properties. +* +* Before relocation this function can be used to check if nodes +* are required in either SPL or TPL stages. +* +* After relocation and jumping into the real U-Boot binary +* it is possible to determine if a node was bound in one of +* SPL/TPL stages. +* +* There are 3 settings currently in use +* - +* - u-boot,dm-pre-reloc: legacy and indicates any of TPL or SPL +* Existing platforms only use it to indicate nodes needee in +* SPL. Should probably be replaced by u-boot,dm-spl for +* existing platforms. +* @blob: devicetree +* @offset: node offset +* +* Returns true if node is needed in SPL/TL, false otherwise. +*/ +int dm_fdt_pre_reloc (const void *blob,int offset); +#endif
scripts/Makefile.spl +6 -1
@@ -206,8 +206,13 @@ $(obj)/$(SPL_BIN)-pad.bin: $(obj)/$(SPL_BIN) # 'u-boot,dm-pre-reloc' property and thus are not needed by SPL. The second # pass removes various unused properties from the remaining nodes. # The output is typically a much smaller device tree file. +ifeq ($(CONFIG_TPL_BUILD),y) +fdtgrep_props := -b u-boot,dm-pre-reloc -b u-boot,dm-tpl +else +fdtgrep_props := -b u-boot,dm-pre-reloc -b u-boot,dm-spl +endif quiet_cmd_fdtgrep = FDTGREP $@ - cmd_fdtgrep = $(objtree)/tools/fdtgrep -b u-boot,dm-pre-reloc -RT $< \ + cmd_fdtgrep = $(objtree)/tools/fdtgrep $(fdtgrep_props) -RT $< \ -n /chosen -O dtb | \ $(objtree)/tools/fdtgrep -r -O dtb - -o $@ \ $(addprefix -P ,$(subst $\",,$(CONFIG_OF_SPL_REMOVE_PROPS)))
tools/dtoc/dtoc.py +2 -0
@@ -30,6 +30,8 @@ PROP_IGNORE_LIST = [ "status", 'phandle', 'u-boot,dm-pre-reloc', + 'u-boot,dm-tpl', + 'u-boot,dm-spl', ] # C type declarations for the tyues we support
Signature · 1 line
2.11.0
PATCH v4 1/20 dm: allow limiting pre-reloc markings to spl or tpl
Quoted 16 lines · Heiko Stuebner
Right now the u-boot,dm-pre-reloc flag will make each marked node always appear in both spl and tpl. But systems needing an additional tpl might have special constraints for each, like the spl needing to be very tiny.
So introduce two additional flags to mark nodes for only spl or tpl environments and introduce a function
dm_fdt_pre_relocto automate the necessary checks in code instances checking for pre-relocation flags.The behaviour of the original flag stays untouched and still marks a node for both spl and tpl.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>
Quoted 10 lines
--- doc/driver-model/README.txt | 4 ++++ drivers/clk/at91/pmc.c | 3 ++- drivers/core/root.c | 2 +- drivers/core/util.c | 25 +++++++++++++++++++++++++ drivers/pinctrl/pinctrl-uclass.c | 3 ++- include/dm/util.h | 26 ++++++++++++++++++++++++++ scripts/Makefile.spl | 7 ++++++- tools/dtoc/dtoc.py | 2 ++ 8 files changed, 68 insertions(+), 4 deletions(-)
Applied to u-boot-rockchip, thanks!
(One little nit I forgot to mention might be worth a follow-up patch:dm_fdt_pre_reloc() docs say true/false, so the function should probably return true/false rather than 1/0)
Heiko Stuebner
maintainerPATCH v4 2/20 clk: rk3288: limit gpll and cpll init to SPL build
In reply to Heiko StuebnerThe gpll and cpll init values are only used in rk_clk_init in the SPL and therefore produce compile time warnings in regular uboot builds. Fix that with an #ifdef.
--- drivers/clk/rockchip/clk_rk3288.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/rockchip/clk_rk3288.c +2 -0
@@ -131,8 +131,10 @@ enum {/* Keep divisors as low as possible to reduce jitter and power usage */ static const struct pll_div apll_init_cfg =PLL_DIVISORS (APLL_HZ ,1 ,1 ); +#ifdef CONFIG_SPL_BUILD static const struct pll_div gpll_init_cfg =PLL_DIVISORS (GPLL_HZ ,2 ,2 );static const struct pll_div cpll_init_cfg =PLL_DIVISORS (CPLL_HZ ,1 ,2 ); +#endif static int rkclk_set_pll (struct rk3288_cru *cru,enum rk_clk_id clk_id,const struct pll_div *div)
Signature · 1 line
2.11.0
PATCH v4 2/20 clk: rk3288: limit gpll and cpll init to SPL build
Quoted 8 lines · Heiko Stuebner
The gpll and cpll init values are only used in
rk_clk_initin the SPL and therefore produce compile time warnings in regular uboot builds. Fix that with an #ifdef.Signed-off-by Heiko Stuebner <[email protected]>--- drivers/clk/rockchip/clk_rk3288.c | 2 ++ 1 file changed, 2 insertions(+)
PATCH v4 2/20 clk: rk3288: limit gpll and cpll init to SPL build
Quoted 11 lines · Simon Glass
Quoted 8 lines · Heiko Stuebner
The gpll and cpll init values are only used in
rk_clk_initin the SPL and therefore produce compile time warnings in regular uboot builds. Fix that with an #ifdef.Signed-off-by Heiko Stuebner <[email protected]>--- drivers/clk/rockchip/clk_rk3288.c | 2 ++ 1 file changed, 2 insertions(+)Acked-by Simon Glass <[email protected]>
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 3/20 rockchip: rk3288: sdram: use constants in ddrconf table
In reply to Heiko StuebnerUse defines to describe the bit shifts used to create the table for ddrconf register values.
--- arch/arm/include/asm/arch-rockchip/ddr_rk3288.h | 8 ++++++++ arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-)
arch/arm/include/asm/arch-rockchip/ddr_rk3288.h +8 -0
@@ -425,6 +425,14 @@ enum {#define START_CMD (1u << 31) +/* +* DDRCONF +* [5:4] row(13+n) +* [1:0] col(9+n), assume bw=2 +*/ +#define DDRCONF_ROW_SHIFT 4 +#define DDRCONF_COL_SHIFT 0 +/* DEVTODEV */ #define BUSWRTORD_SHIFT 4#define BUSRDTOWR_SHIFT 2
arch/arm/mach-rockchip/rk3288/sdram_rk3288.c +10 -10
@@ -596,16 +596,16 @@ static void dram_all_config(const struct dram_info *dram,const int ddrconf_table[] = {/* row col,bw */ 0 , - ((1 <<4 ) |1 ), - ((2 <<4 ) |1 ), - ((3 <<4 ) |1 ), - ((4 <<4 ) |1 ), - ((1 <<4 ) |2 ), - ((2 <<4 ) |2 ), - ((3 <<4 ) |2 ), - ((1 <<4 ) |0 ), - ((2 <<4 ) |0 ), - ((3 <<4 ) |0 ), + ((1 <<DDRCONF_ROW_SHIFT ) |1 <<DDRCONF_COL_SHIFT ), + ((2 <<DDRCONF_ROW_SHIFT ) |1 <<DDRCONF_COL_SHIFT ), + ((3 <<DDRCONF_ROW_SHIFT ) |1 <<DDRCONF_COL_SHIFT ), + ((4 <<DDRCONF_ROW_SHIFT ) |1 <<DDRCONF_COL_SHIFT ), + ((1 <<DDRCONF_ROW_SHIFT ) |2 <<DDRCONF_COL_SHIFT ), + ((2 <<DDRCONF_ROW_SHIFT ) |2 <<DDRCONF_COL_SHIFT ), + ((3 <<DDRCONF_ROW_SHIFT ) |2 <<DDRCONF_COL_SHIFT ), + ((1 <<DDRCONF_ROW_SHIFT ) |0 <<DDRCONF_COL_SHIFT ), + ((2 <<DDRCONF_ROW_SHIFT ) |0 <<DDRCONF_COL_SHIFT ), + ((3 <<DDRCONF_ROW_SHIFT ) |0 <<DDRCONF_COL_SHIFT ),0 ,0 ,0 ,
Signature · 1 line
2.11.0
PATCH v4 3/20 rockchip: rk3288: sdram: use constants in ddrconf table
Quoted 8 lines · Heiko Stuebner
Use defines to describe the bit shifts used to create the table for ddrconf register values.
Signed-off-by Heiko Stuebner <[email protected]>--- arch/arm/include/asm/arch-rockchip/ddr_rk3288.h | 8 ++++++++ arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-)
PATCH v4 3/20 rockchip: rk3288: sdram: use constants in ddrconf table
Quoted 11 lines · Simon Glass
Quoted 8 lines · Heiko Stuebner
Use defines to describe the bit shifts used to create the table for ddrconf register values.
Signed-off-by Heiko Stuebner <[email protected]>--- arch/arm/include/asm/arch-rockchip/ddr_rk3288.h | 8 ++++++++ arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-)Acked-by Simon Glass <[email protected]>
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 4/20 rockchip: rk3288: sdram: style fixes from rk3188 sdram review
In reply to Heiko StuebnerThe sdram IP blocks used on rk3066, rk3188 and rk3288 are very similar and we want to unify things once all 3 work as expected. Therefore try to keep the rk3288 sdram driver in line by applying the general review comments received for the rk3188 variant to it as well.
--- arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 59 +++++++++++++++------------- 1 file changed, 31 insertions(+), 28 deletions(-)
arch/arm/mach-rockchip/rk3288/sdram_rk3288.c +31 -28
@@ -57,6 +57,26 @@ struct rk3288_sdram_params {struct regmap *map; }; +const int ddrconf_table[] = { +/* row col,bw */ +0 , + ((1 <<DDRCONF_ROW_SHIFT ) |1 <<DDRCONF_COL_SHIFT ), + ((2 <<DDRCONF_ROW_SHIFT ) |1 <<DDRCONF_COL_SHIFT ), + ((3 <<DDRCONF_ROW_SHIFT ) |1 <<DDRCONF_COL_SHIFT ), + ((4 <<DDRCONF_ROW_SHIFT ) |1 <<DDRCONF_COL_SHIFT ), + ((1 <<DDRCONF_ROW_SHIFT ) |2 <<DDRCONF_COL_SHIFT ), + ((2 <<DDRCONF_ROW_SHIFT ) |2 <<DDRCONF_COL_SHIFT ), + ((3 <<DDRCONF_ROW_SHIFT ) |2 <<DDRCONF_COL_SHIFT ), + ((1 <<DDRCONF_ROW_SHIFT ) |0 <<DDRCONF_COL_SHIFT ), + ((2 <<DDRCONF_ROW_SHIFT ) |0 <<DDRCONF_COL_SHIFT ), + ((3 <<DDRCONF_ROW_SHIFT ) |0 <<DDRCONF_COL_SHIFT ), +0 , +0 , +0 , +0 , + ((4 <<4 ) |2 ), +}; +#define TEST_PATTEN 0x5aa5f00f#define DQS_GATE_TRAINING_ERROR_RANK0 (1 << 4)#define DQS_GATE_TRAINING_ERROR_RANK1 (2 << 4)
@@ -100,7 +120,7 @@ static void ddr_phy_ctl_reset(struct rk3288_cru *cru, u32 ch, u32 n)static void phy_pctrl_reset (struct rk3288_cru *cru,struct rk3288_ddr_publ *publ, -u32 channel) +int channel) {int i;
@@ -126,6 +146,7 @@ static void phy_dll_bypass_set(struct rk3288_ddr_publ *publ, u32 freq) {int i; +if (freq <=250000000 ) {if (freq <=150000000 )clrbits_le32 (&publ->dllgcr,SBIAS_BYPASS );
@@ -217,7 +238,7 @@ static void ddr_set_en_bst_odt(struct rk3288_grf *grf, uint channel, UPCTL0_LPDDR3_ODT_EN_SHIFT)); } -static void pctl_cfg (u32 channel,struct rk3288_ddr_pctl *pctl, +static void pctl_cfg (int channel,struct rk3288_ddr_pctl *pctl,struct rk3288_sdram_params *sdram_params,struct rk3288_grf *grf) {
@@ -267,7 +288,7 @@ static void pctl_cfg(u32 channel, struct rk3288_ddr_pctl *pctl,setbits_le32 (&pctl->scfg,1 ); } -static void phy_cfg (const struct chan_info *chan,u32 channel, +static void phy_cfg (const struct chan_info *chan,int channel,struct rk3288_sdram_params *sdram_params) {struct rk3288_ddr_publ *publ = chan->publ;
@@ -392,7 +413,8 @@ static void move_to_config_state(struct rk3288_ddr_publ *publ,while ((readl (&publ->pgsr) &PGSR_DLDONE ) !=PGSR_DLDONE ) ; -/* if at low power state,need wakeup first, +/* +* if at low power state,need wakeup first, * and then enter the config * so here no break. */
@@ -411,7 +433,7 @@ static void move_to_config_state(struct rk3288_ddr_publ *publ, } } -static void set_bandwidth_ratio (const struct chan_info *chan,u32 channel, +static void set_bandwidth_ratio (const struct chan_info *chan,int channel,u32 n,struct rk3288_grf *grf) {struct rk3288_ddr_pctl *pctl = chan->pctl;
@@ -449,7 +471,7 @@ static void set_bandwidth_ratio(const struct chan_info *chan, u32 channel,setbits_le32 (&pctl->dfistcfg0,1 <<2 ); } -static int data_training (const struct chan_info *chan,u32 channel, +static int data_training (const struct chan_info *chan,int channel,struct rk3288_sdram_params *sdram_params) {unsigned int j;
@@ -593,25 +615,6 @@ static void dram_all_config(const struct dram_info *dram,writel (sys_reg, &dram->pmu->sys_reg[2 ]);rk_clrsetreg (&dram->sgrf->soc_con2,0x1f , sdram_params->base.stride); } -const int ddrconf_table[] = { -/* row col,bw */ -0 , - ((1 <<DDRCONF_ROW_SHIFT ) |1 <<DDRCONF_COL_SHIFT ), - ((2 <<DDRCONF_ROW_SHIFT ) |1 <<DDRCONF_COL_SHIFT ), - ((3 <<DDRCONF_ROW_SHIFT ) |1 <<DDRCONF_COL_SHIFT ), - ((4 <<DDRCONF_ROW_SHIFT ) |1 <<DDRCONF_COL_SHIFT ), - ((1 <<DDRCONF_ROW_SHIFT ) |2 <<DDRCONF_COL_SHIFT ), - ((2 <<DDRCONF_ROW_SHIFT ) |2 <<DDRCONF_COL_SHIFT ), - ((3 <<DDRCONF_ROW_SHIFT ) |2 <<DDRCONF_COL_SHIFT ), - ((1 <<DDRCONF_ROW_SHIFT ) |0 <<DDRCONF_COL_SHIFT ), - ((2 <<DDRCONF_ROW_SHIFT ) |0 <<DDRCONF_COL_SHIFT ), - ((3 <<DDRCONF_ROW_SHIFT ) |0 <<DDRCONF_COL_SHIFT ), -0 , -0 , -0 , -0 , - ((4 <<4 ) |2 ), -};static int sdram_rank_bw_detect (struct dram_info *dram,int channel,struct rk3288_sdram_params *sdram_params)
@@ -621,12 +624,12 @@ static int sdram_rank_bw_detect(struct dram_info *dram, int channel,const struct chan_info *chan = &dram->chan[channel];struct rk3288_ddr_publ *publ = chan->publ; -if (-1 ==data_training (chan, channel, sdram_params)) { +if (data_training (chan, channel, sdram_params) <0 ) { reg =readl (&publ->datx8[0 ].dxgsr[0 ]);/* Check the result for rank 0 */ if ((channel ==0 ) && (reg &DQS_GATE_TRAINING_ERROR_RANK0 )) {debug ("data training fail!\n" ); -return -EIO ; +return -EIO ; }else if ((channel ==1 ) && (reg &DQS_GATE_TRAINING_ERROR_RANK0 )) { sdram_params->num_channels =1 ;
@@ -652,7 +655,7 @@ static int sdram_rank_bw_detect(struct dram_info *dram, int channel, sdram_params->ch[channel].dbw = sdram_params->ch[channel].bw;if (need_trainig && - (-1 ==data_training (chan, channel, sdram_params))) { + (data_training (chan, channel, sdram_params) <0 )) {if (sdram_params->base.dramtype ==LPDDR3 ) {ddr_phy_ctl_reset (dram->cru, channel,1 );udelay (10 );
Signature · 1 line
2.11.0
PATCH v4 4/20 rockchip: rk3288: sdram: style fixes from rk3188 sdram review
Quoted 9 lines · Heiko Stuebner
The sdram IP blocks used on rk3066, rk3188 and rk3288 are very similar and we want to unify things once all 3 work as expected. Therefore try to keep the rk3288 sdram driver in line by applying the general review comments received for the rk3188 variant to it as well.
Signed-off-by Heiko Stuebner <[email protected]>--- arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 59 +++++++++++++++------------- 1 file changed, 31 insertions(+), 28 deletions(-)
PATCH v4 4/20 rockchip: rk3288: sdram: style fixes from rk3188 sdram review
Quoted 6 lines · Simon Glass
Quoted 5 lines · Heiko Stuebner
The sdram IP blocks used on rk3066, rk3188 and rk3288 are very similar and we want to unify things once all 3 work as expected. Therefore try to keep the rk3288 sdram driver in line by applying the general review comments received for the rk3188 variant to it as well.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Heiko Stuebner <[email protected]>--- arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 59 +++++++++++++++------------- 1 file changed, 31 insertions(+), 28 deletions(-)Acked-by Simon Glass <[email protected]>
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 5/20 rockchip: Move bootrom helper compilation to a hidden option
In reply to Heiko StuebnerRight now the ROCKCHIP_SPL_BACK_TO_BROM option both triggers compilation of the bootrom hook-code as well as enabling the behaviour of loading the full U-Boot via the boot.
New added socs may always need the bootrom code, while still being able to decide between loading U-Boot regularly or via the bootrom separately.
So move the compilation of the bootrom code to a hidden option that gets selected by ROCKCHIP_SPL_BACK_TO_BROM, but can also be selected by other parts.
--- arch/arm/mach-rockchip/Kconfig | 4 ++++ arch/arm/mach-rockchip/Makefile | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
arch/arm/mach-rockchip/Kconfig +4 -0
@@ -37,11 +37,15 @@ config ROCKCHIP_RK3399 config ROCKCHIP_SPL_BACK_TO_BROM bool "SPL returns to bootrom" default y if ROCKCHIP_RK3036 + select ROCKCHIP_BROM_HELPER help Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled, SPL will return to the boot rom, which will then load the U-Boot binary to keep going on. +config ROCKCHIP_BROM_HELPER + bool + config SPL_MMC_SUPPORT default y if !ROCKCHIP_SPL_BACK_TO_BROM
arch/arm/mach-rockchip/Makefile +1 -1
@@ -7,7 +7,7 @@ ifdef CONFIG_SPL_BUILD obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-spl.o -obj-$(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM) += save_boot_param.o +obj-$(CONFIG_ROCKCHIP_BROM_HELPER) += save_boot_param.o else obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board.o obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board.o
Signature · 1 line
2.11.0
PATCH v4 5/20 rockchip: Move bootrom helper compilation to a hidden option
Quoted 12 lines · Heiko Stuebner
Right now the
ROCKCHIP_SPL_BACK_TO_BROMoption both triggers compilation of the bootrom hook-code as well as enabling the behaviour of loading the full U-Boot via the boot.New added socs may always need the bootrom code, while still being able to decide between loading U-Boot regularly or via the bootrom separately.
So move the compilation of the bootrom code to a hidden option that gets selected by
ROCKCHIP_SPL_BACK_TO_BROM, but can also be selected by other parts.
Quoted 7 lines
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>--- arch/arm/mach-rockchip/Kconfig | 4 ++++ arch/arm/mach-rockchip/Makefile | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 6/20 rockchip: Move bootrom-related declarations to a header
In reply to Heiko StuebnerSo far spl-boards have declared the back_to_brom() function as simple extern in the files themself. That doesn't scale well if every boards defines this on its own.
Therefore move the declarations to a bootrom header.
--- arch/arm/include/asm/arch-rockchip/bootrom.h | 22 ++++++++++++++++++++++ arch/arm/mach-rockchip/rk3036-board-spl.c | 3 +-- arch/arm/mach-rockchip/rk3288-board-spl.c | 3 ++- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 arch/arm/include/asm/arch-rockchip/bootrom.h
arch/arm/include/asm/arch-rockchip/bootrom.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* (C) Copyright 2017 Heiko Stuebner <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0 +*/ + +#ifndef _ASM_ARCH_BOOTROM_H +#define _ASM_ARCH_BOOTROM_H + +/* +* Saved Stack pointer address. +* Access might be needed in some special cases. +*/ +extern u32 SAVE_SP_ADDR ; + +/* +* Hand control back to the bootrom to load another +* boot stage. +*/ +extern void back_to_bootrom (void ); + +#endif
arch/arm/mach-rockchip/rk3036-board-spl.c +1 -2
@@ -7,6 +7,7 @@#include <common.h> #include <debug_uart.h> #include <asm/io.h> +#include <asm/arch/bootrom.h> #include <asm/arch/grf_rk3036.h> #include <asm/arch/hardware.h> #include <asm/arch/sdram_rk3036.h>
@@ -20,8 +21,6 @@ static struct rk3036_grf * const grf = (void *)GRF_BASE;#define DEBUG_UART_BASE 0x20068000 -extern void back_to_bootrom (void ); -void board_init_f (ulong dummy) {#ifdef EARLY_DEBUG
arch/arm/mach-rockchip/rk3288-board-spl.c +2 -1
@@ -14,6 +14,7 @@#include <spl.h> #include <asm/gpio.h> #include <asm/io.h> +#include <asm/arch/bootrom.h> #include <asm/arch/clock.h> #include <asm/arch/hardware.h> #include <asm/arch/periph.h>
@@ -155,7 +156,7 @@ static int configure_emmc(struct udevice *pinctrl) return 0; }#endif -extern void back_to_bootrom (void ); +void board_init_f (ulong dummy) {struct udevice *pinctrl;
Signature · 1 line
2.11.0
PATCH v4 6/20 rockchip: Move bootrom-related declarations to a header
Quoted 5 lines · Heiko Stuebner
So far spl-boards have declared the
back_to_brom()function as simple extern in the files themself. That doesn't scale well if every boards defines this on its own.
Therefore move the declarations to a bootrom header.
Quoted 8 lines
Signed-off-by Heiko Stuebner <[email protected]>Tested-by Kever Yang <[email protected]>--- arch/arm/include/asm/arch-rockchip/bootrom.h | 22 ++++++++++++++++++++++ arch/arm/mach-rockchip/rk3036-board-spl.c | 3 +-- arch/arm/mach-rockchip/rk3288-board-spl.c | 3 ++- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 arch/arm/include/asm/arch-rockchip/bootrom.h
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 7/20 rockchip: mkimage: Allow encoding of loader code in spl images
In reply to Heiko StuebnerRockchip SoCs allow the spl code to be rc4-encoded, not only the image header, but only newer SoCs allow this encoding to be disabled.
The rk3188 is not part of those and requires its boot code to be rc4-encoded with the regular key. So add the ability to do this encoding via a setting on a per-soc basis when building spl images.
--- tools/rkcommon.c | 33 +++++++++++++++++++++++++++++---- tools/rkcommon.h | 22 ++++++++++++++++++++++ tools/rkimage.c | 3 +++ tools/rksd.c | 4 ++++ tools/rkspi.c | 4 ++++ 5 files changed, 62 insertions(+), 4 deletions(-)
tools/rkcommon.c +29 -4
@@ -46,17 +46,19 @@ struct header0_info {* @imagename: Image name(passed by "mkimage -n") * @spl_hdr: Boot ROM requires a 4-bytes spl header * @spl_size: Spl size(include extra 4-bytes spl header) +* @spl_rc4: RC4 encode the SPL binary (same key as header) */ struct spl_info {const char *imagename;const char *spl_hdr;const uint32_t spl_size; +const bool spl_rc4; };static struct spl_info spl_infos[] = { - {"rk3036" ,"RK30" ,0x1000 }, - {"rk3288" ,"RK32" ,0x8000 }, - {"rk3399" ,"RK33" ,0x20000 }, + {"rk3036" ,"RK30" ,0x1000 , false }, + {"rk3288" ,"RK32" ,0x8000 , false }, + {"rk3399" ,"RK33" ,0x20000 , false }, };static unsigned char rc4_key[16 ] = {
@@ -113,6 +115,16 @@ int rkcommon_get_spl_size(struct image_tool_params *params)return info->spl_size; } +bool rkcommon_need_rc4_spl (struct image_tool_params *params) +{ +struct spl_info *info =rkcommon_get_spl_info (params->imagename); + +/* +* info would not be NULL, because of we checked params before. +*/ +return info->spl_rc4; +} +int rkcommon_set_header (void *buf,uint file_size,struct image_tool_params *params) {
@@ -124,7 +136,7 @@ int rkcommon_set_header(void *buf, uint file_size,memset (buf,'\0' ,RK_INIT_OFFSET *RK_BLK_SIZE ); hdr = (struct header0_info *)buf; hdr->signature =RK_SIGNATURE ; - hdr->disable_rc4 =1 ; + hdr->disable_rc4 = !rkcommon_need_rc4_spl (params); hdr->init_offset =RK_INIT_OFFSET ; hdr->init_size = (file_size +RK_BLK_SIZE -1 ) /RK_BLK_SIZE ;
@@ -135,3 +147,16 @@ int rkcommon_set_header(void *buf, uint file_size,return 0 ; } + +void rkcommon_rc4_encode_spl (void *buf,unsigned int offset,unsigned int size) +{ +unsigned int remaining = size; + +while (remaining >0 ) { +int step = (remaining >RK_BLK_SIZE ) ?RK_BLK_SIZE : remaining; + +rc4_encode (buf + offset, step, rc4_key); + offset +=RK_BLK_SIZE ; + remaining -= step; + } +}
tools/rkcommon.h +22 -0
@@ -55,4 +55,26 @@ int rkcommon_get_spl_size(struct image_tool_params *params);int rkcommon_set_header (void *buf,uint file_size,struct image_tool_params *params); +/** +* rkcommon_need_rc4_spl() - check if rc4 encoded spl is required +* +* Some socs cannot disable the rc4-encryption of the spl binary. +* rc4 encryption is disabled normally except on socs that cannot +* handle unencrypted binaries. +* @return true or false depending on rc4 being required. +*/ +bool rkcommon_need_rc4_spl (struct image_tool_params *params); + +/** +* rkcommon_rc4_encode_spl() - encode the spl binary +* +* Encrypts the SPL binary using the generic rc4 key as required +* by some socs. +* +* @buf: Pointer to the SPL data (header and SPL binary) +* @offset: offset inside buf to start at +* @size: number of bytes to encode +*/ +void rkcommon_rc4_encode_spl (void *buf,unsigned int offset,unsigned int size); +#endif
tools/rkimage.c +3 -0
@@ -28,6 +28,9 @@ static void rkimage_set_header(void *buf, struct stat *sbuf, int ifd, {memcpy (buf +RK_SPL_HDR_START ,rkcommon_get_spl_hdr (params),RK_SPL_HDR_SIZE ); + +if (rkcommon_need_rc4_spl (params)) +rkcommon_rc4_encode_spl (buf,4 , params->file_size); }static int rkimage_extract_subimage (void *buf,struct image_tool_params *params)
tools/rksd.c +4 -0
@@ -41,6 +41,10 @@ static void rksd_set_header(void *buf, struct stat *sbuf, int ifd,memcpy (buf +RK_SPL_HDR_START ,rkcommon_get_spl_hdr (params),RK_SPL_HDR_SIZE ); + +if (rkcommon_need_rc4_spl (params)) +rkcommon_rc4_encode_spl (buf,RK_SPL_START -4 , + params->file_size -RK_SPL_START +4 ); }static int rksd_extract_subimage (void *buf,struct image_tool_params *params)
tools/rkspi.c +4 -0
@@ -48,6 +48,10 @@ static void rkspi_set_header(void *buf, struct stat *sbuf, int ifd,memcpy (buf +RK_SPL_HDR_START ,rkcommon_get_spl_hdr (params),RK_SPL_HDR_SIZE ); +if (rkcommon_need_rc4_spl (params)) +rkcommon_rc4_encode_spl (buf,RK_SPL_START -4 , + params->file_size -RK_SPL_START +4 ); +/* * Spread the image out so we only use the first 2KB of each 4KB * region. This is a feature of the SPI format required by the Rockchip
Signature · 1 line
2.11.0
PATCH v4 7/20 rockchip: mkimage: Allow encoding of loader code in spl images
Quoted 11 lines · Heiko Stuebner
Rockchip SoCs allow the spl code to be rc4-encoded, not only the image header, but only newer SoCs allow this encoding to be disabled.
The rk3188 is not part of those and requires its boot code to be rc4-encoded with the regular key. So add the ability to do this encoding via a setting on a per-soc basis when building spl images.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Simon Glass <[email protected]>Reviewed-by Kever Yang <[email protected]>Tested-by Kever Yang <[email protected]>
Quoted 7 lines
--- tools/rkcommon.c | 33 +++++++++++++++++++++++++++++---- tools/rkcommon.h | 22 ++++++++++++++++++++++ tools/rkimage.c | 3 +++ tools/rksd.c | 4 ++++ tools/rkspi.c | 4 ++++ 5 files changed, 62 insertions(+), 4 deletions(-)
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 8/20 rockchip: mkimage: Add support rk3188 serial
In reply to Heiko StuebnerAdd the entry for the rk3188 requiring rc4-encryption of the SPL.
--- tools/rkcommon.c | 1 + 1 file changed, 1 insertion(+)
tools/rkcommon.c +1 -0
@@ -57,6 +57,7 @@ struct spl_info {static struct spl_info spl_infos[] = { {"rk3036" ,"RK30" ,0x1000 , false }, + {"rk3188" ,"RK31" ,0x8000 -0x800 , true }, {"rk3288" ,"RK32" ,0x8000 , false }, {"rk3399" ,"RK33" ,0x20000 , false }, };
Signature · 1 line
2.11.0
PATCH v4 8/20 rockchip: mkimage: Add support rk3188 serial
Quoted 8 lines · Heiko Stuebner
Add the entry for the rk3188 requiring rc4-encryption of the SPL.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Simon Glass <[email protected]>Reviewed-by Kever Yang <[email protected]>--- tools/rkcommon.c | 1 + 1 file changed, 1 insertion(+)
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 9/20 rockchip: serial: Adapt rockchip of-platdata driver for rk3188
In reply to Heiko StuebnerAdd necessary structs to have the driver also work for the serial on the rk3188.
--- drivers/serial/serial_rockchip.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/serial/serial_rockchip.c +18 -1
@@ -12,12 +12,19 @@#include <serial.h> #include <asm/arch/clock.h> +#if defined(CONFIG_ROCKCHIP_RK3188 ) +struct rockchip_uart_platdata { +struct dtd_rockchip_rk3188_uart dtplat; +struct ns16550_platdata plat; +}; +struct dtd_rockchip_rk3188_uart *dtplat, s_dtplat; +#elif defined(CONFIG_ROCKCHIP_RK3288 )struct rockchip_uart_platdata {struct dtd_rockchip_rk3288_uart dtplat;struct ns16550_platdata plat; }; -struct dtd_rockchip_rk3288_uart *dtplat, s_dtplat; +#endif static int rockchip_serial_probe (struct udevice *dev) {
@@ -32,6 +39,16 @@ static int rockchip_serial_probe(struct udevice *dev)return ns16550_serial_probe (dev); } +U_BOOT_DRIVER (rockchip_rk3188_uart) = { + .name ="rockchip_rk3188_uart" , + .id =UCLASS_SERIAL , + .priv_auto_alloc_size =sizeof (struct NS16550 ), + .platdata_auto_alloc_size =sizeof (struct rockchip_uart_platdata ), + .probe = rockchip_serial_probe, + .ops = &ns16550_serial_ops, + .flags =DM_FLAG_PRE_RELOC , +}; +U_BOOT_DRIVER (rockchip_rk3288_uart) = { .name ="rockchip_rk3288_uart" , .id =UCLASS_SERIAL ,
Signature · 1 line
2.11.0
PATCH v4 9/20 rockchip: serial: Adapt rockchip of-platdata driver for rk3188
Quoted 9 lines · Heiko Stuebner
Add necessary structs to have the driver also work for the serial on the rk3188.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>--- drivers/serial/serial_rockchip.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 10/20 rockchip: rk3188: Add header files for PMU and GRF
In reply to Heiko StuebnerPMU is the power management unit and GRF is the general register file. Both are heavily used in U-Boot. Add header files with register definitions.
--- arch/arm/include/asm/arch-rockchip/grf_rk3188.h | 589 ++++++++++++++++++++++++ arch/arm/include/asm/arch-rockchip/pmu_rk3188.h | 36 ++ 2 files changed, 625 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/pmu_rk3188.h
arch/arm/include/asm/arch-rockchip/grf_rk3188.h new file +589 -0
@@ -0,0 +1,589 @@ +/* +* Copyright (c) 2016 Heiko Stuebner <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0 +*/ + +#ifndef _ASM_ARCH_GRF_RK3188_H +#define _ASM_ARCH_GRF_RK3188_H + +struct rk3188_grf_gpio_lh { +u32 l; +u32 h; +}; + +struct rk3188_grf { +struct rk3188_grf_gpio_lh gpio_dir[4 ]; +struct rk3188_grf_gpio_lh gpio_do[4 ]; +struct rk3188_grf_gpio_lh gpio_en[4 ]; + +u32 reserved[2 ]; +u32 gpio0c_iomux; +u32 gpio0d_iomux; + +u32 gpio1a_iomux; +u32 gpio1b_iomux; +u32 gpio1c_iomux; +u32 gpio1d_iomux; + +u32 gpio2a_iomux; +u32 gpio2b_iomux; +u32 gpio2c_iomux; +u32 gpio2d_iomux; + +u32 gpio3a_iomux; +u32 gpio3b_iomux; +u32 gpio3c_iomux; +u32 gpio3d_iomux; + +u32 soc_con0; +u32 soc_con1; +u32 soc_con2; +u32 soc_status0; + +u32 busdmac_con[3 ]; +u32 peridmac_con[4 ]; + +u32 cpu_con[6 ]; +u32 reserved0[2 ]; + +u32 ddrc_con0; +u32 ddrc_stat; + +u32 io_con[5 ]; +u32 soc_status1; + +u32 uoc0_con[4 ]; +u32 uoc1_con[4 ]; +u32 uoc2_con[2 ]; +u32 reserved1; +u32 uoc3_con[2 ]; +u32 hsic_stat; +u32 os_reg[8 ]; + +u32 gpio0_p[3 ]; +u32 gpio1_p[3 ][4 ]; + +u32 flash_data_p; +u32 flash_cmd_p; +}; +check_member (rk3188_grf, flash_cmd_p,0x01a4 ); + +/* GRF_GPIO0D_IOMUX */ +enum { +GPIO0D7_SHIFT =14 , +GPIO0D7_MASK =1 , +GPIO0D7_GPIO =0 , +GPIO0D7_SPI1_CSN0 , + +GPIO0D6_SHIFT =12 , +GPIO0D6_MASK =1 , +GPIO0D6_GPIO =0 , +GPIO0D6_SPI1_CLK , + +GPIO0D5_SHIFT =10 , +GPIO0D5_MASK =1 , +GPIO0D5_GPIO =0 , +GPIO0D5_SPI1_TXD , + +GPIO0D4_SHIFT =8 , +GPIO0D4_MASK =1 , +GPIO0D4_GPIO =0 , +GPIO0D4_SPI0_RXD , + +GPIO0D3_SHIFT =6 , +GPIO0D3_MASK =3 , +GPIO0D3_GPIO =0 , +GPIO0D3_FLASH_CSN3 , +GPIO0D3_EMMC_RSTN_OUT , + +GPIO0D2_SHIFT =4 , +GPIO0D2_MASK =3 , +GPIO0D2_GPIO =0 , +GPIO0D2_FLASH_CSN2 , +GPIO0D2_EMMC_CMD , + +GPIO0D1_SHIFT =2 , +GPIO0D1_MASK =1 , +GPIO0D1_GPIO =0 , +GPIO0D1_FLASH_CSN1 , + +GPIO0D0_SHIFT =0 , +GPIO0D0_MASK =3 , +GPIO0D0_GPIO =0 , +GPIO0D0_FLASH_DQS , +GPIO0D0_EMMC_CLKOUT +}; + +/* GRF_GPIO1A_IOMUX */ +enum { +GPIO1A7_SHIFT =14 , +GPIO1A7_MASK =3 , +GPIO1A7_GPIO =0 , +GPIO1A7_UART1_RTS_N , +GPIO1A7_SPI0_CSN0 , + +GPIO1A6_SHIFT =12 , +GPIO1A6_MASK =3 , +GPIO1A6_GPIO =0 , +GPIO1A6_UART1_CTS_N , +GPIO1A6_SPI0_CLK , + +GPIO1A5_SHIFT =10 , +GPIO1A5_MASK =3 , +GPIO1A5_GPIO =0 , +GPIO1A5_UART1_SOUT , +GPIO1A5_SPI0_TXD , + +GPIO1A4_SHIFT =8 , +GPIO1A4_MASK =3 , +GPIO1A4_GPIO =0 , +GPIO1A4_UART1_SIN , +GPIO1A4_SPI0_RXD , + +GPIO1A3_SHIFT =6 , +GPIO1A3_MASK =1 , +GPIO1A3_GPIO =0 , +GPIO1A3_UART0_RTS_N , + +GPIO1A2_SHIFT =4 , +GPIO1A2_MASK =1 , +GPIO1A2_GPIO =0 , +GPIO1A2_UART0_CTS_N , + +GPIO1A1_SHIFT =2 , +GPIO1A1_MASK =1 , +GPIO1A1_GPIO =0 , +GPIO1A1_UART0_SOUT , + +GPIO1A0_SHIFT =0 , +GPIO1A0_MASK =1 , +GPIO1A0_GPIO =0 , +GPIO1A0_UART0_SIN , +}; + +/* GRF_GPIO1B_IOMUX */ +enum { +GPIO1B7_SHIFT =14 , +GPIO1B7_MASK =1 , +GPIO1B7_GPIO =0 , +GPIO1B7_SPI0_CSN1 , + +GPIO1B6_SHIFT =12 , +GPIO1B6_MASK =3 , +GPIO1B6_GPIO =0 , +GPIO1B6_SPDIF_TX , +GPIO1B6_SPI1_CSN1 , + +GPIO1B5_SHIFT =10 , +GPIO1B5_MASK =3 , +GPIO1B5_GPIO =0 , +GPIO1B5_UART3_RTS_N , +GPIO1B5_RESERVED , + +GPIO1B4_SHIFT =8 , +GPIO1B4_MASK =3 , +GPIO1B4_GPIO =0 , +GPIO1B4_UART3_CTS_N , +GPIO1B4_GPS_RFCLK , + +GPIO1B3_SHIFT =6 , +GPIO1B3_MASK =3 , +GPIO1B3_GPIO =0 , +GPIO1B3_UART3_SOUT , +GPIO1B3_GPS_SIG , + +GPIO1B2_SHIFT =4 , +GPIO1B2_MASK =3 , +GPIO1B2_GPIO =0 , +GPIO1B2_UART3_SIN , +GPIO1B2_GPS_MAG , + +GPIO1B1_SHIFT =2 , +GPIO1B1_MASK =3 , +GPIO1B1_GPIO =0 , +GPIO1B1_UART2_SOUT , +GPIO1B1_JTAG_TDO , + +GPIO1B0_SHIFT =0 , +GPIO1B0_MASK =3 , +GPIO1B0_GPIO =0 , +GPIO1B0_UART2_SIN , +GPIO1B0_JTAG_TDI , +}; + +/* GRF_GPIO1D_IOMUX */ +enum { +GPIO1D7_SHIFT =14 , +GPIO1D7_MASK =1 , +GPIO1D7_GPIO =0 , +GPIO1D7_I2C4_SCL , + +GPIO1D6_SHIFT =12 , +GPIO1D6_MASK =1 , +GPIO1D6_GPIO =0 , +GPIO1D6_I2C4_SDA , + +GPIO1D5_SHIFT =10 , +GPIO1D5_MASK =1 , +GPIO1D5_GPIO =0 , +GPIO1D5_I2C2_SCL , + +GPIO1D4_SHIFT =8 , +GPIO1D4_MASK =1 , +GPIO1D4_GPIO =0 , +GPIO1D4_I2C2_SDA , + +GPIO1D3_SHIFT =6 , +GPIO1D3_MASK =1 , +GPIO1D3_GPIO =0 , +GPIO1D3_I2C1_SCL , + +GPIO1D2_SHIFT =4 , +GPIO1D2_MASK =1 , +GPIO1D2_GPIO =0 , +GPIO1D2_I2C1_SDA , + +GPIO1D1_SHIFT =2 , +GPIO1D1_MASK =1 , +GPIO1D1_GPIO =0 , +GPIO1D1_I2C0_SCL , + +GPIO1D0_SHIFT =0 , +GPIO1D0_MASK =1 , +GPIO1D0_GPIO =0 , +GPIO1D0_I2C0_SDA , +}; + +/* GRF_GPIO3A_IOMUX */ +enum { +GPIO3A7_SHIFT =14 , +GPIO3A7_MASK =1 , +GPIO3A7_GPIO =0 , +GPIO3A7_SDMMC0_DATA3 , + +GPIO3A6_SHIFT =12 , +GPIO3A6_MASK =1 , +GPIO3A6_GPIO =0 , +GPIO3A6_SDMMC0_DATA2 , + +GPIO3A5_SHIFT =10 , +GPIO3A5_MASK =1 , +GPIO3A5_GPIO =0 , +GPIO3A5_SDMMC0_DATA1 , + +GPIO3A4_SHIFT =8 , +GPIO3A4_MASK =1 , +GPIO3A4_GPIO =0 , +GPIO3A4_SDMMC0_DATA0 , + +GPIO3A3_SHIFT =6 , +GPIO3A3_MASK =1 , +GPIO3A3_GPIO =0 , +GPIO3A3_SDMMC0_CMD , + +GPIO3A2_SHIFT =4 , +GPIO3A2_MASK =1 , +GPIO3A2_GPIO =0 , +GPIO3A2_SDMMC0_CLKOUT , + +GPIO3A1_SHIFT =2 , +GPIO3A1_MASK =1 , +GPIO3A1_GPIO =0 , +GPIO3A1_SDMMC0_PWREN , + +GPIO3A0_SHIFT =0 , +GPIO3A0_MASK =1 , +GPIO3A0_GPIO =0 , +GPIO3A0_SDMMC0_RSTN , +}; + +/* GRF_GPIO3B_IOMUX */ +enum { +GPIO3B7_SHIFT =14 , +GPIO3B7_MASK =3 , +GPIO3B7_GPIO =0 , +GPIO3B7_CIF_DATA11 , +GPIO3B7_I2C3_SCL , + +GPIO3B6_SHIFT =12 , +GPIO3B6_MASK =3 , +GPIO3B6_GPIO =0 , +GPIO3B6_CIF_DATA10 , +GPIO3B6_I2C3_SDA , + +GPIO3B5_SHIFT =10 , +GPIO3B5_MASK =3 , +GPIO3B5_GPIO =0 , +GPIO3B5_CIF_DATA1 , +GPIO3B5_HSADC_DATA9 , + +GPIO3B4_SHIFT =8 , +GPIO3B4_MASK =3 , +GPIO3B4_GPIO =0 , +GPIO3B4_CIF_DATA0 , +GPIO3B4_HSADC_DATA8 , + +GPIO3B3_SHIFT =6 , +GPIO3B3_MASK =1 , +GPIO3B3_GPIO =0 , +GPIO3B3_CIF_CLKOUT , + +GPIO3B2_SHIFT =4 , +GPIO3B2_MASK =1 , +GPIO3B2_GPIO =0 , +/* no muxes */ + +GPIO3B1_SHIFT =2 , +GPIO3B1_MASK =1 , +GPIO3B1_GPIO =0 , +GPIO3B1_SDMMC0_WRITE_PRT , + +GPIO3B0_SHIFT =0 , +GPIO3B0_MASK =1 , +GPIO3B0_GPIO =0 , +GPIO3B0_SDMMC_DETECT_N , +}; + +/* GRF_GPIO3C_IOMUX */ +enum { +GPIO3C7_SHIFT =14 , +GPIO3C7_MASK =3 , +GPIO3C7_GPIO =0 , +GPIO3C7_SDMMC1_WRITE_PRT , +GPIO3C7_RMII_CRS_DVALID , +GPIO3C7_RESERVED , + +GPIO3C6_SHIFT =12 , +GPIO3C6_MASK =3 , +GPIO3C6_GPIO =0 , +GPIO3C6_SDMMC1_DECTN , +GPIO3C6_RMII_RX_ERR , +GPIO3C6_RESERVED , + +GPIO3C5_SHIFT =10 , +GPIO3C5_MASK =3 , +GPIO3C5_GPIO =0 , +GPIO3C5_SDMMC1_CLKOUT , +GPIO3C5_RMII_CLKOUT , +GPIO3C5_RMII_CLKIN , + +GPIO3C4_SHIFT =8 , +GPIO3C4_MASK =3 , +GPIO3C4_GPIO =0 , +GPIO3C4_SDMMC1_DATA3 , +GPIO3C4_RMII_RXD1 , +GPIO3C4_RESERVED , + +GPIO3C3_SHIFT =6 , +GPIO3C3_MASK =3 , +GPIO3C3_GPIO =0 , +GPIO3C3_SDMMC1_DATA2 , +GPIO3C3_RMII_RXD0 , +GPIO3C3_RESERVED , + +GPIO3C2_SHIFT =4 , +GPIO3C2_MASK =3 , +GPIO3C2_GPIO =0 , +GPIO3C2_SDMMC1_DATA1 , +GPIO3C2_RMII_TXD0 , +GPIO3C2_RESERVED , + +GPIO3C1_SHIFT =2 , +GPIO3C1_MASK =3 , +GPIO3C1_GPIO =0 , +GPIO3C1_SDMMC1_DATA0 , +GPIO3C1_RMII_TXD1 , +GPIO3C1_RESERVED , + +GPIO3C0_SHIFT =0 , +GPIO3C0_MASK =3 , +GPIO3C0_GPIO =0 , +GPIO3C0_SDMMC1_CMD , +GPIO3C0_RMII_TX_EN , +GPIO3C0_RESERVED , +}; + +/* GRF_GPIO3D_IOMUX */ +enum { +GPIO3D6_SHIFT =12 , +GPIO3D6_MASK =3 , +GPIO3D6_GPIO =0 , +GPIO3D6_PWM_3 , +GPIO3D6_JTAG_TMS , +GPIO3D6_HOST_DRV_VBUS , + +GPIO3D5_SHIFT =10 , +GPIO3D5_MASK =3 , +GPIO3D5_GPIO =0 , +GPIO3D5_PWM_2 , +GPIO3D5_JTAG_TCK , +GPIO3D5_OTG_DRV_VBUS , + +GPIO3D4_SHIFT =8 , +GPIO3D4_MASK =3 , +GPIO3D4_GPIO =0 , +GPIO3D4_PWM_1 , +GPIO3D4_JTAG_TRSTN , + +GPIO3D3_SHIFT =6 , +GPIO3D3_MASK =3 , +GPIO3D3_GPIO =0 , +GPIO3D3_PWM_0 , + +GPIO3D2_SHIFT =4 , +GPIO3D2_MASK =3 , +GPIO3D2_GPIO =0 , +GPIO3D2_SDMMC1_INT_N , + +GPIO3D1_SHIFT =2 , +GPIO3D1_MASK =3 , +GPIO3D1_GPIO =0 , +GPIO3D1_SDMMC1_BACKEND_PWR , +GPIO3D1_MII_MDCLK , + +GPIO3D0_SHIFT =0 , +GPIO3D0_MASK =3 , +GPIO3D0_GPIO =0 , +GPIO3D0_SDMMC1_PWR_EN , +GPIO3D0_MII_MD , +}; + +/* GRF_SOC_CON0 */ +enum { +HSADC_CLK_DIR_SHIFT =15 , +HSADC_CLK_DIR_MASK =1 , + +HSADC_SEL_SHIFT =14 , +HSADC_SEL_MASK =1 , + +NOC_REMAP_SHIFT =12 , +NOC_REMAP_MASK =1 , + +EMMC_FLASH_SEL_SHIFT =11 , +EMMC_FLASH_SEL_MASK =1 , + +TZPC_REVISION_SHIFT =7 , +TZPC_REVISION_MASK =0xf , + +L2CACHE_ACC_SHIFT =5 , +L2CACHE_ACC_MASK =3 , + +L2RD_WAIT_SHIFT =3 , +L2RD_WAIT_MASK =3 , + +IMEMRD_WAIT_SHIFT =1 , +IMEMRD_WAIT_MASK =3 , +}; + +/* GRF_SOC_CON1 */ +enum { +RKI2C4_SEL_SHIFT =15 , +RKI2C4_SEL_MASK =1 , + +RKI2C3_SEL_SHIFT =14 , +RKI2C3_SEL_MASK =1 , + +RKI2C2_SEL_SHIFT =13 , +RKI2C2_SEL_MASK =1 , + +RKI2C1_SEL_SHIFT =12 , +RKI2C1_SEL_MASK =1 , + +RKI2C0_SEL_SHIFT =11 , +RKI2C0_SEL_MASK =1 , + +VCODEC_SEL_SHIFT =10 , +VCODEC_SEL_MASK =1 , + +PERI_EMEM_PAUSE_SHIFT =9 , +PERI_EMEM_PAUSE_MASK =1 , + +PERI_USB_PAUSE_SHIFT =8 , +PERI_USB_PAUSE_MASK =1 , + +SMC_MUX_MODE_0_SHIFT =6 , +SMC_MUX_MODE_0_MASK =1 , + +SMC_SRAM_MW_0_SHIFT =4 , +SMC_SRAM_MW_0_MASK =3 , + +SMC_REMAP_0_SHIFT =3 , +SMC_REMAP_0_MASK =1 , + +SMC_A_GT_M0_SYNC_SHIFT =2 , +SMC_A_GT_M0_SYNC_MASK =1 , + +EMAC_SPEED_SHIFT =1 , +EMAC_SPEEC_MASK =1 , + +EMAC_MODE_SHIFT =0 , +EMAC_MODE_MASK =1 , +}; + +/* GRF_SOC_CON2 */ +enum { +SDIO_CLK_OUT_SR_SHIFT =15 , +SDIO_CLK_OUT_SR_MASK =1 , + +MEM_EMA_L2C_SHIFT =11 , +MEM_EMA_L2C_MASK =7 , + +MEM_EMA_A9_SHIFT =8 , +MEM_EMA_A9_MASK =7 , + +MSCH4_MAINDDR3_SHIFT =7 , +MSCH4_MAINDDR3_MASK =1 , +MSCH4_MAINDDR3_DDR3 =1 , + +EMAC_NEWRCV_EN_SHIFT =6 , +EMAC_NEWRCV_EN_MASK =1 , + +SW_ADDR15_EN_SHIFT =5 , +SW_ADDR15_EN_MASK =1 , + +SW_ADDR16_EN_SHIFT =4 , +SW_ADDR16_EN_MASK =1 , + +SW_ADDR17_EN_SHIFT =3 , +SW_ADDR17_EN_MASK =1 , + +BANK2_TO_RANK_EN_SHIFT =2 , +BANK2_TO_RANK_EN_MASK =1 , + +RANK_TO_ROW15_EN_SHIFT =1 , +RANK_TO_ROW15_EN_MASK =1 , + +UPCTL_C_ACTIVE_IN_SHIFT =0 , +UPCTL_C_ACTIVE_IN_MASK =1 , +UPCTL_C_ACTIVE_IN_MAY =0 , +UPCTL_C_ACTIVE_IN_WILL , +}; + +/* GRF_DDRC_CON0 */ +enum { +DDR_16BIT_EN_SHIFT =15 , +DDR_16BIT_EN_MASK =1 , + +DTO_LB_SHIFT =11 , +DTO_LB_MASK =3 , + +DTO_TE_SHIFT =9 , +DTO_TE_MASK =3 , + +DTO_PDR_SHIFT =7 , +DTO_PDR_MASK =3 , + +DTO_PDD_SHIFT =5 , +DTO_PDD_MASK =3 , + +DTO_IOM_SHIFT =3 , +DTO_IOM_MASK =3 , + +DTO_OE_SHIFT =1 , +DTO_OE_MASK =3 , + +ATO_AE_SHIFT =0 , +ATO_AE_MASK =1 , +}; +#endif
arch/arm/include/asm/arch-rockchip/pmu_rk3188.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* Copyright (c) 2016 Heiko Stuebner <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _ASM_ARCH_PMU_RK3188_H +#define _ASM_ARCH_PMU_RK3188_H + +struct rk3188_pmu { +u32 wakeup_cfg[2 ]; +u32 pwrdn_con; +u32 pwrdn_st; + +u32 int_con; +u32 int_st; +u32 misc_con; + +u32 osc_cnt; +u32 pll_cnt; +u32 pmu_cnt; +u32 ddrio_pwron_cnt; +u32 wakeup_rst_clr_cnt; +u32 scu_pwrdwn_cnt; +u32 scu_pwrup_cnt; +u32 misc_con1; +u32 gpio0_con; + +u32 sys_reg[4 ]; +u32 reserved0[4 ]; +u32 stop_int_dly; +u32 gpio0_p[2 ]; +}; +check_member (rk3188_pmu, gpio0_p[1 ],0x0068 ); + +#endif
Signature · 1 line
2.11.0
PATCH v4 10/20 rockchip: rk3188: Add header files for PMU and GRF
Quoted 6 lines · Heiko Stuebner
PMU is the power management unit and GRF is the general register file. Both are heavily used in U-Boot. Add header files with register definitions.
Signed-off-by Heiko Stuebner <[email protected]>Acked-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>
Quoted 6 lines
--- arch/arm/include/asm/arch-rockchip/grf_rk3188.h | 589 ++++++++++++++++++++++++ arch/arm/include/asm/arch-rockchip/pmu_rk3188.h | 36 ++ 2 files changed, 625 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/pmu_rk3188.h
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 11/20 rockchip: rk3188: Add pinctrl driver
In reply to Heiko StuebnerAdd a driver which supports pin multiplexing setup for the most commonly used peripherals.
--- drivers/pinctrl/Kconfig | 9 + drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl_rk3188.c | 611 ++++++++++++++++++++++++++++++ 3 files changed, 621 insertions(+) create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3188.c
drivers/pinctrl/Kconfig +9 -0
@@ -132,6 +132,15 @@ config ROCKCHIP_RK3036_PINCTRL definitions and pin control functions for each available multiplex function. +config ROCKCHIP_RK3188_PINCTRL + bool "Rockchip pin control driver" + depends on DM + help + Support pin multiplexing control on Rockchip rk3188 SoCs. The driver + is controlled by a device tree node which contains both the GPIO + definitions and pin control functions for each available multiplex + function. + config ROCKCHIP_RK3288_PINCTRL bool "Rockchip pin control driver" depends on DM
drivers/pinctrl/rockchip/Makefile +1 -0
@@ -6,5 +6,6 @@ # obj-$(CONFIG_ROCKCHIP_RK3036_PINCTRL) += pinctrl_rk3036.o +obj-$(CONFIG_ROCKCHIP_RK3188_PINCTRL) += pinctrl_rk3188.o obj-$(CONFIG_ROCKCHIP_RK3288_PINCTRL) += pinctrl_rk3288.o obj-$(CONFIG_ROCKCHIP_RK3399_PINCTRL) += pinctrl_rk3399.o
drivers/pinctrl/rockchip/pinctrl_rk3188.c new file +611 -0
611 lines not on this page · raw message
Signature · 1 line
2.11.0
PATCH v4 11/20 rockchip: rk3188: Add pinctrl driver
Quoted 6 lines · Heiko Stuebner
Add a driver which supports pin multiplexing setup for the most commonly used peripherals.
Signed-off-by Heiko Stuebner <[email protected]>Acked-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>
Quoted 6 lines
--- drivers/pinctrl/Kconfig | 9 + drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl_rk3188.c | 611 ++++++++++++++++++++++++++++++ 3 files changed, 621 insertions(+) create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3188.c
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 12/20 rockchip: rk3188: Add sysreset driver
In reply to Heiko StuebnerDriver for the sysreset of Rockchip rk3188 socs.
--- drivers/sysreset/Makefile | 1 + drivers/sysreset/sysreset_rk3188.c | 47 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 drivers/sysreset/sysreset_rk3188.c
drivers/sysreset/Makefile +1 -0
@@ -9,6 +9,7 @@ obj-$(CONFIG_SYSRESET) += sysreset-uclass.o ifndef CONFIG_SPL_BUILD obj-$(CONFIG_ROCKCHIP_RK3036) += sysreset_rk3036.o endif +obj-$(CONFIG_ROCKCHIP_RK3188) += sysreset_rk3188.o obj-$(CONFIG_ROCKCHIP_RK3288) += sysreset_rk3288.o obj-$(CONFIG_ROCKCHIP_RK3399) += sysreset_rk3399.o obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o
drivers/sysreset/sysreset_rk3188.c new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
2.11.0
PATCH v4 12/20 rockchip: rk3188: Add sysreset driver
Quoted 10 lines · Heiko Stuebner
Driver for the sysreset of Rockchip rk3188 socs.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>--- drivers/sysreset/Makefile | 1 + drivers/sysreset/sysreset_rk3188.c | 47 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 drivers/sysreset/sysreset_rk3188.c
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 13/20 rockchip: rk3188: Add rk3066/rk3188 clock bindings
In reply to Heiko StuebnerBring in required device clock binding files from Linux.
The clock trees for rk3066 and rk3188 are largely similar, which makes them share the common parts in a shared header. While we focus on rk3188 for now, bring in both headers already for completeness sake.
--- include/dt-bindings/clock/rk3066a-cru.h | 32 ++++ include/dt-bindings/clock/rk3188-cru-common.h | 256 ++++++++++++++++++++++++++ include/dt-bindings/clock/rk3188-cru.h | 48 +++++ 3 files changed, 336 insertions(+) create mode 100644 include/dt-bindings/clock/rk3066a-cru.h create mode 100644 include/dt-bindings/clock/rk3188-cru-common.h create mode 100644 include/dt-bindings/clock/rk3188-cru.h
include/dt-bindings/clock/rk3066a-cru.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Copyright (c) 2014 MundoReader S.L. +* Author: Heiko Stuebner <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _DT_BINDINGS_CLK_ROCKCHIP_RK3066A_H +#define _DT_BINDINGS_CLK_ROCKCHIP_RK3066A_H + +#include <dt-bindings/clock/rk3188-cru-common.h> + +/* soft-reset indices */ +#define SRST_SRST1 0 +#define SRST_SRST2 1 + +#define SRST_L2MEM 18 +#define SRST_I2S0 23 +#define SRST_I2S1 24 +#define SRST_I2S2 25 +#define SRST_TIMER2 29 + +#define SRST_GPIO4 36 +#define SRST_GPIO6 38 + +#define SRST_TSADC 92 + +#define SRST_HDMI 96 +#define SRST_HDMI_APB 97 +#define SRST_CIF1 111 + +#endif
include/dt-bindings/clock/rk3188-cru-common.h new file +256 -0
256 lines not on this page · raw message
include/dt-bindings/clock/rk3188-cru.h new file +48 -0
48 lines not on this page · raw message
Signature · 1 line
2.11.0
PATCH v4 13/20 rockchip: rk3188: Add rk3066/rk3188 clock bindings
Quoted 8 lines · Heiko Stuebner
Bring in required device clock binding files from Linux.
The clock trees for rk3066 and rk3188 are largely similar, which makes them share the common parts in a shared header. While we focus on rk3188 for now, bring in both headers already for completeness sake.Signed-off-by Heiko Stuebner <[email protected]>Acked-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>
Quoted 8 lines
--- include/dt-bindings/clock/rk3066a-cru.h | 32 ++++ include/dt-bindings/clock/rk3188-cru-common.h | 256 ++++++++++++++++++++++++++ include/dt-bindings/clock/rk3188-cru.h | 48 +++++ 3 files changed, 336 insertions(+) create mode 100644 include/dt-bindings/clock/rk3066a-cru.h create mode 100644 include/dt-bindings/clock/rk3188-cru-common.h create mode 100644 include/dt-bindings/clock/rk3188-cru.h
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 14/20 rockchip: rk3188: Add clock driver
In reply to Heiko StuebnerAdd a driver for setting up and modifying the various PLLs and peripheral clocks on the RK3188.
--- arch/arm/include/asm/arch-rockchip/cru_rk3188.h | 191 +++++++++ drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk_rk3188.c | 527 ++++++++++++++++++++++++ 3 files changed, 719 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3188.h create mode 100644 drivers/clk/rockchip/clk_rk3188.c
arch/arm/include/asm/arch-rockchip/cru_rk3188.h new file +191 -0
@@ -0,0 +1,191 @@ +/* +* (C) Copyright 2016 Heiko Stuebner <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ +#ifndef _ASM_ARCH_CRU_RK3188_H +#define _ASM_ARCH_CRU_RK3188_H + +#define OSC_HZ (24 * 1000 * 1000) + +#define APLL_HZ (1608 * 1000000) +#define GPLL_HZ (594 * 1000000) +#define CPLL_HZ (384 * 1000000) + +/* The SRAM is clocked off aclk_cpu, so we want to max it out for boot speed */ +#define CPU_ACLK_HZ 297000000 +#define CPU_HCLK_HZ 148500000 +#define CPU_PCLK_HZ 74250000 +#define CPU_H2P_HZ 74250000 + +#define PERI_ACLK_HZ 148500000 +#define PERI_HCLK_HZ 148500000 +#define PERI_PCLK_HZ 74250000 + +/* Private data for the clock driver - used by rockchip_get_cru() */ +struct rk3188_clk_priv { +struct rk3188_grf *grf; +struct rk3188_cru *cru; +ulong rate; +bool has_bwadj; +}; + +struct rk3188_cru { +struct rk3188_pll { +u32 con0; +u32 con1; +u32 con2; +u32 con3; + } pll[4 ]; +u32 cru_mode_con; +u32 cru_clksel_con[35 ]; +u32 cru_clkgate_con[10 ]; +u32 reserved1[2 ]; +u32 cru_glb_srst_fst_value; +u32 cru_glb_srst_snd_value; +u32 reserved2[2 ]; +u32 cru_softrst_con[9 ]; +u32 cru_misc_con; +u32 reserved3[2 ]; +u32 cru_glb_cnt_th; +}; +check_member (rk3188_cru, cru_glb_cnt_th,0x0140 ); + +/* CRU_CLKSEL0_CON */ +enum { +/* a9_core_div: core = core_src / (a9_core_div + 1) */ +A9_CORE_DIV_SHIFT =9 , +A9_CORE_DIV_MASK =0x1f , +CORE_PLL_SHIFT =8 , +CORE_PLL_MASK =1 , +CORE_PLL_SELECT_APLL =0 , +CORE_PLL_SELECT_GPLL , + +/* core peri div: core:core_peri = 2:1, 4:1, 8:1 or 16:1 */ +CORE_PERI_DIV_SHIFT =6 , +CORE_PERI_DIV_MASK =3 , + +/* aclk_cpu pll selection */ +CPU_ACLK_PLL_SHIFT =5 , +CPU_ACLK_PLL_MASK =1 , +CPU_ACLK_PLL_SELECT_APLL =0 , +CPU_ACLK_PLL_SELECT_GPLL , + +/* a9_cpu_div: aclk_cpu = cpu_src / (a9_cpu_div + 1) */ +A9_CPU_DIV_SHIFT =0 , +A9_CPU_DIV_MASK =0x1f , +}; + +/* CRU_CLKSEL1_CON */ +enum { +/* ahb2apb_pclk_div: hclk_cpu:pclk_cpu = 1:1, 2:1 or 4:1 */ +AHB2APB_DIV_SHIFT =14 , +AHB2APB_DIV_MASK =3 , + +/* cpu_pclk_div: aclk_cpu:pclk_cpu = 1:1, 2:1, 4:1 or 8:1 */ +CPU_PCLK_DIV_SHIFT =12 , +CPU_PCLK_DIV_MASK =3 , + +/* cpu_hclk_div: aclk_cpu:hclk_cpu = 1:1, 2:1 or 4:1 */ +CPU_HCLK_DIV_SHIFT =8 , +CPU_HCLK_DIV_MASK =3 , + +/* core_aclk_div: cire:aclk_core = 1:1, 2:1, 3:1, 4:1 or 8:1 */ +CORE_ACLK_DIV_SHIFT =3 , +CORE_ACLK_DIV_MASK =7 , +}; + +/* CRU_CLKSEL10_CON */ +enum { +PERI_SEL_PLL_MASK =1 , +PERI_SEL_PLL_SHIFT =15 , +PERI_SEL_CPLL =0 , +PERI_SEL_GPLL , + +/* peri pclk div: aclk_bus:pclk_bus = 1:1, 2:1, 4:1 or 8:1 */ +PERI_PCLK_DIV_SHIFT =12 , +PERI_PCLK_DIV_MASK =3 , + +/* peripheral bus hclk div:aclk_bus: hclk_bus = 1:1, 2:1 or 4:1 */ +PERI_HCLK_DIV_SHIFT =8 , +PERI_HCLK_DIV_MASK =3 , + +/* peri aclk div: aclk_peri = periph_src / (peri_aclk_div + 1) */ +PERI_ACLK_DIV_SHIFT =0 , +PERI_ACLK_DIV_MASK =0x1f , +}; +/* CRU_CLKSEL11_CON */ +enum { +HSICPHY_DIV_SHIFT =8 , +HSICPHY_DIV_MASK =0x3f , + +MMC0_DIV_SHIFT =0 , +MMC0_DIV_MASK =0x3f , +}; + +/* CRU_CLKSEL12_CON */ +enum { +UART_PLL_SHIFT =15 , +UART_PLL_MASK =1 , +UART_PLL_SELECT_GENERAL =0 , +UART_PLL_SELECT_CODEC , + +EMMC_DIV_SHIFT =8 , +EMMC_DIV_MASK =0x3f , + +SDIO_DIV_SHIFT =0 , +SDIO_DIV_MASK =0x3f , +}; + +/* CRU_CLKSEL25_CON */ +enum { +SPI1_DIV_SHIFT =8 , +SPI1_DIV_MASK =0x7f , + +SPI0_DIV_SHIFT =0 , +SPI0_DIV_MASK =0x7f , +}; + +/* CRU_MODE_CON */ +enum { +GPLL_MODE_SHIFT =12 , +GPLL_MODE_MASK =3 , +GPLL_MODE_SLOW =0 , +GPLL_MODE_NORMAL , +GPLL_MODE_DEEP , + +CPLL_MODE_SHIFT =8 , +CPLL_MODE_MASK =3 , +CPLL_MODE_SLOW =0 , +CPLL_MODE_NORMAL , +CPLL_MODE_DEEP , + +DPLL_MODE_SHIFT =4 , +DPLL_MODE_MASK =3 , +DPLL_MODE_SLOW =0 , +DPLL_MODE_NORMAL , +DPLL_MODE_DEEP , + +APLL_MODE_SHIFT =0 , +APLL_MODE_MASK =3 , +APLL_MODE_SLOW =0 , +APLL_MODE_NORMAL , +APLL_MODE_DEEP , +}; + +/* CRU_APLL_CON0 */ +enum { +CLKR_SHIFT =8 , +CLKR_MASK =0x3f , + +CLKOD_SHIFT =0 , +CLKOD_MASK =0x3f , +}; + +/* CRU_APLL_CON1 */ +enum { +CLKF_SHIFT =0 , +CLKF_MASK =0x1fff , +}; + +#endif
drivers/clk/rockchip/Makefile +1 -0
@@ -5,5 +5,6 @@ # obj-$(CONFIG_ROCKCHIP_RK3036) += clk_rk3036.o +obj-$(CONFIG_ROCKCHIP_RK3188) += clk_rk3188.o obj-$(CONFIG_ROCKCHIP_RK3288) += clk_rk3288.o obj-$(CONFIG_ROCKCHIP_RK3399) += clk_rk3399.o
drivers/clk/rockchip/clk_rk3188.c new file +527 -0
527 lines not on this page · raw message
Signature · 1 line
2.11.0
Heiko Stuebner
maintainerPATCH v4 15/20 rockchip: rk3188: Add core devicetree files
In reply to Heiko StuebnerThe rk3188 shares a lot of peripherals with the rk3066 and thus has a common include called rk3xxx.dtsi. Add both this one and the specialized rk3188 on top of it.
--- arch/arm/dts/rk3188.dtsi | 601 +++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/dts/rk3xxx.dtsi | 417 ++++++++++++++++++++++++++++++++ 2 files changed, 1018 insertions(+) create mode 100644 arch/arm/dts/rk3188.dtsi create mode 100644 arch/arm/dts/rk3xxx.dtsi
arch/arm/dts/rk3188.dtsi new file +601 -0
@@ -0,0 +1,601 @@ +/* + * Copyright (c) 2013 MundoReader S.L. + * Author: Heiko Stuebner <[email protected]> + * + * SPDX-License-Identifier: GPL-2.0+ or X11 + */ + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/pinctrl/rockchip.h> +#include <dt-bindings/clock/rk3188-cru.h> +#include "rk3xxx.dtsi" + +/ { + compatible = "rockchip,rk3188"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + enable-method = "rockchip,rk3066-smp"; + + cpu0: cpu at 0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + next-level-cache = <&L2>; + reg = <0x0>; + operating-points = < + /* kHz uV */ + 1608000 1350000 + 1416000 1250000 + 1200000 1150000 + 1008000 1075000 + 816000 975000 + 600000 950000 + 504000 925000 + 312000 875000 + >; + clock-latency = <40000>; + clocks = <&cru ARMCLK>; + }; + cpu at 1 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + next-level-cache = <&L2>; + reg = <0x1>; + }; + cpu at 2 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + next-level-cache = <&L2>; + reg = <0x2>; + }; + cpu at 3 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + next-level-cache = <&L2>; + reg = <0x3>; + }; + }; + + sram: sram at 10080000 { + compatible = "mmio-sram"; + reg = <0x10080000 0x8000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x10080000 0x8000>; + + smp-sram at 0 { + compatible = "rockchip,rk3066-smp-sram"; + reg = <0x0 0x50>; + }; + }; + + i2s0: i2s at 1011a000 { + compatible = "rockchip,rk3188-i2s", "rockchip,rk3066-i2s"; + reg = <0x1011a000 0x2000>; + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&i2s0_bus>; + dmas = <&dmac1_s 6>, <&dmac1_s 7>; + dma-names = "tx", "rx"; + clock-names = "i2s_hclk", "i2s_clk"; + clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>; + rockchip,playback-channels = <2>; + rockchip,capture-channels = <2>; + status = "disabled"; + }; + + spdif: sound at 1011e000 { + compatible = "rockchip,rk3188-spdif", "rockchip,rk3066-spdif"; + reg = <0x1011e000 0x2000>; + #sound-dai-cells = <0>; + clock-names = "hclk", "mclk"; + clocks = <&cru HCLK_SPDIF>, <&cru SCLK_SPDIF>; + dmas = <&dmac1_s 8>; + dma-names = "tx"; + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&spdif_tx>; + status = "disabled"; + }; + + cru: clock-controller at 20000000 { + compatible = "rockchip,rk3188-cru"; + reg = <0x20000000 0x1000>; + rockchip,grf = <&grf>; + u-boot,dm-spl; + + #clock-cells = <1>; + #reset-cells = <1>; + }; + + efuse: efuse at 20010000 { + compatible = "rockchip,rockchip-efuse"; + reg = <0x20010000 0x4000>; + #address-cells = <1>; + #size-cells = <1>; + clocks = <&cru PCLK_EFUSE>; + clock-names = "pclk_efuse"; + + cpu_leakage: cpu_leakage at 17 { + reg = <0x17 0x1>; + }; + }; + + usbphy: phy { + compatible = "rockchip,rk3188-usb-phy", "rockchip,rk3288-usb-phy"; + rockchip,grf = <&grf>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + usbphy0: usb-phy at 10c { + #phy-cells = <0>; + reg = <0x10c>; + clocks = <&cru SCLK_OTGPHY0>; + clock-names = "phyclk"; + #clock-cells = <0>; + }; + + usbphy1: usb-phy at 11c { + #phy-cells = <0>; + reg = <0x11c>; + clocks = <&cru SCLK_OTGPHY1>; + clock-names = "phyclk"; + #clock-cells = <0>; + }; + }; + + pinctrl: pinctrl { + compatible = "rockchip,rk3188-pinctrl"; + rockchip,grf = <&grf>; + rockchip,pmu = <&pmu>; + + #address-cells = <1>; + #size-cells = <1>; + ranges; + u-boot,dm-spl; + + gpio0: gpio0 at 2000a000 { + compatible = "rockchip,gpio-bank"; + reg = <0x2000a000 0x100>; + interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO0>; + + gpio-controller; + #gpio-cells = <2>; + + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio1: gpio1 at 2003c000 { + compatible = "rockchip,gpio-bank"; + reg = <0x2003c000 0x100>; + interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO1>; + + gpio-controller; + #gpio-cells = <2>; + + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio2: gpio2 at 2003e000 { + compatible = "rockchip,gpio-bank"; + reg = <0x2003e000 0x100>; + interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO2>; + + gpio-controller; + #gpio-cells = <2>; + + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio3: gpio3 at 20080000 { + compatible = "rockchip,gpio-bank"; + reg = <0x20080000 0x100>; + interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO3>; + + gpio-controller; + #gpio-cells = <2>; + + interrupt-controller; + #interrupt-cells = <2>; + }; + + pcfg_pull_up: pcfg_pull_up { + bias-pull-up; + }; + + pcfg_pull_down: pcfg_pull_down { + bias-pull-down; + }; + + pcfg_pull_none: pcfg_pull_none { + bias-disable; + }; + + emmc { + emmc_clk: emmc-clk { + rockchip,pins = <RK_GPIO0 24 RK_FUNC_2 &pcfg_pull_none>; + }; + + emmc_cmd: emmc-cmd { + rockchip,pins = <RK_GPIO0 26 RK_FUNC_2 &pcfg_pull_up>; + }; + + emmc_rst: emmc-rst { + rockchip,pins = <RK_GPIO0 27 RK_FUNC_2 &pcfg_pull_none>; + }; + + /* + * The data pins are shared between nandc and emmc and + * not accessible through pinctrl. Also they should've + * been already set correctly by firmware, as + * flash/emmc is the boot-device. + */ + }; + + emac { + emac_xfer: emac-xfer { + rockchip,pins = <RK_GPIO3 16 RK_FUNC_2 &pcfg_pull_none>, /* tx_en */ + <RK_GPIO3 17 RK_FUNC_2 &pcfg_pull_none>, /* txd1 */ + <RK_GPIO3 18 RK_FUNC_2 &pcfg_pull_none>, /* txd0 */ + <RK_GPIO3 19 RK_FUNC_2 &pcfg_pull_none>, /* rxd0 */ + <RK_GPIO3 20 RK_FUNC_2 &pcfg_pull_none>, /* rxd1 */ + <RK_GPIO3 21 RK_FUNC_2 &pcfg_pull_none>, /* mac_clk */ + <RK_GPIO3 22 RK_FUNC_2 &pcfg_pull_none>, /* rx_err */ + <RK_GPIO3 23 RK_FUNC_2 &pcfg_pull_none>; /* crs_dvalid */ + }; + + emac_mdio: emac-mdio { + rockchip,pins = <RK_GPIO3 24 RK_FUNC_2 &pcfg_pull_none>, + <RK_GPIO3 25 RK_FUNC_2 &pcfg_pull_none>; + }; + }; + + i2c0 { + i2c0_xfer: i2c0-xfer { + rockchip,pins = <RK_GPIO1 24 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO1 25 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + i2c1 { + i2c1_xfer: i2c1-xfer { + rockchip,pins = <RK_GPIO1 26 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO1 27 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + i2c2 { + i2c2_xfer: i2c2-xfer { + rockchip,pins = <RK_GPIO1 28 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO1 29 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + i2c3 { + i2c3_xfer: i2c3-xfer { + rockchip,pins = <RK_GPIO3 14 RK_FUNC_2 &pcfg_pull_none>, + <RK_GPIO3 15 RK_FUNC_2 &pcfg_pull_none>; + }; + }; + + i2c4 { + i2c4_xfer: i2c4-xfer { + rockchip,pins = <RK_GPIO1 30 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO1 31 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + pwm0 { + pwm0_out: pwm0-out { + rockchip,pins = <RK_GPIO3 27 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + pwm1 { + pwm1_out: pwm1-out { + rockchip,pins = <RK_GPIO3 28 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + pwm2 { + pwm2_out: pwm2-out { + rockchip,pins = <RK_GPIO3 29 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + pwm3 { + pwm3_out: pwm3-out { + rockchip,pins = <RK_GPIO3 30 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + spi0 { + spi0_clk: spi0-clk { + rockchip,pins = <RK_GPIO1 6 RK_FUNC_2 &pcfg_pull_up>; + }; + spi0_cs0: spi0-cs0 { + rockchip,pins = <RK_GPIO1 7 RK_FUNC_2 &pcfg_pull_up>; + }; + spi0_tx: spi0-tx { + rockchip,pins = <RK_GPIO1 5 RK_FUNC_2 &pcfg_pull_up>; + }; + spi0_rx: spi0-rx { + rockchip,pins = <RK_GPIO1 4 RK_FUNC_2 &pcfg_pull_up>; + }; + spi0_cs1: spi0-cs1 { + rockchip,pins = <RK_GPIO1 15 RK_FUNC_1 &pcfg_pull_up>; + }; + }; + + spi1 { + spi1_clk: spi1-clk { + rockchip,pins = <RK_GPIO0 30 RK_FUNC_1 &pcfg_pull_up>; + }; + spi1_cs0: spi1-cs0 { + rockchip,pins = <RK_GPIO0 31 RK_FUNC_1 &pcfg_pull_up>; + }; + spi1_rx: spi1-rx { + rockchip,pins = <RK_GPIO0 28 RK_FUNC_1 &pcfg_pull_up>; + }; + spi1_tx: spi1-tx { + rockchip,pins = <RK_GPIO0 29 RK_FUNC_1 &pcfg_pull_up>; + }; + spi1_cs1: spi1-cs1 { + rockchip,pins = <RK_GPIO1 14 RK_FUNC_2 &pcfg_pull_up>; + }; + }; + + uart0 { + uart0_xfer: uart0-xfer { + rockchip,pins = <RK_GPIO1 0 RK_FUNC_1 &pcfg_pull_up>, + <RK_GPIO1 1 RK_FUNC_1 &pcfg_pull_none>; + }; + + uart0_cts: uart0-cts { + rockchip,pins = <RK_GPIO1 2 RK_FUNC_1 &pcfg_pull_none>; + }; + + uart0_rts: uart0-rts { + rockchip,pins = <RK_GPIO1 3 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + uart1 { + uart1_xfer: uart1-xfer { + rockchip,pins = <RK_GPIO1 4 RK_FUNC_1 &pcfg_pull_up>, + <RK_GPIO1 5 RK_FUNC_1 &pcfg_pull_none>; + }; + + uart1_cts: uart1-cts { + rockchip,pins = <RK_GPIO1 6 RK_FUNC_1 &pcfg_pull_none>; + }; + + uart1_rts: uart1-rts { + rockchip,pins = <RK_GPIO1 7 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + uart2 { + uart2_xfer: uart2-xfer { + rockchip,pins = <RK_GPIO1 8 RK_FUNC_1 &pcfg_pull_up>, + <RK_GPIO1 9 RK_FUNC_1 &pcfg_pull_none>; + }; + /* no rts / cts for uart2 */ + }; + + uart3 { + uart3_xfer: uart3-xfer { + rockchip,pins = <RK_GPIO1 10 RK_FUNC_1 &pcfg_pull_up>, + <RK_GPIO1 11 RK_FUNC_1 &pcfg_pull_none>; + }; + + uart3_cts: uart3-cts { + rockchip,pins = <RK_GPIO1 12 RK_FUNC_1 &pcfg_pull_none>; + }; + + uart3_rts: uart3-rts { + rockchip,pins = <RK_GPIO1 13 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + sd0 { + sd0_clk: sd0-clk { + rockchip,pins = <RK_GPIO3 2 RK_FUNC_1 &pcfg_pull_none>; + }; + + sd0_cmd: sd0-cmd { + rockchip,pins = <RK_GPIO3 3 RK_FUNC_1 &pcfg_pull_none>; + }; + + sd0_cd: sd0-cd { + rockchip,pins = <RK_GPIO3 8 RK_FUNC_1 &pcfg_pull_none>; + }; + + sd0_wp: sd0-wp { + rockchip,pins = <RK_GPIO3 9 RK_FUNC_1 &pcfg_pull_none>; + }; + + sd0_pwr: sd0-pwr { + rockchip,pins = <RK_GPIO3 1 RK_FUNC_1 &pcfg_pull_none>; + }; + + sd0_bus1: sd0-bus-width1 { + rockchip,pins = <RK_GPIO3 4 RK_FUNC_1 &pcfg_pull_none>; + }; + + sd0_bus4: sd0-bus-width4 { + rockchip,pins = <RK_GPIO3 4 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO3 5 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO3 6 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO3 7 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + sd1 { + sd1_clk: sd1-clk { + rockchip,pins = <RK_GPIO3 21 RK_FUNC_1 &pcfg_pull_none>; + }; + + sd1_cmd: sd1-cmd { + rockchip,pins = <RK_GPIO3 16 RK_FUNC_1 &pcfg_pull_none>; + }; + + sd1_cd: sd1-cd { + rockchip,pins = <RK_GPIO3 22 RK_FUNC_1 &pcfg_pull_none>; + }; + + sd1_wp: sd1-wp { + rockchip,pins = <RK_GPIO3 23 RK_FUNC_1 &pcfg_pull_none>; + }; + + sd1_bus1: sd1-bus-width1 { + rockchip,pins = <RK_GPIO3 17 RK_FUNC_1 &pcfg_pull_none>; + }; + + sd1_bus4: sd1-bus-width4 { + rockchip,pins = <RK_GPIO3 17 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO3 18 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO3 19 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO3 20 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + i2s0 { + i2s0_bus: i2s0-bus { + rockchip,pins = <RK_GPIO1 16 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO1 17 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO1 18 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO1 19 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO1 20 RK_FUNC_1 &pcfg_pull_none>, + <RK_GPIO1 21 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + spdif { + spdif_tx: spdif-tx { + rockchip,pins = <RK_GPIO1 14 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + }; +}; + +&emac { + compatible = "rockchip,rk3188-emac"; +}; + +&global_timer { + interrupts = <GIC_PPI 11 0xf04>; +}; + +&grf { + compatible = "rockchip,rk3188-grf", "syscon"; +}; + +&local_timer { + interrupts = <GIC_PPI 13 0xf04>; +}; + +&i2c0 { + compatible = "rockchip,rk3188-i2c"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_xfer>; +}; + +&i2c1 { + compatible = "rockchip,rk3188-i2c"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_xfer>; +}; + +&i2c2 { + compatible = "rockchip,rk3188-i2c"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_xfer>; +}; + +&i2c3 { + compatible = "rockchip,rk3188-i2c"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c3_xfer>; +}; + +&i2c4 { + compatible = "rockchip,rk3188-i2c"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c4_xfer>; +}; + +&pmu { + compatible = "rockchip,rk3188-pmu", "syscon"; +}; + +&pwm0 { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_out>; +}; + +&pwm1 { + pinctrl-names = "default"; + pinctrl-0 = <&pwm1_out>; +}; + +&pwm2 { + pinctrl-names = "default"; + pinctrl-0 = <&pwm2_out>; +}; + +&pwm3 { + pinctrl-names = "default"; + pinctrl-0 = <&pwm3_out>; +}; + +&spi0 { + compatible = "rockchip,rk3188-spi", "rockchip,rk3066-spi"; + pinctrl-names = "default"; + pinctrl-0 = <&spi0_clk &spi0_tx &spi0_rx &spi0_cs0>; +}; + +&spi1 { + compatible = "rockchip,rk3188-spi", "rockchip,rk3066-spi"; + pinctrl-names = "default"; + pinctrl-0 = <&spi1_clk &spi1_tx &spi1_rx &spi1_cs0>; +}; + +&uart0 { + compatible = "rockchip,rk3188-uart", "snps,dw-apb-uart"; + pinctrl-names = "default"; + pinctrl-0 = <&uart0_xfer>; +}; + +&uart1 { + compatible = "rockchip,rk3188-uart", "snps,dw-apb-uart"; + pinctrl-names = "default"; + pinctrl-0 = <&uart1_xfer>; +}; + +&uart2 { + compatible = "rockchip,rk3188-uart", "snps,dw-apb-uart"; + pinctrl-names = "default"; + pinctrl-0 = <&uart2_xfer>; +}; + +&uart3 { + compatible = "rockchip,rk3188-uart", "snps,dw-apb-uart"; + pinctrl-names = "default"; + pinctrl-0 = <&uart3_xfer>; +}; + +&wdt { + compatible = "rockchip,rk3188-wdt", "snps,dw-wdt"; +};
arch/arm/dts/rk3xxx.dtsi new file +417 -0
417 lines not on this page · raw message
Signature · 1 line
2.11.0
PATCH v4 15/20 rockchip: rk3188: Add core devicetree files
Quoted 7 lines · Heiko Stuebner
The rk3188 shares a lot of peripherals with the rk3066 and thus has a common include called
rk3xxx.dtsi. Add both this one and the specialized rk3188 on top of it.Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>
Quoted 6 lines
--- arch/arm/dts/rk3188.dtsi | 601 +++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/dts/rk3xxx.dtsi | 417 ++++++++++++++++++++++++++++++++ 2 files changed, 1018 insertions(+) create mode 100644 arch/arm/dts/rk3188.dtsi create mode 100644 arch/arm/dts/rk3xxx.dtsi
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 16/20 rockchip: rk3188: Add core support
In reply to Heiko StuebnerAdd the core architecture code for the rk3188. It doesn't support the SPL yet, as because of some unknown error it doesn't start yet.
--- arch/arm/mach-rockchip/Kconfig | 16 ++++ arch/arm/mach-rockchip/Makefile | 5 ++ arch/arm/mach-rockchip/rk3188/Kconfig | 24 +++++ arch/arm/mach-rockchip/rk3188/Makefile | 10 +++ arch/arm/mach-rockchip/rk3188/clk_rk3188.c | 33 +++++++ arch/arm/mach-rockchip/rk3188/syscon_rk3188.c | 55 ++++++++++++ include/configs/rk3188_common.h | 125 ++++++++++++++++++++++++++ 7 files changed, 268 insertions(+) create mode 100644 arch/arm/mach-rockchip/rk3188/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3188/Makefile create mode 100644 arch/arm/mach-rockchip/rk3188/clk_rk3188.c create mode 100644 arch/arm/mach-rockchip/rk3188/syscon_rk3188.c create mode 100644 include/configs/rk3188_common.h
arch/arm/mach-rockchip/Kconfig +16 -0
@@ -11,6 +11,21 @@ config ROCKCHIP_RK3036 and video codec support. Peripherals include Gigabit Ethernet, USB2 host and OTG, SDIO, I2S, UART, SPI, I2C and PWMs. +config ROCKCHIP_RK3188 + bool "Support Rockchip RK3188" + select CPU_V7 + select SUPPORT_SPL + select SUPPORT_TPL + select SPL + select TPL + select ROCKCHIP_BROM_HELPER + help + The Rockchip RK3188 is a ARM-based SoC with a quad-core Cortex-A9 + including NEON and GPU, 512KB L2 cache, Mali-400 graphics, two + video interfaces, several memory options and video codec support. + Peripherals include Fast Ethernet, USB2 host and OTG, SDIO, I2S, + UART, SPI, I2C and PWMs. + config ROCKCHIP_RK3288 bool "Support Rockchip RK3288" select CPU_V7
@@ -50,6 +65,7 @@ config SPL_MMC_SUPPORT default y if !ROCKCHIP_SPL_BACK_TO_BROM source "arch/arm/mach-rockchip/rk3036/Kconfig" +source "arch/arm/mach-rockchip/rk3188/Kconfig" source "arch/arm/mach-rockchip/rk3288/Kconfig" source "arch/arm/mach-rockchip/rk3399/Kconfig" endif
arch/arm/mach-rockchip/Makefile +5 -0
@@ -16,5 +16,10 @@ ifndef CONFIG_ARM64 obj-y += rk_timer.o endif obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036/ + +ifndef CONFIG_TPL_BUILD +obj-$(CONFIG_ROCKCHIP_RK3188) += rk3188/ +endif + obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288/ obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399/
arch/arm/mach-rockchip/rk3188/Kconfig new file +24 -0
@@ -0,0 +1,24 @@ +if ROCKCHIP_RK3188 + +config SYS_SOC + default "rockchip" + +config SYS_MALLOC_F_LEN + default 0x0800 + +config SPL_LIBCOMMON_SUPPORT + default y + +config SPL_LIBGENERIC_SUPPORT + default y + +config SPL_SERIAL_SUPPORT + default y + +config TPL_LIBCOMMON_SUPPORT + default y + +config TPL_SERIAL_SUPPORT + default y + +endif
arch/arm/mach-rockchip/rk3188/Makefile new file +10 -0
@@ -0,0 +1,10 @@ +# +# Copyright (c) 2015 Google, Inc +# +# SPDX-License-Identifier: GPL-2.0+ +# + +ifndef CONFIG_TPL_BUILD +obj-y += clk_rk3188.o +obj-y += syscon_rk3188.o +endif
arch/arm/mach-rockchip/rk3188/clk_rk3188.c new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Copyright (C) 2015 Google, Inc +* Written by Simon Glass <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/arch/clock.h> +#include <asm/arch/cru_rk3188.h> + +int rockchip_get_clk (struct udevice **devp) +{ +return uclass_get_device_by_driver (UCLASS_CLK , +DM_GET_DRIVER (rockchip_rk3188_cru), devp); +} + +void *rockchip_get_cru (void ) +{ +struct rk3188_clk_priv *priv; +struct udevice *dev; +int ret; + + ret =rockchip_get_clk (&dev); +if (ret) +return ERR_PTR (ret); + + priv =dev_get_priv (dev); + +return priv->cru; +}
arch/arm/mach-rockchip/rk3188/syscon_rk3188.c new file +55 -0
55 lines not on this page · raw message
include/configs/rk3188_common.h new file +125 -0
125 lines not on this page · raw message
Signature · 1 line
2.11.0
PATCH v4 16/20 rockchip: rk3188: Add core support
Quoted 7 lines · Heiko Stuebner
Add the core architecture code for the rk3188. It doesn't support the SPL yet, as because of some unknown error it doesn't start yet.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>
Quoted 14 lines
--- arch/arm/mach-rockchip/Kconfig | 16 ++++ arch/arm/mach-rockchip/Makefile | 5 ++ arch/arm/mach-rockchip/rk3188/Kconfig | 24 +++++ arch/arm/mach-rockchip/rk3188/Makefile | 10 +++ arch/arm/mach-rockchip/rk3188/clk_rk3188.c | 33 +++++++ arch/arm/mach-rockchip/rk3188/syscon_rk3188.c | 55 ++++++++++++ include/configs/rk3188_common.h | 125 ++++++++++++++++++++++++++ 7 files changed, 268 insertions(+) create mode 100644 arch/arm/mach-rockchip/rk3188/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3188/Makefile create mode 100644 arch/arm/mach-rockchip/rk3188/clk_rk3188.c create mode 100644 arch/arm/mach-rockchip/rk3188/syscon_rk3188.c create mode 100644 include/configs/rk3188_common.h
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 17/20 rockchip: rk3188: Add sdram driver
In reply to Heiko StuebnerThe sdram controller blocks are very similar to the rk3288 in utilizing memory scheduler, Designware uPCTL and Designware PUBL blocks, only limited to one bank instead of two.
There are some minimal differences when setting up the ram, so it gets a separate driver for the rk3188 but reuses the driver structs, as there is no need to define the same again.
More optimization can happen when the modelling of the controller parts in the dts actually follow the hardware layout hopefully at some point in the future.
--- arch/arm/include/asm/arch-rockchip/ddr_rk3188.h | 25 + arch/arm/mach-rockchip/rk3188/Makefile | 1 + arch/arm/mach-rockchip/rk3188/sdram_rk3188.c | 995 ++++++++++++++++++++++++ 3 files changed, 1021 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/ddr_rk3188.h create mode 100644 arch/arm/mach-rockchip/rk3188/sdram_rk3188.c
arch/arm/include/asm/arch-rockchip/ddr_rk3188.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* (C) Copyright 2015 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0 +*/ + +#ifndef _ASM_ARCH_DDR_RK3188_H +#define _ASM_ARCH_DDR_RK3188_H + +#include <asm/arch/ddr_rk3288.h> + +/* +* RK3188 Memory scheduler register map. +*/ +struct rk3188_msch { +u32 coreid; +u32 revisionid; +u32 ddrconf; +u32 ddrtiming; +u32 ddrmode; +u32 readlatency; +}; +check_member (rk3188_msch, readlatency,0x0014 ); + +#endif
arch/arm/mach-rockchip/rk3188/Makefile +1 -0
@@ -6,5 +6,6 @@ ifndef CONFIG_TPL_BUILD obj-y += clk_rk3188.o +obj-y += sdram_rk3188.o obj-y += syscon_rk3188.o endif
arch/arm/mach-rockchip/rk3188/sdram_rk3188.c new file +995 -0
995 lines not on this page · raw message
Signature · 1 line
2.11.0
PATCH v4 17/20 rockchip: rk3188: Add sdram driver
Quoted 15 lines · Heiko Stuebner
The sdram controller blocks are very similar to the rk3288 in utilizing memory scheduler, Designware uPCTL and Designware PUBL blocks, only limited to one bank instead of two.
There are some minimal differences when setting up the ram, so it gets a separate driver for the rk3188 but reuses the driver structs, as there is no need to define the same again.
More optimization can happen when the modelling of the controller parts in the dts actually follow the hardware layout hopefully at some point in the future.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>
Quoted 7 lines
--- arch/arm/include/asm/arch-rockchip/ddr_rk3188.h | 25 + arch/arm/mach-rockchip/rk3188/Makefile | 1 + arch/arm/mach-rockchip/rk3188/sdram_rk3188.c | 995 ++++++++++++++++++++++++ 3 files changed, 1021 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/ddr_rk3188.h create mode 100644 arch/arm/mach-rockchip/rk3188/sdram_rk3188.c
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 18/20 rockchip: rk3188: Add main, spl and tpl boards
In reply to Heiko StuebnerThe rk3188 needs 3 U-Boot stages: a tpl living in 1KB of sram, a spl the resides in the rest of the sram and loads the regular U-Boot living in regular ram.
--- arch/arm/mach-rockchip/Makefile | 7 +- arch/arm/mach-rockchip/rk3188-board-spl.c | 218 ++++++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3188-board-tpl.c | 86 ++++++++++++ arch/arm/mach-rockchip/rk3188-board.c | 71 ++++++++++ 4 files changed, 381 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-rockchip/rk3188-board-spl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board-tpl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board.c
arch/arm/mach-rockchip/Makefile +6 -1
@@ -4,11 +4,16 @@ # SPDX-License-Identifier: GPL-2.0+ # -ifdef CONFIG_SPL_BUILD +ifdef CONFIG_TPL_BUILD +obj-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board-tpl.o +obj-$(CONFIG_ROCKCHIP_BROM_HELPER) += save_boot_param.o +else ifdef CONFIG_SPL_BUILD obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o +obj-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board-spl.o obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-spl.o obj-$(CONFIG_ROCKCHIP_BROM_HELPER) += save_boot_param.o else +obj-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board.o obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board.o obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board.o endif
arch/arm/mach-rockchip/rk3188-board-spl.c new file +218 -0
218 lines not on this page · raw message
arch/arm/mach-rockchip/rk3188-board-tpl.c new file +86 -0
86 lines not on this page · raw message
arch/arm/mach-rockchip/rk3188-board.c new file +71 -0
71 lines not on this page · raw message
Signature · 1 line
2.11.0
PATCH v4 18/20 rockchip: rk3188: Add main, spl and tpl boards
Quoted 6 lines · Heiko Stuebner
The rk3188 needs 3 U-Boot stages: a tpl living in 1KB of sram, a spl the resides in the rest of the sram and loads the regular U-Boot living in regular ram.
Signed-off-by Heiko Stuebner <[email protected]>Tested-by Kever Yang <[email protected]>
Quoted 9 lines
--- arch/arm/mach-rockchip/Makefile | 7 +- arch/arm/mach-rockchip/rk3188-board-spl.c | 218 ++++++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3188-board-tpl.c | 86 ++++++++++++ arch/arm/mach-rockchip/rk3188-board.c | 71 ++++++++++ 4 files changed, 381 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-rockchip/rk3188-board-spl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board-tpl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board.c
Applied to u-boot-rockchip, thanks!
Heiko Stuebner
maintainerPATCH v4 19/20 rockchip: rk3188: Add Radxa Rock board
In reply to Heiko StuebnerThe Rock is a RK3188 based single board computer by Radxa. Currently it still relies on the proprietary DDR init and cannot use the generic SPL, but at least is able to boot a linux kernel and system up to a regular login prompt.
--- arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3188-radxarock.dts | 382 ++++++++++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3188/Kconfig | 11 + board/radxa/rock/Kconfig | 15 ++ board/radxa/rock/MAINTAINERS | 6 + board/radxa/rock/Makefile | 7 + board/radxa/rock/rock.c | 7 + configs/rock_defconfig | 56 +++++ include/configs/rock.h | 30 +++ 9 files changed, 515 insertions(+) create mode 100644 arch/arm/dts/rk3188-radxarock.dts create mode 100644 board/radxa/rock/Kconfig create mode 100644 board/radxa/rock/MAINTAINERS create mode 100644 board/radxa/rock/Makefile create mode 100644 board/radxa/rock/rock.c create mode 100644 configs/rock_defconfig create mode 100644 include/configs/rock.h
arch/arm/dts/Makefile +1 -0
@@ -29,6 +29,7 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ dtb-$(CONFIG_EXYNOS7420) += exynos7420-espresso7420.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += \ rk3036-sdk.dtb \ + rk3188-radxarock.dtb \ rk3288-firefly.dtb \ rk3288-veyron-jerry.dtb \ rk3288-veyron-mickey.dtb \
arch/arm/dts/rk3188-radxarock.dts new file +382 -0
382 lines not on this page · raw message
arch/arm/mach-rockchip/rk3188/Kconfig +11 -0
@@ -1,5 +1,14 @@ if ROCKCHIP_RK3188 +config TARGET_ROCK + bool "Radxa Rock" + help + Rock is a RK3188-based development board with 2 USB and 1 otg + ports, HDMI, TV-out, micro-SD card, audio, WiFi and 100MBit + Ethernet, It also includes on-board nand and 1GB of SDRAM. + Expansion connectors provide access to display pins, I2C, SPI, + UART and GPIOs. + config SYS_SOC default "rockchip"
@@ -21,4 +30,6 @@ config TPL_LIBCOMMON_SUPPORT config TPL_SERIAL_SUPPORT default y +source "board/radxa/rock/Kconfig" + endif
board/radxa/rock/Kconfig new file +15 -0
@@ -0,0 +1,15 @@ +if TARGET_ROCK + +config SYS_BOARD + default "rock" + +config SYS_VENDOR + default "radxa" + +config SYS_CONFIG_NAME + default "rock" + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + +endif
board/radxa/rock/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +RADXA_ROCK +M: Heiko Stuebner <[email protected]> +S: Maintained +F: board/radxa/rock +F: include/configs/rock.h +F: configs/rock_defconfig
board/radxa/rock/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# (C) Copyright 2015 Heiko Stuebner +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += rock.o
board/radxa/rock/rock.c new file +7 -0
@@ -0,0 +1,7 @@ +/* +* (C) Copyright 2015 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h>
configs/rock_defconfig new file +56 -0
56 lines not on this page · raw message
include/configs/rock.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* (C) Copyright 2015 Google, Inc +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define ROCKCHIP_DEVICE_SETTINGS +#include <configs/rk3188_common.h> + +#define CONFIG_ENV_IS_IN_MMC +#define CONFIG_SYS_MMC_ENV_DEV 0 + +#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM +/* SPL @ 32k for 34k +* u-boot directly after @ 68k for 400k or so +* ENV @ 992k +*/ +#define CONFIG_ENV_OFFSET ((1024-32) * 1024) +#else +/* SPL @ 32k for ~36k +* ENV @ 96k +* u-boot @ 128K +*/ +#define CONFIG_ENV_OFFSET (96 * 1024) +#endif + +#endif
Signature · 1 line
2.11.0
PATCH v4 19/20 rockchip: rk3188: Add Radxa Rock board
Quoted 18 lines · Heiko Stuebner
The Rock is a RK3188 based single board computer by Radxa. Currently it still relies on the proprietary DDR init and cannot use the generic SPL, but at least is able to boot a linux kernel and system up to a regular login prompt.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>--- arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3188-radxarock.dts | 382 ++++++++++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3188/Kconfig | 11 + board/radxa/rock/Kconfig | 15 ++ board/radxa/rock/MAINTAINERS | 6 + board/radxa/rock/Makefile | 7 + board/radxa/rock/rock.c | 7 + configs/rock_defconfig | 56 +++++ include/configs/rock.h | 30 +++
Quoted 8 lines
9 files changed, 515 insertions(+) create mode 100644 arch/arm/dts/rk3188-radxarock.dts create mode 100644 board/radxa/rock/Kconfig create mode 100644 board/radxa/rock/MAINTAINERS create mode 100644 board/radxa/rock/Makefile create mode 100644 board/radxa/rock/rock.c create mode 100644 configs/rock_defconfig create mode 100644 include/configs/rock.h
Applied to u-boot-rockchip, thanks!
PATCH v4 19/20 rockchip: rk3188: Add Radxa Rock board
Hi Heiko,
Quoted 28 lines · Simon Glass
Quoted 18 lines · Heiko Stuebner
The Rock is a RK3188 based single board computer by Radxa. Currently it still relies on the proprietary DDR init and cannot use the generic SPL, but at least is able to boot a linux kernel and system up to a regular login prompt.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>--- arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3188-radxarock.dts | 382 ++++++++++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3188/Kconfig | 11 + board/radxa/rock/Kconfig | 15 ++ board/radxa/rock/MAINTAINERS | 6 + board/radxa/rock/Makefile | 7 + board/radxa/rock/rock.c | 7 + configs/rock_defconfig | 56 +++++ include/configs/rock.h | 30 +++Quoted 8 lines
9 files changed, 515 insertions(+) create mode 100644 arch/arm/dts/rk3188-radxarock.dts create mode 100644 board/radxa/rock/Kconfig create mode 100644 board/radxa/rock/MAINTAINERS create mode 100644 board/radxa/rock/Makefile create mode 100644 board/radxa/rock/rock.c create mode 100644 configs/rock_defconfig create mode 100644 include/configs/rock.h
Quoted 1 line
Applied to u-boot-rockchip, thanks!
Just a reminder that I had to drop this patch as it does not build. Can you please resend this one? I have also reverted the README patch but can apply that myself once this board is enabled.
Regards,
Simon
Heiko Stübner
maintainerPATCH v4 19/20 rockchip: rk3188: Add Radxa Rock board
Hi Simon,
Am Donnerstag, 23. März 2017, 10:18:31 CET schrieb Simon Glass:
Quoted 31 lines · Simon Glass
Quoted 30 lines · Heiko Stuebner
Quoted 28 lines
The Rock is a RK3188 based single board computer by Radxa. Currently it still relies on the proprietary DDR init and cannot use the generic SPL, but at least is able to boot a linux kernel and system up to a regular login prompt.
Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Simon Glass <[email protected]>Tested-by Kever Yang <[email protected]>---
arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3188-radxarock.dts | 382 ++++++++++++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3188/Kconfig | 11 + board/radxa/rock/Kconfig | 15 ++ board/radxa/rock/MAINTAINERS | 6 + board/radxa/rock/Makefile | 7 + board/radxa/rock/rock.c | 7 + configs/rock_defconfig | 56 +++++ include/configs/rock.h | 30 +++ 9 files changed, 515 insertions(+) create mode 100644 arch/arm/dts/rk3188-radxarock.dts create mode 100644 board/radxa/rock/Kconfig create mode 100644 board/radxa/rock/MAINTAINERS create mode 100644 board/radxa/rock/Makefile create mode 100644 board/radxa/rock/rock.c create mode 100644 configs/rock_defconfig create mode 100644 include/configs/rock.h
Quoted 5 lines
Quoted 1 line
Applied to u-boot-rockchip, thanks!
Just a reminder that I had to drop this patch as it does not build. Can you please resend this one? I have also reverted the README patch but can apply that myself once this board is enabled.
ah, I should probably fold the patch fixing the build issue into this one. I'll create a new series and collect all the different sets flying around.
Heiko
Heiko Stuebner
maintainerPATCH v4 20/20 rockchip: rk3188: add README.rockchip paragraph describing sd boot
In reply to Heiko StuebnerBuilding sd images for rk3188 requires more steps due to the needed split into TPL and SPL as loaders. Describe how to build an image for it in a separate paragraph in the READER.rockchip file.
--- doc/README.rockchip | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
doc/README.rockchip +26 -0
@@ -147,6 +147,32 @@ For evb_rk3036 board: Note: rk3036 SDMMC and debug uart use the same iomux, so if you boot from SD, the debug uart must be disabled + +Booting from an SD card on RK3188 +================================= + +For rk3188 boards the general storage onto the card stays the same as +described above, but the image creation needs a bit more care. + +The bootrom of rk3188 expects to find a small 1kb loader which returns +control to the bootrom, after which it will load the real loader, which +can then be up to 29kb in size and does the regular ddr init. + +Additionally the rk3188 requires everything the bootrom loads to be +rc4-encrypted. Except for the very first stage the bootrom always reads +and decodes 2kb pages, so files should be sized accordingly. + +# copy tpl, pad to 1020 bytes and append spl +cat tpl/u-boot-tpl.bin > tplspl.bin +truncate -s 1020 tplspl.bin +cat spl/u-boot-spl.bin >> tplspl.bin +tools/mkimage -n rk3188 -T rksd -d tplspl.bin out + +# truncate, encode and append u-boot.bin +truncate -s %2048 u-boot.bin +cat u-boot.bin | split -b 512 --filter='openssl rc4 -K 7C4E0304550509072D2C7B38170D1711' >> out + + Using fastboot on rk3288 ======================== - Write GPT partition layout to mmc device which fastboot want to use it to
Signature · 1 line
2.11.0
PATCH v4 20/20 rockchip: rk3188: add README.rockchip paragraph describing sd boot
Hi Heiko,
Quoted 8 lines · Heiko Stuebner
Building sd images for rk3188 requires more steps due to the needed split into TPL and SPL as loaders. Describe how to build an image for it in a separate paragraph in the READER.rockchip file.
Signed-off-by Heiko Stuebner <[email protected]>--- doc/README.rockchip | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
It would be great to implement this image creation in binman. It will need to have support for tpl and rc4.
- Simon
PATCH v4 20/20 rockchip: rk3188: add README.rockchip paragraph describing sd boot
Quoted 12 lines · Simon Glass
Hi Heiko,
Quoted 8 lines · Heiko Stuebner
Building sd images for rk3188 requires more steps due to the needed split into TPL and SPL as loaders. Describe how to build an image for it in a separate paragraph in the READER.rockchip file.
Signed-off-by Heiko Stuebner <[email protected]>--- doc/README.rockchip | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
Quoted 6 lines
Acked-by Simon Glass <[email protected]>It would be great to implement this image creation in binman. It will need to have support for tpl and rc4.
- Simon
Applied to u-boot-rockchip, thanks!
v4 cover rk3188 uboot support
In reply to Heiko StuebnerHi Heiko,
Quoted 125 lines · Heiko Stuebner
Hi,
thanks to Kever finding the needle in the haystack (wrong resets in sdram driver actually resetting the sdmmc controller) the rk3188 can now actually load uboot into memory from spl ... yay .
So this v4 does hopefully addresses all last review comments from Simon and includes of course the newly received tags so far.
Heiko
Heiko Stuebner (21):
dm: allow limiting pre-reloc markings to spl or tpl
clk: rk3288: limit gpll and cpll init to SPL build
rockchip: rk3288: sdram: use constants in ddrconf table
rockchip: rk3288: sdram: style fixes from rk3188 sdram review
rockchip: Move bootrom helper compilation to a hidden option
rockchip: Move bootrom-related declarations to a header
rockchip: mkimage: Allow encoding of loader code in spl images
rockchip: mkimage: Add support rk3188 serial
rockchip: serial: Adapt rockchip of-platdata driver for rk3188
rockchip: rk3188: Add header files for PMU and GRF
rockchip: rk3188: Add pinctrl driver
rockchip: rk3188: Add sysreset driver
rockchip: rk3188: Add rk3066/rk3188 clock bindings
rockchip: rk3188: Add clock driver
rockchip: rk3188: Add core devicetree files
rockchip: rk3188: Add core support
rockchip: rk3188: Add sdram driver
rockchip: rk3188: Add main, spl and tpl boards
rockchip: rk3188: Add Radxa Rock board
rockchip: rk3188: add README.rockchip paragraph describing sd boot Add a temporary script that can create a bootimage for rk3188arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3188-radxarock.dts | 382 +++++++++ arch/arm/dts/rk3188.dtsi | 601 ++++++++++++++ arch/arm/dts/rk3xxx.dtsi | 417 ++++++++++ arch/arm/include/asm/arch-rockchip/bootrom.h | 22 + arch/arm/include/asm/arch-rockchip/cru_rk3188.h | 191 +++++ arch/arm/include/asm/arch-rockchip/ddr_rk3188.h | 25 + arch/arm/include/asm/arch-rockchip/ddr_rk3288.h | 8 + arch/arm/include/asm/arch-rockchip/grf_rk3188.h | 589 ++++++++++++++ arch/arm/include/asm/arch-rockchip/pmu_rk3188.h | 36 + arch/arm/mach-rockchip/Kconfig | 20 + arch/arm/mach-rockchip/Makefile | 14 +- arch/arm/mach-rockchip/rk3036-board-spl.c | 3 +- arch/arm/mach-rockchip/rk3188-board-spl.c | 218 ++++++ arch/arm/mach-rockchip/rk3188-board-tpl.c | 86 ++ arch/arm/mach-rockchip/rk3188-board.c | 71 ++ arch/arm/mach-rockchip/rk3188/Kconfig | 35 + arch/arm/mach-rockchip/rk3188/Makefile | 11 + arch/arm/mach-rockchip/rk3188/clk_rk3188.c | 33 + arch/arm/mach-rockchip/rk3188/sdram_rk3188.c | 995 ++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3188/syscon_rk3188.c | 55 ++ arch/arm/mach-rockchip/rk3288-board-spl.c | 3 +- arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 59 +- board/radxa/rock/Kconfig | 15 + board/radxa/rock/MAINTAINERS | 6 + board/radxa/rock/Makefile | 7 + board/radxa/rock/rock.c | 7 + configs/rock_defconfig | 56 ++ doc/README.rockchip | 26 + doc/driver-model/README.txt | 4 + drivers/clk/at91/pmc.c | 3 +- drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk_rk3188.c | 527 +++++++++++++ drivers/clk/rockchip/clk_rk3288.c | 2 + drivers/core/root.c | 2 +- drivers/core/util.c | 25 + drivers/pinctrl/Kconfig | 9 + drivers/pinctrl/pinctrl-uclass.c | 3 +- drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl_rk3188.c | 611 +++++++++++++++ drivers/serial/serial_rockchip.c | 19 +- drivers/sysreset/Makefile | 1 + drivers/sysreset/sysreset_rk3188.c | 47 ++ include/configs/rk3188_common.h | 125 +++ include/configs/rock.h | 30 + include/dm/util.h | 26 + include/dt-bindings/clock/rk3066a-cru.h | 32 + include/dt-bindings/clock/rk3188-cru-common.h | 256 ++++++ include/dt-bindings/clock/rk3188-cru.h | 48 ++ mkuboot | 35 + scripts/Makefile.spl | 7 +- tools/dtoc/dtoc.py | 2 + tools/rkcommon.c | 34 +- tools/rkcommon.h | 22 + tools/rkimage.c | 3 + tools/rksd.c | 4 + tools/rkspi.c | 4 + 57 files changed, 5833 insertions(+), 42 deletions(-) create mode 100644 arch/arm/dts/rk3188-radxarock.dts create mode 100644 arch/arm/dts/rk3188.dtsi create mode 100644 arch/arm/dts/rk3xxx.dtsi create mode 100644 arch/arm/include/asm/arch-rockchip/bootrom.h create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/ddr_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/pmu_rk3188.h create mode 100644 arch/arm/mach-rockchip/rk3188-board-spl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board-tpl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board.c create mode 100644 arch/arm/mach-rockchip/rk3188/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3188/Makefile create mode 100644 arch/arm/mach-rockchip/rk3188/clk_rk3188.c create mode 100644 arch/arm/mach-rockchip/rk3188/sdram_rk3188.c create mode 100644 arch/arm/mach-rockchip/rk3188/syscon_rk3188.c create mode 100644 board/radxa/rock/Kconfig create mode 100644 board/radxa/rock/MAINTAINERS create mode 100644 board/radxa/rock/Makefile create mode 100644 board/radxa/rock/rock.c create mode 100644 configs/rock_defconfig create mode 100644 drivers/clk/rockchip/clk_rk3188.c create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3188.c create mode 100644 drivers/sysreset/sysreset_rk3188.c create mode 100644 include/configs/rk3188_common.h create mode 100644 include/configs/rock.h create mode 100644 include/dt-bindings/clock/rk3066a-cru.h create mode 100644 include/dt-bindings/clock/rk3188-cru-common.h create mode 100644 include/dt-bindings/clock/rk3188-cru.h create mode 100755 mkuboot
Quoted 3 lines
--
2.11.0
I have rebased this onto mainline and pushed it to u-boot-rockchip/testing. However I get an error when building the 'rock' board:
make[2]: *** No rule to make target dts/dt.dtb', needed by tpl/u-boot-tpl.dtb'. Stop.
make[1]: *** [tpl/u-boot-tpl.bin] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [sub-make] Error 2
Can you please take a look?
Regards,
Simon
Heiko Stuebner
maintainerv4 cover rk3188 uboot support
Am Mittwoch, 22. Februar 2017, 20:26:18 CET schrieb Simon Glass:
Quoted 135 lines
Hi Heiko,
Quoted 125 lines · Heiko Stuebner
Hi,
thanks to Kever finding the needle in the haystack (wrong resets in sdram driver actually resetting the sdmmc controller) the rk3188 can now actually load uboot into memory from spl ... yay .
So this v4 does hopefully addresses all last review comments from Simon and includes of course the newly received tags so far.
Heiko
Heiko Stuebner (21):
dm: allow limiting pre-reloc markings to spl or tpl
clk: rk3288: limit gpll and cpll init to SPL build
rockchip: rk3288: sdram: use constants in ddrconf table
rockchip: rk3288: sdram: style fixes from rk3188 sdram review
rockchip: Move bootrom helper compilation to a hidden option
rockchip: Move bootrom-related declarations to a header
rockchip: mkimage: Allow encoding of loader code in spl images
rockchip: mkimage: Add support rk3188 serial
rockchip: serial: Adapt rockchip of-platdata driver for rk3188
rockchip: rk3188: Add header files for PMU and GRF
rockchip: rk3188: Add pinctrl driver
rockchip: rk3188: Add sysreset driver
rockchip: rk3188: Add rk3066/rk3188 clock bindings
rockchip: rk3188: Add clock driver
rockchip: rk3188: Add core devicetree files
rockchip: rk3188: Add core support
rockchip: rk3188: Add sdram driver
rockchip: rk3188: Add main, spl and tpl boards
rockchip: rk3188: Add Radxa Rock board
rockchip: rk3188: add README.rockchip paragraph describing sd boot Add a temporary script that can create a bootimage for rk3188arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3188-radxarock.dts | 382 +++++++++ arch/arm/dts/rk3188.dtsi | 601 ++++++++++++++ arch/arm/dts/rk3xxx.dtsi | 417 ++++++++++ arch/arm/include/asm/arch-rockchip/bootrom.h | 22 + arch/arm/include/asm/arch-rockchip/cru_rk3188.h | 191 +++++ arch/arm/include/asm/arch-rockchip/ddr_rk3188.h | 25 + arch/arm/include/asm/arch-rockchip/ddr_rk3288.h | 8 + arch/arm/include/asm/arch-rockchip/grf_rk3188.h | 589 ++++++++++++++ arch/arm/include/asm/arch-rockchip/pmu_rk3188.h | 36 + arch/arm/mach-rockchip/Kconfig | 20 + arch/arm/mach-rockchip/Makefile | 14 +- arch/arm/mach-rockchip/rk3036-board-spl.c | 3 +- arch/arm/mach-rockchip/rk3188-board-spl.c | 218 ++++++ arch/arm/mach-rockchip/rk3188-board-tpl.c | 86 ++ arch/arm/mach-rockchip/rk3188-board.c | 71 ++ arch/arm/mach-rockchip/rk3188/Kconfig | 35 + arch/arm/mach-rockchip/rk3188/Makefile | 11 + arch/arm/mach-rockchip/rk3188/clk_rk3188.c | 33 + arch/arm/mach-rockchip/rk3188/sdram_rk3188.c | 995 ++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3188/syscon_rk3188.c | 55 ++ arch/arm/mach-rockchip/rk3288-board-spl.c | 3 +- arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 59 +- board/radxa/rock/Kconfig | 15 + board/radxa/rock/MAINTAINERS | 6 + board/radxa/rock/Makefile | 7 + board/radxa/rock/rock.c | 7 + configs/rock_defconfig | 56 ++ doc/README.rockchip | 26 + doc/driver-model/README.txt | 4 + drivers/clk/at91/pmc.c | 3 +- drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk_rk3188.c | 527 +++++++++++++ drivers/clk/rockchip/clk_rk3288.c | 2 + drivers/core/root.c | 2 +- drivers/core/util.c | 25 + drivers/pinctrl/Kconfig | 9 + drivers/pinctrl/pinctrl-uclass.c | 3 +- drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl_rk3188.c | 611 +++++++++++++++ drivers/serial/serial_rockchip.c | 19 +- drivers/sysreset/Makefile | 1 + drivers/sysreset/sysreset_rk3188.c | 47 ++ include/configs/rk3188_common.h | 125 +++ include/configs/rock.h | 30 + include/dm/util.h | 26 + include/dt-bindings/clock/rk3066a-cru.h | 32 + include/dt-bindings/clock/rk3188-cru-common.h | 256 ++++++ include/dt-bindings/clock/rk3188-cru.h | 48 ++ mkuboot | 35 + scripts/Makefile.spl | 7 +- tools/dtoc/dtoc.py | 2 + tools/rkcommon.c | 34 +- tools/rkcommon.h | 22 + tools/rkimage.c | 3 + tools/rksd.c | 4 + tools/rkspi.c | 4 + 57 files changed, 5833 insertions(+), 42 deletions(-) create mode 100644 arch/arm/dts/rk3188-radxarock.dts create mode 100644 arch/arm/dts/rk3188.dtsi create mode 100644 arch/arm/dts/rk3xxx.dtsi create mode 100644 arch/arm/include/asm/arch-rockchip/bootrom.h create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/ddr_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/pmu_rk3188.h create mode 100644 arch/arm/mach-rockchip/rk3188-board-spl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board-tpl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board.c create mode 100644 arch/arm/mach-rockchip/rk3188/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3188/Makefile create mode 100644 arch/arm/mach-rockchip/rk3188/clk_rk3188.c create mode 100644 arch/arm/mach-rockchip/rk3188/sdram_rk3188.c create mode 100644 arch/arm/mach-rockchip/rk3188/syscon_rk3188.c create mode 100644 board/radxa/rock/Kconfig create mode 100644 board/radxa/rock/MAINTAINERS create mode 100644 board/radxa/rock/Makefile create mode 100644 board/radxa/rock/rock.c create mode 100644 configs/rock_defconfig create mode 100644 drivers/clk/rockchip/clk_rk3188.c create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3188.c create mode 100644 drivers/sysreset/sysreset_rk3188.c create mode 100644 include/configs/rk3188_common.h create mode 100644 include/configs/rock.h create mode 100644 include/dt-bindings/clock/rk3066a-cru.h create mode 100644 include/dt-bindings/clock/rk3188-cru-common.h create mode 100644 include/dt-bindings/clock/rk3188-cru.h create mode 100755 mkubootQuoted 2 lines
--
2.11.0I have rebased this onto mainline and pushed it to u-boot-rockchip/testing. However I get an error when building the 'rock' board:
Quoted 7 lines
make[2]: *** No rule to make target
dts/dt.dtb', needed bytpl/u-boot-tpl.dtb'. Stop.
make[1]: *** [tpl/u-boot-tpl.bin] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [sub-make] Error 2Can you please take a look?
sure ... I also found some issues, which I'm currently fixing. Looks like the uboot-floor moved under us :-)
Heiko
v4 cover rk3188 uboot support
Hi Heiko,
Quoted 142 lines · Heiko Stuebner
Am Mittwoch, 22. Februar 2017, 20:26:18 CET schrieb Simon Glass:
Quoted 141 lines
Hi Heiko,
Quoted 125 lines · Heiko Stuebner
Hi,
thanks to Kever finding the needle in the haystack (wrong resets in sdram driver actually resetting the sdmmc controller) the rk3188 can now actually load uboot into memory from spl ... yay .
So this v4 does hopefully addresses all last review comments from Simon and includes of course the newly received tags so far.
Heiko
Heiko Stuebner (21):
dm: allow limiting pre-reloc markings to spl or tpl
clk: rk3288: limit gpll and cpll init to SPL build
rockchip: rk3288: sdram: use constants in ddrconf table
rockchip: rk3288: sdram: style fixes from rk3188 sdram review
rockchip: Move bootrom helper compilation to a hidden option
rockchip: Move bootrom-related declarations to a header
rockchip: mkimage: Allow encoding of loader code in spl images
rockchip: mkimage: Add support rk3188 serial
rockchip: serial: Adapt rockchip of-platdata driver for rk3188
rockchip: rk3188: Add header files for PMU and GRF
rockchip: rk3188: Add pinctrl driver
rockchip: rk3188: Add sysreset driver
rockchip: rk3188: Add rk3066/rk3188 clock bindings
rockchip: rk3188: Add clock driver
rockchip: rk3188: Add core devicetree files
rockchip: rk3188: Add core support
rockchip: rk3188: Add sdram driver
rockchip: rk3188: Add main, spl and tpl boards
rockchip: rk3188: Add Radxa Rock board
rockchip: rk3188: add README.rockchip paragraph describing sd boot Add a temporary script that can create a bootimage for rk3188arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3188-radxarock.dts | 382 +++++++++ arch/arm/dts/rk3188.dtsi | 601 ++++++++++++++ arch/arm/dts/rk3xxx.dtsi | 417 ++++++++++ arch/arm/include/asm/arch-rockchip/bootrom.h | 22 + arch/arm/include/asm/arch-rockchip/cru_rk3188.h | 191 +++++ arch/arm/include/asm/arch-rockchip/ddr_rk3188.h | 25 + arch/arm/include/asm/arch-rockchip/ddr_rk3288.h | 8 + arch/arm/include/asm/arch-rockchip/grf_rk3188.h | 589 ++++++++++++++ arch/arm/include/asm/arch-rockchip/pmu_rk3188.h | 36 + arch/arm/mach-rockchip/Kconfig | 20 + arch/arm/mach-rockchip/Makefile | 14 +- arch/arm/mach-rockchip/rk3036-board-spl.c | 3 +- arch/arm/mach-rockchip/rk3188-board-spl.c | 218 ++++++ arch/arm/mach-rockchip/rk3188-board-tpl.c | 86 ++ arch/arm/mach-rockchip/rk3188-board.c | 71 ++ arch/arm/mach-rockchip/rk3188/Kconfig | 35 + arch/arm/mach-rockchip/rk3188/Makefile | 11 + arch/arm/mach-rockchip/rk3188/clk_rk3188.c | 33 + arch/arm/mach-rockchip/rk3188/sdram_rk3188.c | 995 ++++++++++++++++++++++++ arch/arm/mach-rockchip/rk3188/syscon_rk3188.c | 55 ++ arch/arm/mach-rockchip/rk3288-board-spl.c | 3 +- arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 59 +- board/radxa/rock/Kconfig | 15 + board/radxa/rock/MAINTAINERS | 6 + board/radxa/rock/Makefile | 7 + board/radxa/rock/rock.c | 7 + configs/rock_defconfig | 56 ++ doc/README.rockchip | 26 + doc/driver-model/README.txt | 4 + drivers/clk/at91/pmc.c | 3 +- drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk_rk3188.c | 527 +++++++++++++ drivers/clk/rockchip/clk_rk3288.c | 2 + drivers/core/root.c | 2 +- drivers/core/util.c | 25 + drivers/pinctrl/Kconfig | 9 + drivers/pinctrl/pinctrl-uclass.c | 3 +- drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl_rk3188.c | 611 +++++++++++++++ drivers/serial/serial_rockchip.c | 19 +- drivers/sysreset/Makefile | 1 + drivers/sysreset/sysreset_rk3188.c | 47 ++ include/configs/rk3188_common.h | 125 +++ include/configs/rock.h | 30 + include/dm/util.h | 26 + include/dt-bindings/clock/rk3066a-cru.h | 32 + include/dt-bindings/clock/rk3188-cru-common.h | 256 ++++++ include/dt-bindings/clock/rk3188-cru.h | 48 ++ mkuboot | 35 + scripts/Makefile.spl | 7 +- tools/dtoc/dtoc.py | 2 + tools/rkcommon.c | 34 +- tools/rkcommon.h | 22 + tools/rkimage.c | 3 + tools/rksd.c | 4 + tools/rkspi.c | 4 + 57 files changed, 5833 insertions(+), 42 deletions(-) create mode 100644 arch/arm/dts/rk3188-radxarock.dts create mode 100644 arch/arm/dts/rk3188.dtsi create mode 100644 arch/arm/dts/rk3xxx.dtsi create mode 100644 arch/arm/include/asm/arch-rockchip/bootrom.h create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/ddr_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/pmu_rk3188.h create mode 100644 arch/arm/mach-rockchip/rk3188-board-spl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board-tpl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board.c create mode 100644 arch/arm/mach-rockchip/rk3188/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3188/Makefile create mode 100644 arch/arm/mach-rockchip/rk3188/clk_rk3188.c create mode 100644 arch/arm/mach-rockchip/rk3188/sdram_rk3188.c create mode 100644 arch/arm/mach-rockchip/rk3188/syscon_rk3188.c create mode 100644 board/radxa/rock/Kconfig create mode 100644 board/radxa/rock/MAINTAINERS create mode 100644 board/radxa/rock/Makefile create mode 100644 board/radxa/rock/rock.c create mode 100644 configs/rock_defconfig create mode 100644 drivers/clk/rockchip/clk_rk3188.c create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3188.c create mode 100644 drivers/sysreset/sysreset_rk3188.c create mode 100644 include/configs/rk3188_common.h create mode 100644 include/configs/rock.h create mode 100644 include/dt-bindings/clock/rk3066a-cru.h create mode 100644 include/dt-bindings/clock/rk3188-cru-common.h create mode 100644 include/dt-bindings/clock/rk3188-cru.h create mode 100755 mkubootQuoted 2 lines
--
2.11.0I have rebased this onto mainline and pushed it to u-boot-rockchip/testing. However I get an error when building the 'rock' board:
make[2]: *** No rule to make target
dts/dt.dtb', needed bytpl/u-boot-tpl.dtb'. Stop.
make[1]: *** [tpl/u-boot-tpl.bin] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [sub-make] Error 2
Quoted 4 lines
Quoted 1 line
Can you please take a look?
sure ... I also found some issues, which I'm currently fixing. Looks like the uboot-floor moved under us :-)
Yes I think so. Hopefully it is minor.
I'm going to drop the last two patches which actually enable 'rock' and add to the README for now. Hopefully you can figure this out and we can apply them again soon. But at least this way most of the patches can proceed.
Regards,
Simon
Heiko Stuebner
maintainerv4 cover rk3188 uboot support
Am Donnerstag, 23. Februar 2017, 09:19:20 CET schrieb Simon Glass:
Quoted 152 lines
Hi Heiko,
Quoted 144 lines · Heiko Stuebner
Am Mittwoch, 22. Februar 2017, 20:26:18 CET schrieb Simon Glass:
Quoted 143 lines
Hi Heiko,
Quoted 127 lines · Heiko Stuebner
Hi,
thanks to Kever finding the needle in the haystack (wrong resets in sdram driver actually resetting the sdmmc controller) the rk3188 can now actually load uboot into memory from spl ... yay .
So this v4 does hopefully addresses all last review comments from Simon and includes of course the newly received tags so far.
Heiko
Heiko Stuebner (21):
dm: allow limiting pre-reloc markings to spl or tpl
clk: rk3288: limit gpll and cpll init to SPL build
rockchip: rk3288: sdram: use constants in ddrconf table
rockchip: rk3288: sdram: style fixes from rk3188 sdram review
rockchip: Move bootrom helper compilation to a hidden option
rockchip: Move bootrom-related declarations to a header
rockchip: mkimage: Allow encoding of loader code in spl images
rockchip: mkimage: Add support rk3188 serial
rockchip: serial: Adapt rockchip of-platdata driver for rk3188
rockchip: rk3188: Add header files for PMU and GRF
rockchip: rk3188: Add pinctrl driver
rockchip: rk3188: Add sysreset driver
rockchip: rk3188: Add rk3066/rk3188 clock bindings
rockchip: rk3188: Add clock driver
rockchip: rk3188: Add core devicetree files
rockchip: rk3188: Add core support
rockchip: rk3188: Add sdram driver
rockchip: rk3188: Add main, spl and tpl boards
rockchip: rk3188: Add Radxa Rock board
rockchip: rk3188: add README.rockchip paragraph describing sd boot Add a temporary script that can create a bootimage for rk3188arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3188-radxarock.dts | 382 +++++++++ arch/arm/dts/rk3188.dtsi | 601 ++++++++++++++ arch/arm/dts/rk3xxx.dtsi | 417 ++++++++++ arch/arm/include/asm/arch-rockchip/bootrom.h | 22 + arch/arm/include/asm/arch-rockchip/cru_rk3188.h | 191 +++++ arch/arm/include/asm/arch-rockchip/ddr_rk3188.h | 25 + arch/arm/include/asm/arch-rockchip/ddr_rk3288.h | 8 + arch/arm/include/asm/arch-rockchip/grf_rk3188.h | 589 ++++++++++++++ arch/arm/include/asm/arch-rockchip/pmu_rk3188.h | 36 + arch/arm/mach-rockchip/Kconfig | 20 + arch/arm/mach-rockchip/Makefile | 14 +- arch/arm/mach-rockchip/rk3036-board-spl.c | 3 +- arch/arm/mach-rockchip/rk3188-board-spl.c | 218 ++++++ arch/arm/mach-rockchip/rk3188-board-tpl.c | 86 ++ arch/arm/mach-rockchip/rk3188-board.c | 71 ++ arch/arm/mach-rockchip/rk3188/Kconfig | 35 + arch/arm/mach-rockchip/rk3188/Makefile | 11 + arch/arm/mach-rockchip/rk3188/clk_rk3188.c | 33 + arch/arm/mach-rockchip/rk3188/sdram_rk3188.c | 995++++++++++++++++++++++++
arch/arm/mach-rockchip/rk3188/syscon_rk3188.c| 55 ++
arch/arm/mach-rockchip/rk3288-board-spl.c | 3 +- arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 59 +- board/radxa/rock/Kconfig | 15 + board/radxa/rock/MAINTAINERS | 6 + board/radxa/rock/Makefile | 7 + board/radxa/rock/rock.c | 7 + configs/rock_defconfig | 56 ++ doc/README.rockchip | 26 + doc/driver-model/README.txt | 4 + drivers/clk/at91/pmc.c | 3 +- drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk_rk3188.c | 527 +++++++++++++ drivers/clk/rockchip/clk_rk3288.c | 2 + drivers/core/root.c | 2 +- drivers/core/util.c | 25 + drivers/pinctrl/Kconfig | 9 + drivers/pinctrl/pinctrl-uclass.c | 3 +- drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl_rk3188.c | 611 +++++++++++++++ drivers/serial/serial_rockchip.c | 19 +- drivers/sysreset/Makefile | 1 + drivers/sysreset/sysreset_rk3188.c | 47 ++ include/configs/rk3188_common.h | 125 +++ include/configs/rock.h | 30 + include/dm/util.h | 26 + include/dt-bindings/clock/rk3066a-cru.h | 32 + include/dt-bindings/clock/rk3188-cru-common.h | 256 ++++++ include/dt-bindings/clock/rk3188-cru.h | 48 ++ mkuboot | 35 + scripts/Makefile.spl | 7 +- tools/dtoc/dtoc.py | 2 + tools/rkcommon.c | 34 +- tools/rkcommon.h | 22 + tools/rkimage.c | 3 + tools/rksd.c | 4 + tools/rkspi.c | 4 + 57 files changed, 5833 insertions(+), 42 deletions(-) create mode 100644 arch/arm/dts/rk3188-radxarock.dts create mode 100644 arch/arm/dts/rk3188.dtsi create mode 100644 arch/arm/dts/rk3xxx.dtsi create mode 100644 arch/arm/include/asm/arch-rockchip/bootrom.h create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/ddr_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3188.h create mode 100644 arch/arm/include/asm/arch-rockchip/pmu_rk3188.h create mode 100644 arch/arm/mach-rockchip/rk3188-board-spl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board-tpl.c create mode 100644 arch/arm/mach-rockchip/rk3188-board.c create mode 100644 arch/arm/mach-rockchip/rk3188/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3188/Makefile create mode 100644 arch/arm/mach-rockchip/rk3188/clk_rk3188.c create mode 100644 arch/arm/mach-rockchip/rk3188/sdram_rk3188.c create mode 100644 arch/arm/mach-rockchip/rk3188/syscon_rk3188.c create mode 100644 board/radxa/rock/Kconfig create mode 100644 board/radxa/rock/MAINTAINERS create mode 100644 board/radxa/rock/Makefile create mode 100644 board/radxa/rock/rock.c create mode 100644 configs/rock_defconfig create mode 100644 drivers/clk/rockchip/clk_rk3188.c create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3188.c create mode 100644 drivers/sysreset/sysreset_rk3188.c create mode 100644 include/configs/rk3188_common.h create mode 100644 include/configs/rock.h create mode 100644 include/dt-bindings/clock/rk3066a-cru.h create mode 100644 include/dt-bindings/clock/rk3188-cru-common.h create mode 100644 include/dt-bindings/clock/rk3188-cru.h create mode 100755 mkubootQuoted 2 lines
--
2.11.0I have rebased this onto mainline and pushed it to u-boot-rockchip/testing. However I get an error when building the 'rock' board:
make[2]: *** No rule to make target
dts/dt.dtb', needed bytpl/u-boot-tpl.dtb'. Stop.
make[1]: *** [tpl/u-boot-tpl.bin] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [sub-make] Error 2Quoted 4 lines
Quoted 1 line
Can you please take a look?
sure ... I also found some issues, which I'm currently fixing. Looks like the uboot-floor moved under us :-)
Quoted 6 lines
Yes I think so. Hopefully it is minor.
I'm going to drop the last two patches which actually enable 'rock' and add to the README for now. Hopefully you can figure this out and we can apply them again soon. But at least this way most of the patches can proceed.
already did, just the jetlag (at ELC right now) prevented me from sending these out yesterday evening. Patches coming up :-)
Heiko