add support for rk3328 SoC
Subsystems (6)
v2 cover add support for rk3328 SoC
This patchset is to support rk3328 Soc, including some basic driver like clock, pinctrl, sysreset and etc. This version enables eMMC and sd-card boot, USB and MAC driver is not ready.
RK3328 is a quad-core cortex-A53 SoC, it needs ATF support, so I would like to send the U-Boot driver without SPL in this version, for the ATF patches is still under discussion, we'd better have a version which able to work.
Changes in v2:
- split rockchip_get_cru into arch/arm/mach-rockchip
- fix include header file order
- drop MACRO for I2C reg access
- use OSC_HZ for 24*1024*1024
- fix include header file order
- add space around operators in header file
- fix include header file order
- README file fix
Kever Yang (7):
rockchip: rk3328: add device tree file
rockchip: rk3328: add soc basic support
rockchip: rk3288: add clock driver
rockchip: rk3328: add pinctrl driver
rockchip: rk3328: add sysreset driver
rockchip: rk3328: add evb-rk3328 support
rockchip: rk3288: add defconfig for evb-rk3328
arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3328-evb.dts | 45 + arch/arm/dts/rk3328.dtsi | 1477 +++++++++++++++++++++++ arch/arm/include/asm/arch-rockchip/cru_rk3328.h | 70 ++ arch/arm/include/asm/arch-rockchip/grf_rk3328.h | 134 ++ arch/arm/mach-rockchip/Kconfig | 11 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rk3328/Kconfig | 23 + arch/arm/mach-rockchip/rk3328/Makefile | 9 + arch/arm/mach-rockchip/rk3328/clk_rk3328.c | 31 + arch/arm/mach-rockchip/rk3328/rk3328.c | 39 + arch/arm/mach-rockchip/rk3328/syscon_rk3328.c | 20 + board/rockchip/evb_rk3328/Kconfig | 15 + board/rockchip/evb_rk3328/MAINTAINERS | 6 + board/rockchip/evb_rk3328/Makefile | 7 + board/rockchip/evb_rk3328/README | 70 ++ board/rockchip/evb_rk3328/evb-rk3328.c | 40 + configs/evb-rk3328_defconfig | 36 + drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk_rk3328.c | 597 +++++++++ drivers/pinctrl/Kconfig | 9 + drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl_rk3328.c | 419 +++++++ drivers/sysreset/Makefile | 1 + drivers/sysreset/sysreset_rk3328.c | 45 + include/configs/evb_rk3328.h | 26 + include/configs/rk3328_common.h | 65 + include/dt-bindings/clock/rk3328-cru.h | 394 ++++++ include/dt-bindings/pinctrl/rockchip.h | 2 + 29 files changed, 3595 insertions(+) create mode 100644 arch/arm/dts/rk3328-evb.dts create mode 100644 arch/arm/dts/rk3328.dtsi create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3328.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3328.h create mode 100644 arch/arm/mach-rockchip/rk3328/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3328/Makefile create mode 100644 arch/arm/mach-rockchip/rk3328/clk_rk3328.c create mode 100644 arch/arm/mach-rockchip/rk3328/rk3328.c create mode 100644 arch/arm/mach-rockchip/rk3328/syscon_rk3328.c create mode 100644 board/rockchip/evb_rk3328/Kconfig create mode 100644 board/rockchip/evb_rk3328/MAINTAINERS create mode 100644 board/rockchip/evb_rk3328/Makefile create mode 100644 board/rockchip/evb_rk3328/README create mode 100644 board/rockchip/evb_rk3328/evb-rk3328.c create mode 100644 configs/evb-rk3328_defconfig create mode 100644 drivers/clk/rockchip/clk_rk3328.c create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3328.c create mode 100644 drivers/sysreset/sysreset_rk3328.c create mode 100644 include/configs/evb_rk3328.h create mode 100644 include/configs/rk3328_common.h create mode 100644 include/dt-bindings/clock/rk3328-cru.h
Signature · 1 line
1.9.1
PATCH v2 1/7 rockchip: rk3328: add device tree file
Add dts binding header for rk3328, files origin from kernel.
---
Changes in v2: None
arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3328-evb.dts | 45 + arch/arm/dts/rk3328.dtsi | 1477 ++++++++++++++++++++++++++++++++ include/dt-bindings/clock/rk3328-cru.h | 394 +++++++++ 4 files changed, 1917 insertions(+) create mode 100644 arch/arm/dts/rk3328-evb.dts create mode 100644 arch/arm/dts/rk3328.dtsi create mode 100644 include/dt-bindings/clock/rk3328-cru.h
arch/arm/dts/Makefile +1 -0
@@ -38,6 +38,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \ rk3288-fennec.dtb \ rk3288-tinker.dtb \ rk3288-popmetal.dtb \ + rk3328-evb.dtb \ rk3399-evb.dtb dtb-$(CONFIG_ARCH_MESON) += \ meson-gxbb-odroidc2.dtb
arch/arm/dts/rk3328-evb.dts new file +45 -0
45 lines not on this page · raw message
arch/arm/dts/rk3328.dtsi new file +1477 -0
1,477 lines not on this page · raw message
include/dt-bindings/clock/rk3328-cru.h new file +394 -0
394 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 2/7 rockchip: rk3328: add soc basic support
In reply to Kever YangRK3328 is a SoC from Rockchip with quad-core Cortex-A53 CPU. It supports two USB2.0 EHCI ports. Other interfaces are very much like RK3288, the DRAM are 32bit width address and support address from 0 to 4GB-16MB range.
---
Changes in v2: None
arch/arm/mach-rockchip/Kconfig | 11 +++++ arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rk3328/Kconfig | 23 ++++++++++ arch/arm/mach-rockchip/rk3328/Makefile | 8 ++++ arch/arm/mach-rockchip/rk3328/rk3328.c | 39 ++++++++++++++++ arch/arm/mach-rockchip/rk3328/syscon_rk3328.c | 20 +++++++++ include/configs/rk3328_common.h | 65 +++++++++++++++++++++++++++ 7 files changed, 167 insertions(+) create mode 100644 arch/arm/mach-rockchip/rk3328/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3328/Makefile create mode 100644 arch/arm/mach-rockchip/rk3328/rk3328.c create mode 100644 arch/arm/mach-rockchip/rk3328/syscon_rk3328.c create mode 100644 include/configs/rk3328_common.h
arch/arm/mach-rockchip/Kconfig +11 -0
@@ -23,6 +23,16 @@ config ROCKCHIP_RK3288 and video codec support. Peripherals include Gigabit Ethernet, USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs. +config ROCKCHIP_RK3328 + bool "Support Rockchip RK3328" + select ARM64 + help + The Rockchip RK3328 is a ARM-based SoC with a quad-core Cortex-A53. + including NEON and GPU, 1MB L2 cache, Mali-T7 graphics, two + video interfaces supporting HDMI and eDP, several DDR3 options + and video codec support. Peripherals include Gigabit Ethernet, + USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs. + config ROCKCHIP_RK3399 bool "Support Rockchip RK3399" select ARM64
@@ -47,5 +57,6 @@ config SPL_MMC_SUPPORT source "arch/arm/mach-rockchip/rk3036/Kconfig" source "arch/arm/mach-rockchip/rk3288/Kconfig" +source "arch/arm/mach-rockchip/rk3328/Kconfig" source "arch/arm/mach-rockchip/rk3399/Kconfig" endif
arch/arm/mach-rockchip/Makefile +1 -0
@@ -17,4 +17,5 @@ obj-y += rk_timer.o endif obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036/ obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288/ +obj-$(CONFIG_ROCKCHIP_RK3328) += rk3328/ obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399/
arch/arm/mach-rockchip/rk3328/Kconfig new file +23 -0
@@ -0,0 +1,23 @@ +if ROCKCHIP_RK3328 + +choice + prompt "RK3328 board select" + +config TARGET_EVB_RK3328 + bool "RK3328 evaluation board" + help + RK3328evb is a evaluation board for Rockchip rk3328, + with full function and phisical connectors support like + usb2.0 host ports, LVDS, JTAG, MAC, SDcard, HDMI, USB-2-serial... + +endchoice + +config SYS_SOC + default "rockchip" + +config SYS_MALLOC_F_LEN + default 0x0800 + +source "board/rockchip/evb_rk3328/Kconfig" + +endif
arch/arm/mach-rockchip/rk3328/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# +# (C) Copyright 2016 Rockchip Electronics Co., Ltd +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += rk3328.o +obj-y += syscon_rk3328.o
arch/arm/mach-rockchip/rk3328/rk3328.c new file +39 -0
@@ -0,0 +1,39 @@ +/* +* Copyright (c) 2016 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <asm/arch/hardware.h> +#include <asm/armv8/mmu.h> +#include <asm/io.h> + +static struct mm_region rk3328_mem_map[] = { + { + .virt =0x0UL , + .phys =0x0UL , + .size =0x80000000UL , + .attrs =PTE_BLOCK_MEMTYPE (MT_NORMAL ) | +PTE_BLOCK_INNER_SHARE + }, { + .virt =0xf0000000UL , + .phys =0xf0000000UL , + .size =0x10000000UL , + .attrs =PTE_BLOCK_MEMTYPE (MT_DEVICE_NGNRNE ) | +PTE_BLOCK_NON_SHARE | +PTE_BLOCK_PXN |PTE_BLOCK_UXN + }, { +/* List terminator */ +0 , + } +}; + +struct mm_region *mem_map = rk3328_mem_map; + +int arch_cpu_init (void ) +{ +/* We do some SoC one time setting here. */ + +return 0 ; +}
arch/arm/mach-rockchip/rk3328/syscon_rk3328.c new file +20 -0
@@ -0,0 +1,20 @@ +/* +* (C) Copyright 2016 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <asm/arch/clock.h> +#include <dm.h> +#include <syscon.h> + +static const struct udevice_id rk3328_syscon_ids[] = { + { .compatible ="rockchip,rk3328-grf" , .data =ROCKCHIP_SYSCON_GRF }, +}; + +U_BOOT_DRIVER (syscon_rk3328) = { + .name ="rk3328_syscon" , + .id =UCLASS_SYSCON , + .of_match = rk3328_syscon_ids, +};
include/configs/rk3328_common.h new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 3/7 rockchip: rk3288: add clock driver
In reply to Kever YangAdd rk3328 clock driver and cru structure definition.
---
Changes in v2:
- split rockchip_get_cru into arch/arm/mach-rockchip
- fix include header file order
- drop MACRO for I2C reg access
- use OSC_HZ for 24*1024*1024
arch/arm/include/asm/arch-rockchip/cru_rk3328.h | 70 +++ arch/arm/mach-rockchip/rk3328/Makefile | 1 + arch/arm/mach-rockchip/rk3328/clk_rk3328.c | 31 ++ drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk_rk3328.c | 597 ++++++++++++++++++++++++ 5 files changed, 700 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3328.h create mode 100644 arch/arm/mach-rockchip/rk3328/clk_rk3328.c create mode 100644 drivers/clk/rockchip/clk_rk3328.c
arch/arm/include/asm/arch-rockchip/cru_rk3328.h new file +70 -0
@@ -0,0 +1,70 @@ +/* +* (C) Copyright 2016 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __ASM_ARCH_CRU_RK3328_H_ +#define __ASM_ARCH_CRU_RK3328_H_ + +#include <common.h> + +struct rk3328_clk_priv { +struct rk3328_cru *cru; +ulong rate; +}; + +struct rk3328_cru { +u32 apll_con[5 ]; +u32 reserved1[3 ]; +u32 dpll_con[5 ]; +u32 reserved2[3 ]; +u32 cpll_con[5 ]; +u32 reserved3[3 ]; +u32 gpll_con[5 ]; +u32 reserved4[3 ]; +u32 mode_con; +u32 misc; +u32 reserved5[2 ]; +u32 glb_cnt_th; +u32 glb_rst_st; +u32 glb_srst_snd_value; +u32 glb_srst_fst_value; +u32 npll_con[5 ]; +u32 reserved6[(0x100 -0xb4 ) /4 ]; +u32 clksel_con[53 ]; +u32 reserved7[(0x200 -0x1d4 ) /4 ]; +u32 clkgate_con[29 ]; +u32 reserved8[3 ]; +u32 ssgtbl[32 ]; +u32 softrst_con[12 ]; +u32 reserved9[(0x380 -0x330 ) /4 ]; +u32 sdmmc_con[2 ]; +u32 sdio_con[2 ]; +u32 emmc_con[2 ]; +u32 sdmmc_ext_con[2 ]; +}; +check_member (rk3328_cru, sdmmc_ext_con[1 ],0x39c ); +#define MHz 1000000 +#define KHz 1000 +#define OSC_HZ (24 * MHz) +#define APLL_HZ (600 * MHz) +#define GPLL_HZ (576 * MHz) +#define CPLL_HZ (594 * MHz) + +#define CLK_CORE_HZ (600 * MHz) +#define ACLKM_CORE_HZ (300 * MHz) +#define PCLK_DBG_HZ (300 * MHz) + +#define PERIHP_ACLK_HZ (144000 * KHz) +#define PERIHP_HCLK_HZ (72000 * KHz) +#define PERIHP_PCLK_HZ (72000 * KHz) + +#define PWM_CLOCK_HZ (74 * MHz) + +enum apll_frequencies { +APLL_816_MHZ , +APLL_600_MHZ , +}; + +#endif /* __ASM_ARCH_CRU_RK3328_H_ */
arch/arm/mach-rockchip/rk3328/Makefile +1 -0
@@ -4,5 +4,6 @@ # SPDX-License-Identifier: GPL-2.0+ # +obj-y += clk_rk3328.o obj-y += rk3328.o obj-y += syscon_rk3328.o
arch/arm/mach-rockchip/rk3328/clk_rk3328.c new file +31 -0
@@ -0,0 +1,31 @@ +/* +* (C) Copyright 2017 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0 +*/ + +#include <common.h> +#include <dm.h> +#include <asm/arch/clock.h> +#include <asm/arch/cru_rk3328.h> + +int rockchip_get_clk (struct udevice **devp) +{ +return uclass_get_device_by_driver (UCLASS_CLK , +DM_GET_DRIVER (rockchip_rk3328_cru), devp); +} + +void *rockchip_get_cru (void ) +{ +struct rk3328_clk_priv *priv; +struct udevice *dev; +int ret; + + ret =rockchip_get_clk (&dev); +if (ret) +return ERR_PTR (ret); + + priv =dev_get_addr_ptr (dev); + +return priv->cru; +}
drivers/clk/rockchip/Makefile +1 -0
@@ -6,4 +6,5 @@ obj-$(CONFIG_ROCKCHIP_RK3036) += clk_rk3036.o obj-$(CONFIG_ROCKCHIP_RK3288) += clk_rk3288.o +obj-$(CONFIG_ROCKCHIP_RK3328) += clk_rk3328.o obj-$(CONFIG_ROCKCHIP_RK3399) += clk_rk3399.o
drivers/clk/rockchip/clk_rk3328.c new file +597 -0
597 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 3/7 rockchip: rk3288: add clock driver
Hi Kever,
Quoted 10 lines · Kever Yang
Add rk3328 clock driver and cru structure definition.
Signed-off-by William Zhang <[email protected]>Signed-off-by Kever Yang <[email protected]>---
Changes in v2:
- splitrockchip_get_cruintoarch/arm/mach-rockchip
- fix include header file order
- drop MACRO for I2C reg access
It looks like they are still here.
Quoted 12 lines
- use
OSC_HZfor 24*1024*1024arch/arm/include/asm/arch-rockchip/cru_rk3328.h | 70 +++ arch/arm/mach-rockchip/rk3328/Makefile | 1 + arch/arm/mach-rockchip/rk3328/clk_rk3328.c | 31 ++ drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk_rk3328.c | 597 ++++++++++++++++++++++++ 5 files changed, 700 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3328.h create mode 100644 arch/arm/mach-rockchip/rk3328/clk_rk3328.c create mode 100644 drivers/clk/rockchip/clk_rk3328.c
[..]
Quoted 12 lines
drivers/clk/rockchip/clk_rk3328.c new file +6
-0@@ -0,0 +1,597 @@ +/* +* (C) Copyright 2017 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0 +*/ +
[..]
Quoted 5 lines
drivers/clk/rockchip/clk_rk3328.c new file +5
-0+#define I2C_CLK_REG_MASK (bus) \ + (CLK_I2C_DIV_CON_MASK << \ + CLK_I2C ##bus## _DIV_CON_SHIFT | \ + CLK_I2C_PLL_SEL_MASK << \ + CLK_I2C ##bus## _PLL_SEL_SHIFT)
drivers/clk/rockchip/clk_rk3328.c line 185
Quoted 10 lines
drivers/clk/rockchip/clk_rk3328.c new file +10
-0+ +#define I2C_CLK_REG_VALUE (bus, clk_div) \ + ((clk_div - 1) << \ + CLK_I2C ##bus## _DIV_CON_SHIFT | \ + CLK_I2C_PLL_SEL_GPLL << \ + CLK_I2C ##bus## _PLL_SEL_SHIFT) + +#define I2C_CLK_DIV_VALUE (con, bus) \ + (con >> CLK_I2C ##bus## _DIV_CON_SHIFT) & \ + CLK_I2C_DIV_CON_MASK;
See above.
Regards,
Simon
PATCH v2 4/7 rockchip: rk3328: add pinctrl driver
In reply to Kever YangAdd rk3328 pinctrl driver and grf/iomux structure definition.
---
Changes in v2:
- fix include header file order
- add space around operators in header file
arch/arm/include/asm/arch-rockchip/grf_rk3328.h | 134 ++++++++ drivers/pinctrl/Kconfig | 9 + drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl_rk3328.c | 419 ++++++++++++++++++++++++ include/dt-bindings/pinctrl/rockchip.h | 2 + 5 files changed, 565 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3328.h create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3328.c
arch/arm/include/asm/arch-rockchip/grf_rk3328.h new file +134 -0
@@ -0,0 +1,134 @@ +/* +* (C) Copyright 2016 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __SOC_ROCKCHIP_RK3328_GRF_H__ +#define __SOC_ROCKCHIP_RK3328_GRF_H__ + +struct rk3328_grf_regs { +u32 gpio0a_iomux; +u32 gpio0b_iomux; +u32 gpio0c_iomux; +u32 gpio0d_iomux; +u32 gpio1a_iomux; +u32 gpio1b_iomux; +u32 gpio1c_iomux; +u32 gpio1d_iomux; +u32 gpio2a_iomux; +u32 gpio2bl_iomux; +u32 gpio2bh_iomux; +u32 gpio2cl_iomux; +u32 gpio2ch_iomux; +u32 gpio2d_iomux; +u32 gpio3al_iomux; +u32 gpio3ah_iomux; +u32 gpio3bl_iomux; +u32 gpio3bh_iomux; +u32 gpio3c_iomux; +u32 gpio3d_iomux; +u32 com_iomux; +u32 reserved1[(0x100 -0x54 ) /4 ]; + +u32 gpio0a_p; +u32 gpio0b_p; +u32 gpio0c_p; +u32 gpio0d_p; +u32 gpio1a_p; +u32 gpio1b_p; +u32 gpio1c_p; +u32 gpio1d_p; +u32 gpio2a_p; +u32 gpio2b_p; +u32 gpio2c_p; +u32 gpio2d_p; +u32 gpio3a_p; +u32 gpio3b_p; +u32 gpio3c_p; +u32 gpio3d_p; +u32 reserved2[(0x200 -0x140 ) /4 ]; +u32 gpio0a_e; +u32 gpio0b_e; +u32 gpio0c_e; +u32 gpio0d_e; +u32 gpio1a_e; +u32 gpio1b_e; +u32 gpio1c_e; +u32 gpio1d_e; +u32 gpio2a_e; +u32 gpio2b_e; +u32 gpio2c_e; +u32 gpio2d_e; +u32 gpio3a_e; +u32 gpio3b_e; +u32 gpio3c_e; +u32 gpio3d_e; +u32 reserved3[(0x300 -0x240 ) /4 ]; +u32 gpio0l_sr; +u32 gpio0h_sr; +u32 gpio1l_sr; +u32 gpio1h_sr; +u32 gpio2l_sr; +u32 gpio2h_sr; +u32 gpio3l_sr; +u32 gpio3h_sr; +u32 reserved4[(0x380 -0x320 ) /4 ]; +u32 gpio0l_smt; +u32 gpio0h_smt; +u32 gpio1l_smt; +u32 gpio1h_smt; +u32 gpio2l_smt; +u32 gpio2h_smt; +u32 gpio3l_smt; +u32 gpio3h_smt; +u32 reserved5[(0x400 -0x3a0 ) /4 ]; +u32 soc_con[11 ]; +u32 reserved6[(0x480 -0x42c ) /4 ]; +u32 soc_status[5 ]; +u32 reserved7[(0x4c0 -0x494 ) /4 ]; +u32 otg3_con[2 ]; +u32 reserved8[(0x500 -0x4c8 ) /4 ]; +u32 cpu_con[2 ]; +u32 reserved9[(0x520 -0x508 ) /4 ]; +u32 cpu_status[2 ]; +u32 reserved10[(0x5c8 -0x528 ) /4 ]; +u32 os_reg[8 ]; +u32 reserved11[(0x680 -0x5e8 ) /4 ]; +u32 sig_detect_con; +u32 reserved12[3 ]; +u32 sig_detect_status; +u32 reserved13[3 ]; +u32 sig_detect_status_clr; +u32 reserved14[3 ]; + +u32 sdmmc_det_counter; +u32 reserved15[(0x700 -0x6b4 ) /4 ]; +u32 host0_con[3 ]; +u32 reserved16[(0x880 -0x70c ) /4 ]; +u32 otg_con0; +u32 reserved17[3 ]; +u32 host0_status; +u32 reserved18[(0x900 -0x894 ) /4 ]; +u32 mac_con[3 ]; +u32 reserved19[(0xb00 -0x90c ) /4 ]; +u32 macphy_con[4 ]; +u32 macphy_status; +}; +check_member (rk3328_grf_regs, macphy_status,0xb10 ); + +struct rk3328_sgrf_regs { +u32 soc_con[6 ]; +u32 reserved0[(0x100 -0x18 ) /4 ]; +u32 dmac_con[6 ]; +u32 reserved1[(0x180 -0x118 ) /4 ]; +u32 fast_boot_addr; +u32 reserved2[(0x200 -0x184 ) /4 ]; +u32 chip_fuse_con; +u32 reserved3[(0x280 -0x204 ) /4 ]; +u32 hdcp_key_reg[8 ]; +u32 hdcp_key_access_mask; +}; +check_member (rk3328_sgrf_regs, hdcp_key_access_mask,0x2a0 ); + +#endif /* __SOC_ROCKCHIP_RK3328_GRF_H__ */
drivers/pinctrl/Kconfig +9 -0
@@ -148,6 +148,15 @@ config PINCTRL_AT91PIO4 This option is to enable the AT91 pinctrl driver for AT91 PIO4 controller which is available on SAMA5D2 SoC. +config ROCKCHIP_RK3328_PINCTRL + bool "Rockchip pin control driver" + depends on DM + help + Support pin multiplexing control on Rockchip rk3328 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_RK3399_PINCTRL bool "Rockchip pin control driver" depends on DM
drivers/pinctrl/rockchip/Makefile +1 -0
@@ -7,4 +7,5 @@ obj-$(CONFIG_ROCKCHIP_RK3036_PINCTRL) += pinctrl_rk3036.o obj-$(CONFIG_ROCKCHIP_RK3288_PINCTRL) += pinctrl_rk3288.o +obj-$(CONFIG_ROCKCHIP_RK3328_PINCTRL) += pinctrl_rk3328.o obj-$(CONFIG_ROCKCHIP_RK3399_PINCTRL) += pinctrl_rk3399.o
drivers/pinctrl/rockchip/pinctrl_rk3328.c new file +419 -0
419 lines not on this page · raw message
include/dt-bindings/pinctrl/rockchip.h +2 -0
@@ -22,5 +22,7 @@#define RK_FUNC_2 2#define RK_FUNC_3 3#define RK_FUNC_4 4 +#define RK_FUNC_5 5 +#define RK_FUNC_6 6#endif
Signature · 1 line
1.9.1
PATCH v2 5/7 rockchip: rk3328: add sysreset driver
In reply to Kever YangAdd rk3328 sysreset driver.
---
Changes in v2:
- fix include header file order
drivers/sysreset/Makefile | 1 + drivers/sysreset/sysreset_rk3328.c | 45 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 drivers/sysreset/sysreset_rk3328.c
drivers/sysreset/Makefile +1 -0
@@ -10,6 +10,7 @@ ifndef CONFIG_SPL_BUILD obj-$(CONFIG_ROCKCHIP_RK3036) += sysreset_rk3036.o endif obj-$(CONFIG_ROCKCHIP_RK3288) += sysreset_rk3288.o +obj-$(CONFIG_ROCKCHIP_RK3328) += sysreset_rk3328.o obj-$(CONFIG_ROCKCHIP_RK3399) += sysreset_rk3399.o obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o obj-$(CONFIG_ARCH_SNAPDRAGON) += sysreset_snapdragon.o
drivers/sysreset/sysreset_rk3328.c new file +45 -0
45 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 6/7 rockchip: rk3328: add evb-rk3328 support
In reply to Kever Yangevb-rk3328 is an evb from Rockchip based on rk3328 SoC:
- 2 USB2.0 Host port;
- 1 USB3.0 Host port;
- 1 HDMI port;
- 2 10/100M eth port;
- 2GB ddr;
- 16GB eMMC;
- UART to USB debug port;
---
Changes in v2:
- README file fix
board/rockchip/evb_rk3328/Kconfig | 15 ++++++++ board/rockchip/evb_rk3328/MAINTAINERS | 6 +++ board/rockchip/evb_rk3328/Makefile | 7 ++++ board/rockchip/evb_rk3328/README | 70 ++++++++++++++++++++++++++++++++++ board/rockchip/evb_rk3328/evb-rk3328.c | 40 +++++++++++++++++++ include/configs/evb_rk3328.h | 26 +++++++++++++ 6 files changed, 164 insertions(+) create mode 100644 board/rockchip/evb_rk3328/Kconfig create mode 100644 board/rockchip/evb_rk3328/MAINTAINERS create mode 100644 board/rockchip/evb_rk3328/Makefile create mode 100644 board/rockchip/evb_rk3328/README create mode 100644 board/rockchip/evb_rk3328/evb-rk3328.c create mode 100644 include/configs/evb_rk3328.h
board/rockchip/evb_rk3328/Kconfig new file +15 -0
@@ -0,0 +1,15 @@ +if TARGET_EVB_RK3328 + +config SYS_BOARD + default "evb_rk3328" + +config SYS_VENDOR + default "rockchip" + +config SYS_CONFIG_NAME + default "evb_rk3328" + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + +endif
board/rockchip/evb_rk3328/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +EVB-RK3328 +M: William Zhang <[email protected]> +S: Maintained +F: board/rockchip/evb_rk3328 +F: include/configs/evb_rk3328.h +F: configs/evb-rk3328_defconfig
board/rockchip/evb_rk3328/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# (C) Copyright 2016 Rockchip Electronics Co., Ltd +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += evb-rk3328.o
board/rockchip/evb_rk3328/README new file +70 -0
70 lines not on this page · raw message
board/rockchip/evb_rk3328/evb-rk3328.c new file +40 -0
@@ -0,0 +1,40 @@ +/* +* (C) Copyright 2016 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <asm/armv8/mmu.h> +#include <dwc3-uboot.h> +#include <usb.h> + +DECLARE_GLOBAL_DATA_PTR ; + +int board_init (void ) +{ +return 0 ; +} + +int dram_init (void ) +{ + gd->ram_size =0x80000000 ; +return 0 ; +} + +void dram_init_banksize (void ) +{ +/* Reserve 0x200000 for ATF bl31 */ + gd->bd->bi_dram[0 ].start =0x200000 ; + gd->bd->bi_dram[0 ].size =0x7e000000 ; +} + +int usb_gadget_handle_interrupts (void ) +{ +return 0 ; +} + +int board_usb_init (int index,enum usb_init_type init) +{ +return 0 ; +}
include/configs/evb_rk3328.h new file +26 -0
@@ -0,0 +1,26 @@ +/* +* (C) Copyright 2016 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __EVB_RK3328_H +#define __EVB_RK3328_H + +#include <configs/rk3328_common.h> + +#define CONFIG_ENV_IS_IN_MMC +#define CONFIG_SYS_MMC_ENV_DEV 1 +/* +* SPL @ 32k for ~36k +* ENV @ 96k +* u-boot @ 128K +*/ +#define CONFIG_ENV_OFFSET (96 * 1024) + +#define SDRAM_BANK_SIZE (2UL << 30) + +#define CONFIG_SYS_WHITE_ON_BLACK +#define CONFIG_CONSOLE_SCROLL_LINES 10 + +#endif
Signature · 1 line
1.9.1
PATCH v2 7/7 rockchip: rk3288: add defconfig for evb-rk3328
In reply to Kever YangEnable board config for evb-rk3328.
SDcard and eMMC boot is OK in this initial version, USB and EMAC function is not available now, will comes later.
---
Changes in v2: None
configs/evb-rk3328_defconfig | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 configs/evb-rk3328_defconfig
configs/evb-rk3328_defconfig new file +36 -0
@@ -0,0 +1,36 @@ +CONFIG_ARM=y +CONFIG_ARCH_ROCKCHIP=y +CONFIG_ROCKCHIP_RK3328=y +CONFIG_DEFAULT_DEVICE_TREE="rk3328-evb" +CONFIG_FIT=y +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_CMD_BOOTZ=y +# CONFIG_CMD_IMLS is not set +CONFIG_CMD_GPT=y +CONFIG_CMD_MMC=y +CONFIG_CMD_SF=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_TIME=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_REGMAP=y +CONFIG_SYSCON=y +CONFIG_CLK=y +CONFIG_ROCKCHIP_GPIO=y +CONFIG_MMC_DW=y +CONFIG_MMC_DW_ROCKCHIP=y +CONFIG_PINCTRL=y +CONFIG_ROCKCHIP_RK3328_PINCTRL=y +CONFIG_REGULATOR_PWM=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_RAM=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_BASE=0xFF130000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_SYS_NS16550=y +CONFIG_SYSRESET=y +CONFIG_USE_TINY_PRINTF=y +CONFIG_ERRNO_STR=y
Signature · 1 line
1.9.1
v2 cover add support for rk3328 SoC
In reply to Kever YangHi Kever,
Quoted 82 lines · Kever Yang
This patchset is to support rk3328 Soc, including some basic driver like clock, pinctrl, sysreset and etc. This version enables eMMC and sd-card boot, USB and MAC driver is not ready.
RK3328 is a quad-core cortex-A53 SoC, it needs ATF support, so I would like to send the U-Boot driver without SPL in this version, for the ATF patches is still under discussion, we'd better have a version which able to work.
Changes in v2:
- splitrockchip_get_cruintoarch/arm/mach-rockchip
- fix include header file order
- drop MACRO for I2C reg access
- useOSC_HZfor 24*1024*1024
- fix include header file order
- add space around operators in header file
- fix include header file order
- README file fixKever Yang (7):
rockchip: rk3328: add device tree file
rockchip: rk3328: add soc basic support
rockchip: rk3288: add clock driver
rockchip: rk3328: add pinctrl driver
rockchip: rk3328: add sysreset driver
rockchip: rk3328: add evb-rk3328 support
rockchip: rk3288: add defconfig for evb-rk3328arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3328-evb.dts | 45 + arch/arm/dts/rk3328.dtsi | 1477 +++++++++++++++++++++++ arch/arm/include/asm/arch-rockchip/cru_rk3328.h | 70 ++ arch/arm/include/asm/arch-rockchip/grf_rk3328.h | 134 ++ arch/arm/mach-rockchip/Kconfig | 11 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rk3328/Kconfig | 23 + arch/arm/mach-rockchip/rk3328/Makefile | 9 + arch/arm/mach-rockchip/rk3328/clk_rk3328.c | 31 + arch/arm/mach-rockchip/rk3328/rk3328.c | 39 + arch/arm/mach-rockchip/rk3328/syscon_rk3328.c | 20 + board/rockchip/evb_rk3328/Kconfig | 15 + board/rockchip/evb_rk3328/MAINTAINERS | 6 + board/rockchip/evb_rk3328/Makefile | 7 + board/rockchip/evb_rk3328/README | 70 ++ board/rockchip/evb_rk3328/evb-rk3328.c | 40 + configs/evb-rk3328_defconfig | 36 + drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk_rk3328.c | 597 +++++++++ drivers/pinctrl/Kconfig | 9 + drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl_rk3328.c | 419 +++++++ drivers/sysreset/Makefile | 1 + drivers/sysreset/sysreset_rk3328.c | 45 + include/configs/evb_rk3328.h | 26 + include/configs/rk3328_common.h | 65 + include/dt-bindings/clock/rk3328-cru.h | 394 ++++++ include/dt-bindings/pinctrl/rockchip.h | 2 + 29 files changed, 3595 insertions(+) create mode 100644 arch/arm/dts/rk3328-evb.dts create mode 100644 arch/arm/dts/rk3328.dtsi create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3328.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3328.h create mode 100644 arch/arm/mach-rockchip/rk3328/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3328/Makefile create mode 100644 arch/arm/mach-rockchip/rk3328/clk_rk3328.c create mode 100644 arch/arm/mach-rockchip/rk3328/rk3328.c create mode 100644 arch/arm/mach-rockchip/rk3328/syscon_rk3328.c create mode 100644 board/rockchip/evb_rk3328/Kconfig create mode 100644 board/rockchip/evb_rk3328/MAINTAINERS create mode 100644 board/rockchip/evb_rk3328/Makefile create mode 100644 board/rockchip/evb_rk3328/README create mode 100644 board/rockchip/evb_rk3328/evb-rk3328.c create mode 100644 configs/evb-rk3328_defconfig create mode 100644 drivers/clk/rockchip/clk_rk3328.c create mode 100644 drivers/pinctrl/rockchip/pinctrl_rk3328.c create mode 100644 drivers/sysreset/sysreset_rk3328.c create mode 100644 include/configs/evb_rk3328.h create mode 100644 include/configs/rk3328_common.h create mode 100644 include/dt-bindings/clock/rk3328-cru.h
Quoted 3 lines
--
1.9.1
I had various bisect problems with this series. I have pushed it to u-boot-rockchip/testing. Can you please check it? Also please can you take another look at the clock driver per my comment?
Regards,
Simon