Add RK3568 SoC support
Subsystems (3)
cover Add RK3568 SoC support
This series adds support for the rk3588 soc and its evaluation board. SPL will be supported after this series of patches.
Joseph Chen (5):
arm: dts: Sync rockchip-pinconf.dtsi from kernel
arm: dts: rockchip: Add dts for rk3568 evb
rockchip: rk3568: Add sdram driver
rockchip: Add rk3568 architecture core
board: rockchip: Add rk3568 evb support
arch/arm/dts/Makefile | 3 + arch/arm/dts/rk3568-evb-u-boot.dtsi | 23 + arch/arm/dts/rk3568-evb.dts | 79 + arch/arm/dts/rk3568-pinctrl.dtsi | 3111 +++++++++++++++++ arch/arm/dts/rk3568-u-boot.dtsi | 37 + arch/arm/dts/rk3568.dtsi | 779 +++++ arch/arm/dts/rockchip-pinconf.dtsi | 344 ++ arch/arm/include/asm/arch-rk3568/boot0.h | 11 + arch/arm/include/asm/arch-rk3568/gpio.h | 11 + .../include/asm/arch-rockchip/grf_rk3568.h | 369 ++ arch/arm/mach-rockchip/Kconfig | 18 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rk3568/Kconfig | 20 + arch/arm/mach-rockchip/rk3568/Makefile | 9 + arch/arm/mach-rockchip/rk3568/clk_rk3568.c | 53 + arch/arm/mach-rockchip/rk3568/rk3568.c | 85 + arch/arm/mach-rockchip/rk3568/syscon_rk3568.c | 24 + board/rockchip/evb_rk3568/Kconfig | 15 + board/rockchip/evb_rk3568/MAINTAINERS | 6 + board/rockchip/evb_rk3568/Makefile | 7 + board/rockchip/evb_rk3568/evb_rk3568.c | 4 + configs/evb-rk3568_defconfig | 35 + drivers/ram/rockchip/Makefile | 1 + drivers/ram/rockchip/sdram_rk3568.c | 56 + include/configs/evb_rk3568.h | 17 + include/configs/rk3568_common.h | 43 + 26 files changed, 5161 insertions(+) create mode 100644 arch/arm/dts/rk3568-evb-u-boot.dtsi create mode 100644 arch/arm/dts/rk3568-evb.dts create mode 100644 arch/arm/dts/rk3568-pinctrl.dtsi create mode 100644 arch/arm/dts/rk3568-u-boot.dtsi create mode 100644 arch/arm/dts/rk3568.dtsi create mode 100644 arch/arm/dts/rockchip-pinconf.dtsi create mode 100644 arch/arm/include/asm/arch-rk3568/boot0.h create mode 100644 arch/arm/include/asm/arch-rk3568/gpio.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3568.h create mode 100644 arch/arm/mach-rockchip/rk3568/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3568/Makefile create mode 100644 arch/arm/mach-rockchip/rk3568/clk_rk3568.c create mode 100644 arch/arm/mach-rockchip/rk3568/rk3568.c create mode 100644 arch/arm/mach-rockchip/rk3568/syscon_rk3568.c create mode 100644 board/rockchip/evb_rk3568/Kconfig create mode 100644 board/rockchip/evb_rk3568/MAINTAINERS create mode 100644 board/rockchip/evb_rk3568/Makefile create mode 100644 board/rockchip/evb_rk3568/evb_rk3568.c create mode 100644 configs/evb-rk3568_defconfig create mode 100644 drivers/ram/rockchip/sdram_rk3568.c create mode 100644 include/configs/evb_rk3568.h create mode 100644 include/configs/rk3568_common.h
Signature · 1 line
2.17.1
PATCH 1/5 arm: dts: Sync rockchip-pinconf.dtsi from kernel
Sync from linux kernel:
https://patchwork.kernel.org/project/linux-rockchip/list/?series=474969
---
arch/arm/dts/rockchip-pinconf.dtsi | 344 +++++++++++++++++++++++++++++ 1 file changed, 344 insertions(+) create mode 100644 arch/arm/dts/rockchip-pinconf.dtsi
arch/arm/dts/rockchip-pinconf.dtsi new file +344 -0
@@ -0,0 +1,344 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2021 Rockchip Electronics Co., Ltd. + */ + +&pinctrl { + /omit-if-no-ref/ + pcfg_pull_up: pcfg-pull-up { + bias-pull-up; + }; + + /omit-if-no-ref/ + pcfg_pull_down: pcfg-pull-down { + bias-pull-down; + }; + + /omit-if-no-ref/ + pcfg_pull_none: pcfg-pull-none { + bias-disable; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_0: pcfg-pull-none-drv-level-0 { + bias-disable; + drive-strength = <0>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_1: pcfg-pull-none-drv-level-1 { + bias-disable; + drive-strength = <1>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_2: pcfg-pull-none-drv-level-2 { + bias-disable; + drive-strength = <2>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_3: pcfg-pull-none-drv-level-3 { + bias-disable; + drive-strength = <3>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_4: pcfg-pull-none-drv-level-4 { + bias-disable; + drive-strength = <4>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_5: pcfg-pull-none-drv-level-5 { + bias-disable; + drive-strength = <5>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_6: pcfg-pull-none-drv-level-6 { + bias-disable; + drive-strength = <6>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_7: pcfg-pull-none-drv-level-7 { + bias-disable; + drive-strength = <7>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_8: pcfg-pull-none-drv-level-8 { + bias-disable; + drive-strength = <8>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_9: pcfg-pull-none-drv-level-9 { + bias-disable; + drive-strength = <9>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_10: pcfg-pull-none-drv-level-10 { + bias-disable; + drive-strength = <10>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_11: pcfg-pull-none-drv-level-11 { + bias-disable; + drive-strength = <11>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_12: pcfg-pull-none-drv-level-12 { + bias-disable; + drive-strength = <12>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_13: pcfg-pull-none-drv-level-13 { + bias-disable; + drive-strength = <13>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_14: pcfg-pull-none-drv-level-14 { + bias-disable; + drive-strength = <14>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_15: pcfg-pull-none-drv-level-15 { + bias-disable; + drive-strength = <15>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_0: pcfg-pull-up-drv-level-0 { + bias-pull-up; + drive-strength = <0>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_1: pcfg-pull-up-drv-level-1 { + bias-pull-up; + drive-strength = <1>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_2: pcfg-pull-up-drv-level-2 { + bias-pull-up; + drive-strength = <2>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_3: pcfg-pull-up-drv-level-3 { + bias-pull-up; + drive-strength = <3>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_4: pcfg-pull-up-drv-level-4 { + bias-pull-up; + drive-strength = <4>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_5: pcfg-pull-up-drv-level-5 { + bias-pull-up; + drive-strength = <5>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_6: pcfg-pull-up-drv-level-6 { + bias-pull-up; + drive-strength = <6>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_7: pcfg-pull-up-drv-level-7 { + bias-pull-up; + drive-strength = <7>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_8: pcfg-pull-up-drv-level-8 { + bias-pull-up; + drive-strength = <8>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_9: pcfg-pull-up-drv-level-9 { + bias-pull-up; + drive-strength = <9>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_10: pcfg-pull-up-drv-level-10 { + bias-pull-up; + drive-strength = <10>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_11: pcfg-pull-up-drv-level-11 { + bias-pull-up; + drive-strength = <11>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_12: pcfg-pull-up-drv-level-12 { + bias-pull-up; + drive-strength = <12>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_13: pcfg-pull-up-drv-level-13 { + bias-pull-up; + drive-strength = <13>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_14: pcfg-pull-up-drv-level-14 { + bias-pull-up; + drive-strength = <14>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_15: pcfg-pull-up-drv-level-15 { + bias-pull-up; + drive-strength = <15>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_0: pcfg-pull-down-drv-level-0 { + bias-pull-down; + drive-strength = <0>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_1: pcfg-pull-down-drv-level-1 { + bias-pull-down; + drive-strength = <1>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_2: pcfg-pull-down-drv-level-2 { + bias-pull-down; + drive-strength = <2>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_3: pcfg-pull-down-drv-level-3 { + bias-pull-down; + drive-strength = <3>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_4: pcfg-pull-down-drv-level-4 { + bias-pull-down; + drive-strength = <4>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_5: pcfg-pull-down-drv-level-5 { + bias-pull-down; + drive-strength = <5>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_6: pcfg-pull-down-drv-level-6 { + bias-pull-down; + drive-strength = <6>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_7: pcfg-pull-down-drv-level-7 { + bias-pull-down; + drive-strength = <7>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_8: pcfg-pull-down-drv-level-8 { + bias-pull-down; + drive-strength = <8>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_9: pcfg-pull-down-drv-level-9 { + bias-pull-down; + drive-strength = <9>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_10: pcfg-pull-down-drv-level-10 { + bias-pull-down; + drive-strength = <10>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_11: pcfg-pull-down-drv-level-11 { + bias-pull-down; + drive-strength = <11>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_12: pcfg-pull-down-drv-level-12 { + bias-pull-down; + drive-strength = <12>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_13: pcfg-pull-down-drv-level-13 { + bias-pull-down; + drive-strength = <13>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_14: pcfg-pull-down-drv-level-14 { + bias-pull-down; + drive-strength = <14>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_15: pcfg-pull-down-drv-level-15 { + bias-pull-down; + drive-strength = <15>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_smt: pcfg-pull-up-smt { + bias-pull-up; + input-schmitt-enable; + }; + + /omit-if-no-ref/ + pcfg_pull_down_smt: pcfg-pull-down-smt { + bias-pull-down; + input-schmitt-enable; + }; + + /omit-if-no-ref/ + pcfg_pull_none_smt: pcfg-pull-none-smt { + bias-disable; + input-schmitt-enable; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_0_smt: pcfg-pull-none-drv-level-0-smt { + bias-disable; + drive-strength = <0>; + input-schmitt-enable; + }; + + /omit-if-no-ref/ + pcfg_output_high: pcfg-output-high { + output-high; + }; + + /omit-if-no-ref/ + pcfg_output_low: pcfg-output-low { + output-low; + }; +};
Signature · 1 line
2.17.1
Re: [PATCH v1 1/5] arm: dts: Sync rockchip-pinconf.dtsi from kernel
Quoted 4 lines · Joseph Chen
Sync from linux kernel:
https://patchwork.kernel.org/project/linux-rockchip/list/?series=474969Signed-off-by Joseph Chen <[email protected]>
Thanks,
- Kever
Quoted 356 lines
---
arch/arm/dts/rockchip-pinconf.dtsi | 344 +++++++++++++++++++++++++++++ 1 file changed, 344 insertions(+)create mode 100644
arch/arm/dts/rockchip-pinconf.dtsiarch/arm/dts/rockchip-pinconf.dtsi new file +344
-0@@ -0,0 +1,344 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2021 Rockchip Electronics Co., Ltd. + */ + +&pinctrl { + /omit-if-no-ref/ + pcfg_pull_up: pcfg-pull-up { + bias-pull-up; + }; + + /omit-if-no-ref/ + pcfg_pull_down: pcfg-pull-down { + bias-pull-down; + }; + + /omit-if-no-ref/ + pcfg_pull_none: pcfg-pull-none { + bias-disable; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_0: pcfg-pull-none-drv-level-0 { + bias-disable; + drive-strength = <0>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_1: pcfg-pull-none-drv-level-1 { + bias-disable; + drive-strength = <1>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_2: pcfg-pull-none-drv-level-2 { + bias-disable; + drive-strength = <2>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_3: pcfg-pull-none-drv-level-3 { + bias-disable; + drive-strength = <3>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_4: pcfg-pull-none-drv-level-4 { + bias-disable; + drive-strength = <4>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_5: pcfg-pull-none-drv-level-5 { + bias-disable; + drive-strength = <5>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_6: pcfg-pull-none-drv-level-6 { + bias-disable; + drive-strength = <6>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_7: pcfg-pull-none-drv-level-7 { + bias-disable; + drive-strength = <7>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_8: pcfg-pull-none-drv-level-8 { + bias-disable; + drive-strength = <8>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_9: pcfg-pull-none-drv-level-9 { + bias-disable; + drive-strength = <9>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_10: pcfg-pull-none-drv-level-10 { + bias-disable; + drive-strength = <10>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_11: pcfg-pull-none-drv-level-11 { + bias-disable; + drive-strength = <11>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_12: pcfg-pull-none-drv-level-12 { + bias-disable; + drive-strength = <12>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_13: pcfg-pull-none-drv-level-13 { + bias-disable; + drive-strength = <13>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_14: pcfg-pull-none-drv-level-14 { + bias-disable; + drive-strength = <14>; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_15: pcfg-pull-none-drv-level-15 { + bias-disable; + drive-strength = <15>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_0: pcfg-pull-up-drv-level-0 { + bias-pull-up; + drive-strength = <0>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_1: pcfg-pull-up-drv-level-1 { + bias-pull-up; + drive-strength = <1>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_2: pcfg-pull-up-drv-level-2 { + bias-pull-up; + drive-strength = <2>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_3: pcfg-pull-up-drv-level-3 { + bias-pull-up; + drive-strength = <3>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_4: pcfg-pull-up-drv-level-4 { + bias-pull-up; + drive-strength = <4>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_5: pcfg-pull-up-drv-level-5 { + bias-pull-up; + drive-strength = <5>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_6: pcfg-pull-up-drv-level-6 { + bias-pull-up; + drive-strength = <6>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_7: pcfg-pull-up-drv-level-7 { + bias-pull-up; + drive-strength = <7>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_8: pcfg-pull-up-drv-level-8 { + bias-pull-up; + drive-strength = <8>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_9: pcfg-pull-up-drv-level-9 { + bias-pull-up; + drive-strength = <9>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_10: pcfg-pull-up-drv-level-10 { + bias-pull-up; + drive-strength = <10>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_11: pcfg-pull-up-drv-level-11 { + bias-pull-up; + drive-strength = <11>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_12: pcfg-pull-up-drv-level-12 { + bias-pull-up; + drive-strength = <12>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_13: pcfg-pull-up-drv-level-13 { + bias-pull-up; + drive-strength = <13>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_14: pcfg-pull-up-drv-level-14 { + bias-pull-up; + drive-strength = <14>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_drv_level_15: pcfg-pull-up-drv-level-15 { + bias-pull-up; + drive-strength = <15>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_0: pcfg-pull-down-drv-level-0 { + bias-pull-down; + drive-strength = <0>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_1: pcfg-pull-down-drv-level-1 { + bias-pull-down; + drive-strength = <1>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_2: pcfg-pull-down-drv-level-2 { + bias-pull-down; + drive-strength = <2>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_3: pcfg-pull-down-drv-level-3 { + bias-pull-down; + drive-strength = <3>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_4: pcfg-pull-down-drv-level-4 { + bias-pull-down; + drive-strength = <4>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_5: pcfg-pull-down-drv-level-5 { + bias-pull-down; + drive-strength = <5>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_6: pcfg-pull-down-drv-level-6 { + bias-pull-down; + drive-strength = <6>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_7: pcfg-pull-down-drv-level-7 { + bias-pull-down; + drive-strength = <7>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_8: pcfg-pull-down-drv-level-8 { + bias-pull-down; + drive-strength = <8>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_9: pcfg-pull-down-drv-level-9 { + bias-pull-down; + drive-strength = <9>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_10: pcfg-pull-down-drv-level-10 { + bias-pull-down; + drive-strength = <10>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_11: pcfg-pull-down-drv-level-11 { + bias-pull-down; + drive-strength = <11>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_12: pcfg-pull-down-drv-level-12 { + bias-pull-down; + drive-strength = <12>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_13: pcfg-pull-down-drv-level-13 { + bias-pull-down; + drive-strength = <13>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_14: pcfg-pull-down-drv-level-14 { + bias-pull-down; + drive-strength = <14>; + }; + + /omit-if-no-ref/ + pcfg_pull_down_drv_level_15: pcfg-pull-down-drv-level-15 { + bias-pull-down; + drive-strength = <15>; + }; + + /omit-if-no-ref/ + pcfg_pull_up_smt: pcfg-pull-up-smt { + bias-pull-up; + input-schmitt-enable; + }; + + /omit-if-no-ref/ + pcfg_pull_down_smt: pcfg-pull-down-smt { + bias-pull-down; + input-schmitt-enable; + }; + + /omit-if-no-ref/ + pcfg_pull_none_smt: pcfg-pull-none-smt { + bias-disable; + input-schmitt-enable; + }; + + /omit-if-no-ref/ + pcfg_pull_none_drv_level_0_smt: pcfg-pull-none-drv-level-0-smt { + bias-disable; + drive-strength = <0>; + input-schmitt-enable; + }; + + /omit-if-no-ref/ + pcfg_output_high: pcfg-output-high { + output-high; + }; + + /omit-if-no-ref/ + pcfg_output_low: pcfg-output-low { + output-low; + }; +};
PATCH 2/5 arm: dts: rockchip: Add dts for rk3568 evb
In reply to Joseph ChenAdd dts for rk3568 evb, sync from the linux kernel upstream list [0].
[0] https://patchwork.kernel.org/project/linux-rockchip/list/?series=474969
---
arch/arm/dts/Makefile | 3 + arch/arm/dts/rk3568-evb-u-boot.dtsi | 23 + arch/arm/dts/rk3568-evb.dts | 79 + arch/arm/dts/rk3568-pinctrl.dtsi | 3111 +++++++++++++++++++++++++++ arch/arm/dts/rk3568-u-boot.dtsi | 37 + arch/arm/dts/rk3568.dtsi | 779 +++++++ 6 files changed, 4032 insertions(+) create mode 100644 arch/arm/dts/rk3568-evb-u-boot.dtsi create mode 100644 arch/arm/dts/rk3568-evb.dts create mode 100644 arch/arm/dts/rk3568-pinctrl.dtsi create mode 100644 arch/arm/dts/rk3568-u-boot.dtsi create mode 100644 arch/arm/dts/rk3568.dtsi
arch/arm/dts/Makefile +3 -0
@@ -146,6 +146,9 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \ rk3399-rockpro64.dtb \ rk3399pro-rock-pi-n10.dtb +dtb-$(CONFIG_ROCKCHIP_RK3568) += \ + rk3568-evb.dtb + dtb-$(CONFIG_ROCKCHIP_RV1108) += \ rv1108-elgin-r1.dtb \ rv1108-evb.dtb
arch/arm/dts/rk3568-evb-u-boot.dtsi new file +23 -0
@@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2021 Rockchip Electronics Co., Ltd + */ + +#include "rk3568-u-boot.dtsi" + +/ { + chosen { + stdout-path = &uart2; + u-boot,spl-boot-order = "same-as-spl", &sdmmc0, &sdhci; + }; +}; + +&sdmmc0 { + status = "okay"; +}; + +&uart2 { + clock-frequency = <24000000>; + u-boot,dm-spl; + status = "okay"; +};
arch/arm/dts/rk3568-evb.dts new file +79 -0
79 lines not on this page · raw message
arch/arm/dts/rk3568-pinctrl.dtsi new file +3111 -0
2,889 lines not on this page · raw message
arch/arm/dts/rk3568-u-boot.dtsi new file +37 -0
Lines of this file are not shown. View the raw message.
arch/arm/dts/rk3568.dtsi new file +779 -0
779 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.17.1
Part of the diff is not shown here. View the raw message.
Re: [PATCH v1 2/5] arm: dts: rockchip: Add dts for rk3568 evb
Quoted 6 lines · Joseph Chen
Add dts for rk3568 evb, sync from the linux kernel upstream list [0].
[0] https://patchwork.kernel.org/project/linux-rockchip/list/?series=474969
Signed-off-by Joseph Chen <[email protected]>
Thanks,
- Kever
PATCH 3/5 rockchip: rk3568: Add sdram driver
In reply to Joseph ChenAdd the driver for rk3568 u-boot to get sdram capacity.
---
drivers/ram/rockchip/Makefile | 1 + drivers/ram/rockchip/sdram_rk3568.c | 56 +++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 drivers/ram/rockchip/sdram_rk3568.c
drivers/ram/rockchip/Makefile +1 -0
@@ -12,4 +12,5 @@ obj-$(CONFIG_ROCKCHIP_RK3288) = sdram_rk3288.o obj-$(CONFIG_ROCKCHIP_RK3308) = sdram_rk3308.o obj-$(CONFIG_ROCKCHIP_RK3328) = sdram_rk3328.o sdram_pctl_px30.o sdram_phy_px30.o obj-$(CONFIG_ROCKCHIP_RK3399) += sdram_rk3399.o +obj-$(CONFIG_ROCKCHIP_RK3568) += sdram_rk3568.o obj-$(CONFIG_ROCKCHIP_SDRAM_COMMON) += sdram_common.o
drivers/ram/rockchip/sdram_rk3568.c new file +56 -0
56 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [PATCH v1 3/5] rockchip: rk3568: Add sdram driver
Quoted 3 lines · Joseph Chen
Add the driver for rk3568 u-boot to get sdram capacity.
Signed-off-by Joseph Chen <[email protected]>
Thanks,
- Kever
Quoted 79 lines
---
drivers/ram/rockchip/Makefile | 1 + drivers/ram/rockchip/sdram_rk3568.c | 56 +++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+)create mode 100644
drivers/ram/rockchip/sdram_rk3568.cdrivers/ram/rockchip/Makefile +1
-0@@ -12,4 +12,5 @@ obj-$(CONFIG_ROCKCHIP_RK3288) = sdram_rk3288.o obj-$(CONFIG_ROCKCHIP_RK3308) = sdram_rk3308.o obj-$(CONFIG_ROCKCHIP_RK3328) = sdram_rk3328.o sdram_pctl_px30.o sdram_phy_px30.o obj-$(CONFIG_ROCKCHIP_RK3399) += sdram_rk3399.o +obj-$(CONFIG_ROCKCHIP_RK3568) += sdram_rk3568.o obj-$(CONFIG_ROCKCHIP_SDRAM_COMMON) += sdram_common.odrivers/ram/rockchip/sdram_rk3568.c new file +56
-0@@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd. +*/ + +#include <common.h> +#include <dm.h> +#include <ram.h> +#include <syscon.h> +#include <asm/arch-rockchip/clock.h> +#include <asm/arch-rockchip/grf_rk3568.h> +#include <asm/arch-rockchip/sdram.h> + +struct dram_info { +struct ram_info info; +struct rk3568_pmugrf *pmugrf; +}; + +static int rk3568_dmc_probe (struct udevice *dev) +{ +struct dram_info *priv =dev_get_priv (dev); + + priv->pmugrf =syscon_get_first_range (ROCKCHIP_SYSCON_PMUGRF ); + priv->info.base =CONFIG_SYS_SDRAM_BASE ; + priv->info.size = +rockchip_sdram_size ((phys_addr_t)&priv->pmugrf->pmu_os_reg2); + +return 0 ; +} + +static int rk3568_dmc_get_info (struct udevice *dev,struct ram_info *info) +{ +struct dram_info *priv =dev_get_priv (dev); + + *info = priv->info; + +return 0 ; +} + +static struct ram_ops rk3568_dmc_ops = { + .get_info = rk3568_dmc_get_info, +}; + +static const struct udevice_id rk3568_dmc_ids[] = { + { .compatible ="rockchip,rk3568-dmc" }, + { } +}; + +U_BOOT_DRIVER (dmc_rk3568) = { + .name ="rockchip_rk3568_dmc" , + .id =UCLASS_RAM , + .of_match = rk3568_dmc_ids, + .ops = &rk3568_dmc_ops, + .probe = rk3568_dmc_probe, + .priv_auto =sizeof (struct dram_info ), +};
PATCH 4/5 rockchip: Add rk3568 architecture core
In reply to Joseph ChenRK3568 is a high-performance and low power quad-core application processor designed for personal mobile internet device and AIoT equipments.
---
arch/arm/include/asm/arch-rk3568/boot0.h | 11 + arch/arm/include/asm/arch-rk3568/gpio.h | 11 + .../include/asm/arch-rockchip/grf_rk3568.h | 369 ++++++++++++++++++ arch/arm/mach-rockchip/Kconfig | 17 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rk3568/Kconfig | 20 + arch/arm/mach-rockchip/rk3568/Makefile | 9 + arch/arm/mach-rockchip/rk3568/clk_rk3568.c | 53 +++ arch/arm/mach-rockchip/rk3568/rk3568.c | 85 ++++ arch/arm/mach-rockchip/rk3568/syscon_rk3568.c | 24 ++ include/configs/rk3568_common.h | 43 ++ 11 files changed, 643 insertions(+) create mode 100644 arch/arm/include/asm/arch-rk3568/boot0.h create mode 100644 arch/arm/include/asm/arch-rk3568/gpio.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3568.h create mode 100644 arch/arm/mach-rockchip/rk3568/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3568/Makefile create mode 100644 arch/arm/mach-rockchip/rk3568/clk_rk3568.c create mode 100644 arch/arm/mach-rockchip/rk3568/rk3568.c create mode 100644 arch/arm/mach-rockchip/rk3568/syscon_rk3568.c create mode 100644 include/configs/rk3568_common.h
arch/arm/include/asm/arch-rk3568/boot0.h new file +11 -0
@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __ASM_ARCH_BOOT0_H__ +#define __ASM_ARCH_BOOT0_H__ + +#include <asm/arch-rockchip/boot0.h> + +#endif
arch/arm/include/asm/arch-rk3568/gpio.h new file +11 -0
@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __ASM_ARCH_GPIO_H__ +#define __ASM_ARCH_GPIO_H__ + +#include <asm/arch-rockchip/gpio.h> + +#endif
arch/arm/include/asm/arch-rockchip/grf_rk3568.h new file +369 -0
369 lines not on this page · raw message
arch/arm/mach-rockchip/Kconfig +17 -0
@@ -257,6 +257,23 @@ config ROCKCHIP_RK3399 and video codec support. Peripherals include Gigabit Ethernet, USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs. +config ROCKCHIP_RK3568 + bool "Support Rockchip RK3568" + select ARM64 + select CLK + select PINCTRL + select RAM + select REGMAP + select SYSCON + select BOARD_LATE_INIT + imply ROCKCHIP_COMMON_BOARD + help + The Rockchip RK3568 is a ARM-based SoC with quad-core Cortex-A55, + including NEON and GPU, 512K L3 cache, Mali-G52 based 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_RV1108 bool "Support Rockchip RV1108" select CPU_V7A
arch/arm/mach-rockchip/Makefile +1 -0
@@ -42,6 +42,7 @@ obj-$(CONFIG_ROCKCHIP_RK3308) += rk3308/ obj-$(CONFIG_ROCKCHIP_RK3328) += rk3328/ obj-$(CONFIG_ROCKCHIP_RK3368) += rk3368/ obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399/ +obj-$(CONFIG_ROCKCHIP_RK3568) += rk3568/ obj-$(CONFIG_ROCKCHIP_RV1108) += rv1108/ # Clear out SPL objects, in case this is a TPL build
arch/arm/mach-rockchip/rk3568/Kconfig new file +20 -0
@@ -0,0 +1,20 @@ +if ROCKCHIP_RK3568 + +config TARGET_EVB_RK3568 + bool "RK3568 evaluation board" + select BOARD_LATE_INIT + help + RK3568 EVB is a evaluation board for Rockchp RK3568. + +config ROCKCHIP_BOOT_MODE_REG + default 0xfdc20200 + +config SYS_SOC + default "rk3568" + +config SYS_MALLOC_F_LEN + default 0x2000 + +source "board/rockchip/evb_rk3568/Kconfig" + +endif
arch/arm/mach-rockchip/rk3568/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# +# (C) Copyright 2021 Rockchip Electronics Co., Ltd +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += clk_rk3568.o +obj-y += rk3568.o +obj-y += syscon_rk3568.o
arch/arm/mach-rockchip/rk3568/clk_rk3568.c new file +53 -0
53 lines not on this page · raw message
arch/arm/mach-rockchip/rk3568/rk3568.c new file +85 -0
85 lines not on this page · raw message
arch/arm/mach-rockchip/rk3568/syscon_rk3568.c new file +24 -0
@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/arch-rockchip/clock.h> + +static const struct udevice_id rk3568_syscon_ids[] = { + { .compatible ="rockchip,rk3568-grf" , .data =ROCKCHIP_SYSCON_GRF }, + { .compatible ="rockchip,rk3568-pmugrf" , .data =ROCKCHIP_SYSCON_PMUGRF }, + { } +}; + +U_BOOT_DRIVER (syscon_rk3568) = { + .name ="rk3568_syscon" , + .id =UCLASS_SYSCON , + .of_match = rk3568_syscon_ids, +#if !CONFIG_IS_ENABLED(OF_PLATDATA) + .bind = dm_scan_fdt_dev, +#endif +};
include/configs/rk3568_common.h new file +43 -0
43 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [PATCH v1 4/5] rockchip: Add rk3568 architecture core
Quoted 8 lines · Joseph Chen
RK3568 is a high-performance and low power quad-core application processor designed for personal mobile internet device and AIoT equipments.
Signed-off-by Joseph Chen <[email protected]>---
Quoted 7 lines
arch/arm/include/asm/arch-rk3568/boot0.h | 11 + arch/arm/include/asm/arch-rk3568/gpio.h | 11 + .../include/asm/arch-rockchip/grf_rk3568.h | 369 ++++++++++++++++++ arch/arm/mach-rockchip/Kconfig | 17 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rk3568/Kconfig | 20 + arch/arm/mach-rockchip/rk3568/Makefile | 9 +
I wonder if this directory structure should be called rk35xx given that at least the rk3566 shares a lot with the rk3568?
Quoted 739 lines
arch/arm/mach-rockchip/rk3568/clk_rk3568.c | 53 +++ arch/arm/mach-rockchip/rk3568/rk3568.c | 85 ++++ arch/arm/mach-rockchip/rk3568/syscon_rk3568.c | 24 ++ include/configs/rk3568_common.h | 43 ++ 11 files changed, 643 insertions(+) create mode 100644 arch/arm/include/asm/arch-rk3568/boot0.h create mode 100644 arch/arm/include/asm/arch-rk3568/gpio.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3568.h create mode 100644 arch/arm/mach-rockchip/rk3568/Kconfig create mode 100644 arch/arm/mach-rockchip/rk3568/Makefile create mode 100644 arch/arm/mach-rockchip/rk3568/clk_rk3568.c create mode 100644 arch/arm/mach-rockchip/rk3568/rk3568.c create mode 100644 arch/arm/mach-rockchip/rk3568/syscon_rk3568.c create mode 100644 include/configs/rk3568_common.harch/arm/include/asm/arch-rk3568/boot0.h new file +11
-0@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __ASM_ARCH_BOOT0_H__ +#define __ASM_ARCH_BOOT0_H__ + +#include <asm/arch-rockchip/boot0.h> + +#endif arch/arm/include/asm/arch-rk3568/gpio.h new file +11
-0@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __ASM_ARCH_GPIO_H__ +#define __ASM_ARCH_GPIO_H__ + +#include <asm/arch-rockchip/gpio.h> + +#endif arch/arm/include/asm/arch-rockchip/grf_rk3568.h new file +369
-0@@ -0,0 +1,369 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __SOC_ROCKCHIP_RK3568_GRF_H__ +#define __SOC_ROCKCHIP_RK3568_GRF_H__ + +struct rk3568_grf { +unsigned int gpio1a_iomux_l; +unsigned int gpio1a_iomux_h; +unsigned int gpio1b_iomux_l; +unsigned int gpio1b_iomux_h; +unsigned int gpio1c_iomux_l; +unsigned int gpio1c_iomux_h; +unsigned int gpio1d_iomux_l; +unsigned int gpio1d_iomux_h; +unsigned int gpio2a_iomux_l; +unsigned int gpio2a_iomux_h; +unsigned int gpio2b_iomux_l; +unsigned int gpio2b_iomux_h; +unsigned int gpio2c_iomux_l; +unsigned int gpio2c_iomux_h; +unsigned int gpio2d_iomux_l; +unsigned int gpio2d_iomux_h; +unsigned int gpio3a_iomux_l; +unsigned int gpio3a_iomux_h; +unsigned int gpio3b_iomux_l; +unsigned int gpio3b_iomux_h; +unsigned int gpio3c_iomux_l; +unsigned int gpio3c_iomux_h; +unsigned int gpio3d_iomux_l; +unsigned int gpio3d_iomux_h; +unsigned int gpio4a_iomux_l; +unsigned int gpio4a_iomux_h; +unsigned int gpio4b_iomux_l; +unsigned int gpio4b_iomux_h; +unsigned int gpio4c_iomux_l; +unsigned int gpio4c_iomux_h; +unsigned int gpio4d_iomux_l; +unsigned int reserved0[(0x0080 -0x0078 ) /4 -1 ]; +unsigned int gpio1a_p; +unsigned int gpio1b_p; +unsigned int gpio1c_p; +unsigned int gpio1d_p; +unsigned int gpio2a_p; +unsigned int gpio2b_p; +unsigned int gpio2c_p; +unsigned int gpio2d_p; +unsigned int gpio3a_p; +unsigned int gpio3b_p; +unsigned int gpio3c_p; +unsigned int gpio3d_p; +unsigned int gpio4a_p; +unsigned int gpio4b_p; +unsigned int gpio4c_p; +unsigned int gpio4d_p; +unsigned int gpio1a_ie; +unsigned int gpio1b_ie; +unsigned int gpio1c_ie; +unsigned int gpio1d_ie; +unsigned int gpio2a_ie; +unsigned int gpio2b_ie; +unsigned int gpio2c_ie; +unsigned int gpio2d_ie; +unsigned int gpio3a_ie; +unsigned int gpio3b_ie; +unsigned int gpio3c_ie; +unsigned int gpio3d_ie; +unsigned int gpio4a_ie; +unsigned int gpio4b_ie; +unsigned int gpio4c_ie; +unsigned int gpio4d_ie; +unsigned int gpio1a_opd; +unsigned int gpio1b_opd; +unsigned int gpio1c_opd; +unsigned int gpio1d_opd; +unsigned int gpio2a_opd; +unsigned int gpio2b_opd; +unsigned int gpio2c_opd; +unsigned int gpio2d_opd; +unsigned int gpio3a_opd; +unsigned int gpio3b_opd; +unsigned int gpio3c_opd; +unsigned int gpio3d_opd; +unsigned int gpio4a_opd; +unsigned int gpio4b_opd; +unsigned int gpio4c_opd; +unsigned int gpio4d_opd; +unsigned int gpio1a_sus; +unsigned int gpio1b_sus; +unsigned int gpio1c_sus; +unsigned int gpio1d_sus; +unsigned int gpio2a_sus; +unsigned int gpio2b_sus; +unsigned int gpio2c_sus; +unsigned int gpio2d_sus; +unsigned int gpio3a_sus; +unsigned int gpio3b_sus; +unsigned int gpio3c_sus; +unsigned int gpio3d_sus; +unsigned int gpio4a_sus; +unsigned int gpio4b_sus; +unsigned int gpio4c_sus; +unsigned int gpio4d_sus; +unsigned int gpio1a_sl; +unsigned int gpio1b_sl; +unsigned int gpio1c_sl; +unsigned int gpio1d_sl; +unsigned int gpio2a_sl; +unsigned int gpio2b_sl; +unsigned int gpio2c_sl; +unsigned int gpio2d_sl; +unsigned int gpio3a_sl; +unsigned int gpio3b_sl; +unsigned int gpio3c_sl; +unsigned int gpio3d_sl; +unsigned int gpio4a_sl; +unsigned int gpio4b_sl; +unsigned int gpio4c_sl; +unsigned int gpio4d_sl; +unsigned int reserved1[(0x0200 -0x01bc ) /4 -1 ]; +unsigned int gpio1a_ds_0; +unsigned int gpio1a_ds_1; +unsigned int gpio1a_ds_2; +unsigned int gpio1a_ds_3; +unsigned int gpio1b_ds_0; +unsigned int gpio1b_ds_1; +unsigned int gpio1b_ds_2; +unsigned int gpio1b_ds_3; +unsigned int gpio1c_ds_0; +unsigned int gpio1c_ds_1; +unsigned int gpio1c_ds_2; +unsigned int gpio1c_ds_3; +unsigned int gpio1d_ds_0; +unsigned int gpio1d_ds_1; +unsigned int gpio1d_ds_2; +unsigned int gpio1d_ds_3; +unsigned int gpio2a_ds_0; +unsigned int gpio2a_ds_1; +unsigned int gpio2a_ds_2; +unsigned int gpio2a_ds_3; +unsigned int gpio2b_ds_0; +unsigned int gpio2b_ds_1; +unsigned int gpio2b_ds_2; +unsigned int gpio2b_ds_3; +unsigned int gpio2c_ds_0; +unsigned int gpio2c_ds_1; +unsigned int gpio2c_ds_2; +unsigned int gpio2c_ds_3; +unsigned int gpio2d_ds_0; +unsigned int gpio2d_ds_1; +unsigned int gpio2d_ds_2; +unsigned int gpio2d_ds_3; +unsigned int gpio3a_ds_0; +unsigned int gpio3a_ds_1; +unsigned int gpio3a_ds_2; +unsigned int gpio3a_ds_3; +unsigned int gpio3b_ds_0; +unsigned int gpio3b_ds_1; +unsigned int gpio3b_ds_2; +unsigned int gpio3b_ds_3; +unsigned int gpio3c_ds_0; +unsigned int gpio3c_ds_1; +unsigned int gpio3c_ds_2; +unsigned int gpio3c_ds_3; +unsigned int gpio3d_ds_0; +unsigned int gpio3d_ds_1; +unsigned int gpio3d_ds_2; +unsigned int gpio3d_ds_3; +unsigned int gpio4a_ds_0; +unsigned int gpio4a_ds_1; +unsigned int gpio4a_ds_2; +unsigned int gpio4a_ds_3; +unsigned int gpio4b_ds_0; +unsigned int gpio4b_ds_1; +unsigned int gpio4b_ds_2; +unsigned int gpio4b_ds_3; +unsigned int gpio4c_ds_0; +unsigned int gpio4c_ds_1; +unsigned int gpio4c_ds_2; +unsigned int gpio4c_ds_3; +unsigned int gpio4d_ds_0; +unsigned int gpio4d_ds_1; +unsigned int gpio4d_ds_2; +unsigned int gpio4d_ds_3; +unsigned int iofunc_sel0; +unsigned int iofunc_sel1; +unsigned int iofunc_sel2; +unsigned int iofunc_sel3; +unsigned int iofunc_sel4; +unsigned int iofunc_sel5; +unsigned int reserved2[(0x0340 -0x0314 ) /4 -1 ]; +unsigned int vi_con0; +unsigned int vi_con1; +unsigned int vi_status0; +unsigned int reserved3[(0x0360 -0x0348 ) /4 -1 ]; +unsigned int vo_con0; +unsigned int vo_con1; +unsigned int vo_con2; +unsigned int vo_con3; +unsigned int reserved4[(0x0380 -0x036c ) /4 -1 ]; +unsigned int mac0_con0; +unsigned int mac0_con1; +unsigned int mac1_con0; +unsigned int mac1_con1; +unsigned int reserved5[(0x03a0 -0x038c ) /4 -1 ]; +unsigned int biu_con0; +unsigned int biu_con1; +unsigned int biu_con2; +unsigned int reserved6[(0x03c0 -0x03a8 ) /4 -1 ]; +unsigned int gic_con0; +unsigned int gic_con1; +unsigned int gic_con2; +unsigned int reserved7[(0x03f0 -0x03c8 ) /4 -1 ]; +unsigned int gpu_con0; +unsigned int gpu_con1; +unsigned int reserved8[(0x0400 -0x03f4 ) /4 -1 ]; +unsigned int cpu_con0; +unsigned int reserved9[(0x0420 -0x0400 ) /4 -1 ]; +unsigned int cpu_status0; +unsigned int reserved10[(0x0500 -0x0420 ) /4 -1 ]; +unsigned int soc_con0; +unsigned int soc_con1; +unsigned int soc_con2; +unsigned int soc_con3; +unsigned int reserved11[(0x0514 -0x050c ) /4 -1 ]; +unsigned int soc_con5; +unsigned int soc_con6; +unsigned int reserved12[(0x0580 -0x0518 ) /4 -1 ]; +unsigned int soc_status0; +unsigned int reserved13[(0x05c0 -0x0580 ) /4 -1 ]; +unsigned int ram_con; +unsigned int core_ram_con; +unsigned int reserved14[(0x0600 -0x05c4 ) /4 -1 ]; +unsigned int tsadc_con; +unsigned int reserved15[(0x0610 -0x0600 ) /4 -1 ]; +unsigned int saradc_con; +unsigned int reserved16[(0x0700 -0x0610 ) /4 -1 ]; +unsigned int gpupvtpll_con0; +unsigned int gpupvtpll_con1; +unsigned int gpupvtpll_con2; +unsigned int gpupvtpll_con3; +unsigned int reserved17[(0x0740 -0x070c ) /4 -1 ]; +unsigned int npupvtpll_con0; +unsigned int npupvtpll_con1; +unsigned int npupvtpll_con2; +unsigned int npupvtpll_con3; +unsigned int reserved18[(0x0800 -0x074c ) /4 -1 ]; +unsigned int chip_id; +unsigned int reserved19[(0x0840 -0x0800 ) /4 -1 ]; +unsigned int gpio1c5_ds; +unsigned int gpio2a2_ds; +unsigned int gpio2b0_ds; +unsigned int gpio3a0_ds; +unsigned int gpio3a6_ds; +unsigned int gpio4a0_ds; +unsigned int reserved20[(0x0900 -0x0854 ) /4 -1 ]; +unsigned int dmac0_con0; +unsigned int dmac0_con1; +unsigned int dmac0_con2; +unsigned int dmac0_con3; +unsigned int dmac0_con4; +unsigned int dmac0_con5; +unsigned int dmac0_con6; +unsigned int dmac0_con7; +unsigned int dmac0_con8; +unsigned int dmac0_con9; +unsigned int reserved21[(0x0940 -0x0924 ) /4 -1 ]; +unsigned int dmac1_con0; +unsigned int dmac1_con1; +unsigned int dmac1_con2; +unsigned int dmac1_con3; +unsigned int dmac1_con4; +unsigned int dmac1_con5; +unsigned int dmac1_con6; +unsigned int dmac1_con7; +unsigned int dmac1_con8; +unsigned int dmac1_con9; +}; + +check_member (rk3568_grf, dmac1_con9,0x0964 ); + +struct rk3568_pmugrf { +unsigned int pmu_gpio0a_iomux_l; +unsigned int pmu_gpio0a_iomux_h; +unsigned int pmu_gpio0b_iomux_l; +unsigned int pmu_gpio0b_iomux_h; +unsigned int pmu_gpio0c_iomux_l; +unsigned int pmu_gpio0c_iomux_h; +unsigned int pmu_gpio0d_iomux_l; +unsigned int reserved0[(0x0020 -0x0018 ) /4 -1 ]; +unsigned int pmu_gpio0a_p; +unsigned int pmu_gpio0b_p; +unsigned int pmu_gpio0c_p; +unsigned int pmu_gpio0d_p; +unsigned int pmu_gpio0a_ie; +unsigned int pmu_gpio0b_ie; +unsigned int pmu_gpio0c_ie; +unsigned int pmu_gpio0d_ie; +unsigned int pmu_gpio0a_opd; +unsigned int pmu_gpio0b_opd; +unsigned int pmu_gpio0c_opd; +unsigned int pmu_gpio0d_opd; +unsigned int pmu_gpio0a_sus; +unsigned int pmu_gpio0b_sus; +unsigned int pmu_gpio0c_sus; +unsigned int pmu_gpio0d_sus; +unsigned int pmu_gpio0a_sl; +unsigned int pmu_gpio0b_sl; +unsigned int pmu_gpio0c_sl; +unsigned int pmu_gpio0d_sl; +unsigned int pmu_gpio0a_ds_0; +unsigned int pmu_gpio0a_ds_1; +unsigned int pmu_gpio0a_ds_2; +unsigned int pmu_gpio0a_ds_3; +unsigned int pmu_gpio0b_ds_0; +unsigned int pmu_gpio0b_ds_1; +unsigned int pmu_gpio0b_ds_2; +unsigned int pmu_gpio0b_ds_3; +unsigned int pmu_gpio0c_ds_0; +unsigned int pmu_gpio0c_ds_1; +unsigned int pmu_gpio0c_ds_2; +unsigned int pmu_gpio0c_ds_3; +unsigned int pmu_gpio0d_ds_0; +unsigned int pmu_gpio0d_ds_1; +unsigned int pmu_gpio0d_ds_2; +unsigned int pmu_gpio0d_ds_3; +unsigned int reserved1[(0x0100 -0x00ac ) /4 -1 ]; +unsigned int pmu_soc_con0; +unsigned int pmu_soc_con1; +unsigned int pmu_soc_con2; +unsigned int pmu_soc_con3; +unsigned int pmu_soc_con4; +unsigned int pmu_soc_con5; +unsigned int reserved2[(0x0124 -0x0114 ) /4 -1 ]; +unsigned int pmu_io_vsel0; +unsigned int pmu_io_vsel1; +unsigned int pmu_io_vsel2; +unsigned int reserved3[(0x0180 -0x012c ) /4 -1 ]; +unsigned int pmu_dll_con0; +unsigned int reserved4[(0x0200 -0x0180 ) /4 -1 ]; +unsigned int pmu_os_reg0; +unsigned int pmu_os_reg1; +unsigned int pmu_os_reg2; +unsigned int pmu_os_reg3; +unsigned int pmu_os_reg4; +unsigned int pmu_os_reg5; +unsigned int pmu_os_reg6; +unsigned int pmu_os_reg7; +unsigned int pmu_os_reg8; +unsigned int pmu_os_reg9; +unsigned int pmu_os_reg10; +unsigned int pmu_os_reg11; +unsigned int pmu_reset_function_status; +unsigned int pmu_reset_function_clr; +unsigned int reserved5[(0x0380 -0x0234 ) /4 -1 ]; +unsigned int pmu_sig_detect_con; +unsigned int reserved6[(0x0390 -0x0380 ) /4 -1 ]; +unsigned int pmu_sig_detect_status; +unsigned int reserved7[(0x03a0 -0x0390 ) /4 -1 ]; +unsigned int pmu_sig_detect_status_clear; +unsigned int reserved8[(0x03b0 -0x03a0 ) /4 -1 ]; +unsigned int pmu_sdmmc_det_counter; +}; + +check_member (rk3568_pmugrf, pmu_sdmmc_det_counter,0x03b0 ); + +#endif arch/arm/mach-rockchip/Kconfig +17
-0@@ -257,6 +257,23 @@ config ROCKCHIP_RK3399 and video codec support. Peripherals include Gigabit Ethernet, USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs. +config ROCKCHIP_RK3568 + bool "Support Rockchip RK3568" + select ARM64 + select CLK + select PINCTRL + select RAM + select REGMAP + select SYSCON + select BOARD_LATE_INIT + imply ROCKCHIP_COMMON_BOARD + help + The Rockchip RK3568 is a ARM-based SoC with quad-core Cortex-A55, + including NEON and GPU, 512K L3 cache, Mali-G52 based 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_RV1108 bool "Support Rockchip RV1108" select CPU_V7Aarch/arm/mach-rockchip/Makefile +1
-0@@ -42,6 +42,7 @@ obj-$(CONFIG_ROCKCHIP_RK3308) += rk3308/ obj-$(CONFIG_ROCKCHIP_RK3328) += rk3328/ obj-$(CONFIG_ROCKCHIP_RK3368) += rk3368/ obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399/ +obj-$(CONFIG_ROCKCHIP_RK3568) += rk3568/ obj-$(CONFIG_ROCKCHIP_RV1108) += rv1108/ # Clear out SPL objects, in case this is a TPL buildarch/arm/mach-rockchip/rk3568/Kconfig new file +20
-0@@ -0,0 +1,20 @@ +if ROCKCHIP_RK3568 + +config TARGET_EVB_RK3568 + bool "RK3568 evaluation board" + select BOARD_LATE_INIT + help + RK3568 EVB is a evaluation board for Rockchp RK3568. + +config ROCKCHIP_BOOT_MODE_REG + default 0xfdc20200 + +config SYS_SOC + default "rk3568" + +config SYS_MALLOC_F_LEN + default 0x2000 + +source "board/rockchip/evb_rk3568/Kconfig" + +endifarch/arm/mach-rockchip/rk3568/Makefile new file +9
-0@@ -0,0 +1,9 @@ +# +# (C) Copyright 2021 Rockchip Electronics Co., Ltd +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += clk_rk3568.o +obj-y += rk3568.o +obj-y += syscon_rk3568.oarch/arm/mach-rockchip/rk3568/clk_rk3568.c new file +53
-0@@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/arch-rockchip/clock.h> +#include <asm/arch-rockchip/cru_rk3568.h> +#include <linux/err.h> + +int rockchip_get_clk (struct udevice **devp) +{ +return uclass_get_device_by_driver (UCLASS_CLK , +DM_DRIVER_GET (rockchip_rk3568_cru), devp); +} + +void *rockchip_get_cru (void ) +{ +struct rk3568_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; +} + +static int rockchip_get_pmucruclk (struct udevice **devp) +{ +return uclass_get_device_by_driver (UCLASS_CLK , +DM_DRIVER_GET (rockchip_rk3568_pmucru), devp); +} + +void *rockchip_get_pmucru (void ) +{ +struct rk3568_pmuclk_priv *priv; +struct udevice *dev; +int ret; + + ret =rockchip_get_pmucruclk (&dev); +if (ret) +return ERR_PTR (ret); + + priv =dev_get_priv (dev); + +return priv->pmucru; +}arch/arm/mach-rockchip/rk3568/rk3568.c new file +85
-0@@ -0,0 +1,85 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <asm/armv8/mmu.h> +#include <asm/io.h> +#include <asm/arch-rockchip/grf_rk3568.h> +#include <asm/arch-rockchip/hardware.h> +#include <dt-bindings/clock/rk3568-cru.h> + +#define PMUGRF_BASE 0xfdc20000 +#define GRF_BASE 0xfdc60000 + +/* PMU_GRF_GPIO0D_IOMUX_L */ +enum { +GPIO0D1_SHIFT =4 , +GPIO0D1_MASK =GENMASK (6 ,4 ), +GPIO0D1_GPIO =0 , +GPIO0D1_UART2_TXM0 , + +GPIO0D0_SHIFT =0 , +GPIO0D0_MASK =GENMASK (2 ,0 ), +GPIO0D0_GPIO =0 , +GPIO0D0_UART2_RXM0 , +}; + +/* GRF_IOFUNC_SEL3 */ +enum { +UART2_IO_SEL_SHIFT =10 , +UART2_IO_SEL_MASK =GENMASK (11 ,10 ), +UART2_IO_SEL_M0 =0 , +}; + +static struct mm_region rk3568_mem_map[] = { + { + .virt =0x0UL , + .phys =0x0UL , + .size =0xf0000000UL , + .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 + }, { + .virt =0x300000000 , + .phys =0x300000000 , + .size =0x0c0c00000 , + .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 = rk3568_mem_map; + +void board_debug_uart_init (void ) +{ +static struct rk3568_pmugrf *const pmugrf = (void *)PMUGRF_BASE ; +static struct rk3568_grf *const grf = (void *)GRF_BASE ; + +/* UART2 M0 */ +rk_clrsetreg (&grf->iofunc_sel3,UART2_IO_SEL_MASK , +UART2_IO_SEL_M0 <<UART2_IO_SEL_SHIFT ); + +/* Switch iomux */ +rk_clrsetreg (&pmugrf->pmu_gpio0d_iomux_l, +GPIO0D1_MASK |GPIO0D0_MASK , +GPIO0D1_UART2_TXM0 <<GPIO0D1_SHIFT | +GPIO0D0_UART2_RXM0 <<GPIO0D0_SHIFT ); +} + +int arch_cpu_init (void ) +{ +return 0 ; +}arch/arm/mach-rockchip/rk3568/syscon_rk3568.c new file +24
-0@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/arch-rockchip/clock.h> + +static const struct udevice_id rk3568_syscon_ids[] = { + { .compatible ="rockchip,rk3568-grf" , .data =ROCKCHIP_SYSCON_GRF }, + { .compatible ="rockchip,rk3568-pmugrf" , .data =ROCKCHIP_SYSCON_PMUGRF }, + { } +}; + +U_BOOT_DRIVER (syscon_rk3568) = { + .name ="rk3568_syscon" , + .id =UCLASS_SYSCON , + .of_match = rk3568_syscon_ids, +#if !CONFIG_IS_ENABLED(OF_PLATDATA) + .bind = dm_scan_fdt_dev, +#endif +};include/configs/rk3568_common.h new file +43
-1@@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __CONFIG_RK3568_COMMON_H +#define __CONFIG_RK3568_COMMON_H + +#include "rockchip-common.h" + +#define CONFIG_SYS_CBSIZE 1024 +#define CONFIG_SKIP_LOWLEVEL_INIT + +#define COUNTER_FREQUENCY 24000000 +#define CONFIG_ROCKCHIP_STIMER_BASE 0xfdd1c020 + +#define CONFIG_IRAM_BASE 0xfdcc0000 + +#define CONFIG_SYS_INIT_SP_ADDR 0x00c00000 +#define CONFIG_SYS_LOAD_ADDR 0x00c00800 +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* 64M */ + +#define CONFIG_SYS_SDRAM_BASE 0 +#define SDRAM_MAX_SIZE 0xf0000000 + +#ifndef CONFIG_SPL_BUILD +#define ENV_MEM_LAYOUT_SETTINGS \ + "scriptaddr=0x00c00000\0" \ + "pxefile_addr_r=0x00e00000\0" \ + "fdt_addr_r=0x0a100000\0" \ + "kernel_addr_r=0x02080000\0" \ + "ramdisk_addr_r=0x0a200000\0" + +#include <config_distro_bootcmd.h> +#define CONFIG_EXTRA_ENV_SETTINGS \ + ENV_MEM_LAYOUT_SETTINGS \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ + "partitions=" PARTS_DEFAULT \ + ROCKCHIP_DEVICE_SETTINGS \ + BOOTENV +#endif + +#endif --2.17.1
Re: [PATCH v1 4/5] rockchip: Add rk3568 architecture core
Hi, Peter:
Quoted 15 lines · Peter Robinson
Quoted 7 lines · Joseph Chen
RK3568 is a high-performance and low power quad-core application processor designed for personal mobile internet device and AIoT equipments.
Signed-off-by Joseph Chen <[email protected]>---
Quoted 7 lines
arch/arm/include/asm/arch-rk3568/boot0.h | 11 + arch/arm/include/asm/arch-rk3568/gpio.h | 11 + .../include/asm/arch-rockchip/grf_rk3568.h | 369 ++++++++++++++++++ arch/arm/mach-rockchip/Kconfig | 17 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rk3568/Kconfig | 20 + arch/arm/mach-rockchip/rk3568/Makefile | 9 +
Quoted 2 lines
I wonder if this directory structure should be called rk35xx given that at least the rk3566 shares a lot with the rk3568?
Rockchip doesn't plan to add rk3566 support to U-Boot and Kernel mainline, only rk3568 will be supported.
Quoted 741 lines
Quoted 739 lines
arch/arm/mach-rockchip/rk3568/clk_rk3568.c | 53 +++ arch/arm/mach-rockchip/rk3568/rk3568.c | 85 ++++ arch/arm/mach-rockchip/rk3568/syscon_rk3568.c | 24 ++ include/configs/rk3568_common.h | 43 ++ 11 files changed, 643 insertions(+)create mode 100644
arch/arm/include/asm/arch-rk3568/boot0.hcreate mode 100644arch/arm/include/asm/arch-rk3568/gpio.hcreate mode 100644arch/arm/include/asm/arch-rockchip/grf_rk3568.hcreate mode 100644arch/arm/mach-rockchip/rk3568/Kconfigcreate mode 100644arch/arm/mach-rockchip/rk3568/Makefilecreate mode 100644arch/arm/mach-rockchip/rk3568/clk_rk3568.ccreate mode 100644arch/arm/mach-rockchip/rk3568/rk3568.ccreate mode 100644arch/arm/mach-rockchip/rk3568/syscon_rk3568.ccreate mode 100644include/configs/rk3568_common.harch/arm/include/asm/arch-rk3568/boot0.h new file +11
-0@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __ASM_ARCH_BOOT0_H__ +#define __ASM_ARCH_BOOT0_H__ + +#include <asm/arch-rockchip/boot0.h> + +#endif arch/arm/include/asm/arch-rk3568/gpio.h new file +11
-0@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __ASM_ARCH_GPIO_H__ +#define __ASM_ARCH_GPIO_H__ + +#include <asm/arch-rockchip/gpio.h> + +#endif arch/arm/include/asm/arch-rockchip/grf_rk3568.h new file +369
-0@@ -0,0 +1,369 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __SOC_ROCKCHIP_RK3568_GRF_H__ +#define __SOC_ROCKCHIP_RK3568_GRF_H__ + +struct rk3568_grf { +unsigned int gpio1a_iomux_l; +unsigned int gpio1a_iomux_h; +unsigned int gpio1b_iomux_l; +unsigned int gpio1b_iomux_h; +unsigned int gpio1c_iomux_l; +unsigned int gpio1c_iomux_h; +unsigned int gpio1d_iomux_l; +unsigned int gpio1d_iomux_h; +unsigned int gpio2a_iomux_l; +unsigned int gpio2a_iomux_h; +unsigned int gpio2b_iomux_l; +unsigned int gpio2b_iomux_h; +unsigned int gpio2c_iomux_l; +unsigned int gpio2c_iomux_h; +unsigned int gpio2d_iomux_l; +unsigned int gpio2d_iomux_h; +unsigned int gpio3a_iomux_l; +unsigned int gpio3a_iomux_h; +unsigned int gpio3b_iomux_l; +unsigned int gpio3b_iomux_h; +unsigned int gpio3c_iomux_l; +unsigned int gpio3c_iomux_h; +unsigned int gpio3d_iomux_l; +unsigned int gpio3d_iomux_h; +unsigned int gpio4a_iomux_l; +unsigned int gpio4a_iomux_h; +unsigned int gpio4b_iomux_l; +unsigned int gpio4b_iomux_h; +unsigned int gpio4c_iomux_l; +unsigned int gpio4c_iomux_h; +unsigned int gpio4d_iomux_l; +unsigned int reserved0[(0x0080 -0x0078 ) /4 -1 ]; +unsigned int gpio1a_p; +unsigned int gpio1b_p; +unsigned int gpio1c_p; +unsigned int gpio1d_p; +unsigned int gpio2a_p; +unsigned int gpio2b_p; +unsigned int gpio2c_p; +unsigned int gpio2d_p; +unsigned int gpio3a_p; +unsigned int gpio3b_p; +unsigned int gpio3c_p; +unsigned int gpio3d_p; +unsigned int gpio4a_p; +unsigned int gpio4b_p; +unsigned int gpio4c_p; +unsigned int gpio4d_p; +unsigned int gpio1a_ie; +unsigned int gpio1b_ie; +unsigned int gpio1c_ie; +unsigned int gpio1d_ie; +unsigned int gpio2a_ie; +unsigned int gpio2b_ie; +unsigned int gpio2c_ie; +unsigned int gpio2d_ie; +unsigned int gpio3a_ie; +unsigned int gpio3b_ie; +unsigned int gpio3c_ie; +unsigned int gpio3d_ie; +unsigned int gpio4a_ie; +unsigned int gpio4b_ie; +unsigned int gpio4c_ie; +unsigned int gpio4d_ie; +unsigned int gpio1a_opd; +unsigned int gpio1b_opd; +unsigned int gpio1c_opd; +unsigned int gpio1d_opd; +unsigned int gpio2a_opd; +unsigned int gpio2b_opd; +unsigned int gpio2c_opd; +unsigned int gpio2d_opd; +unsigned int gpio3a_opd; +unsigned int gpio3b_opd; +unsigned int gpio3c_opd; +unsigned int gpio3d_opd; +unsigned int gpio4a_opd; +unsigned int gpio4b_opd; +unsigned int gpio4c_opd; +unsigned int gpio4d_opd; +unsigned int gpio1a_sus; +unsigned int gpio1b_sus; +unsigned int gpio1c_sus; +unsigned int gpio1d_sus; +unsigned int gpio2a_sus; +unsigned int gpio2b_sus; +unsigned int gpio2c_sus; +unsigned int gpio2d_sus; +unsigned int gpio3a_sus; +unsigned int gpio3b_sus; +unsigned int gpio3c_sus; +unsigned int gpio3d_sus; +unsigned int gpio4a_sus; +unsigned int gpio4b_sus; +unsigned int gpio4c_sus; +unsigned int gpio4d_sus; +unsigned int gpio1a_sl; +unsigned int gpio1b_sl; +unsigned int gpio1c_sl; +unsigned int gpio1d_sl; +unsigned int gpio2a_sl; +unsigned int gpio2b_sl; +unsigned int gpio2c_sl; +unsigned int gpio2d_sl; +unsigned int gpio3a_sl; +unsigned int gpio3b_sl; +unsigned int gpio3c_sl; +unsigned int gpio3d_sl; +unsigned int gpio4a_sl; +unsigned int gpio4b_sl; +unsigned int gpio4c_sl; +unsigned int gpio4d_sl; +unsigned int reserved1[(0x0200 -0x01bc ) /4 -1 ]; +unsigned int gpio1a_ds_0; +unsigned int gpio1a_ds_1; +unsigned int gpio1a_ds_2; +unsigned int gpio1a_ds_3; +unsigned int gpio1b_ds_0; +unsigned int gpio1b_ds_1; +unsigned int gpio1b_ds_2; +unsigned int gpio1b_ds_3; +unsigned int gpio1c_ds_0; +unsigned int gpio1c_ds_1; +unsigned int gpio1c_ds_2; +unsigned int gpio1c_ds_3; +unsigned int gpio1d_ds_0; +unsigned int gpio1d_ds_1; +unsigned int gpio1d_ds_2; +unsigned int gpio1d_ds_3; +unsigned int gpio2a_ds_0; +unsigned int gpio2a_ds_1; +unsigned int gpio2a_ds_2; +unsigned int gpio2a_ds_3; +unsigned int gpio2b_ds_0; +unsigned int gpio2b_ds_1; +unsigned int gpio2b_ds_2; +unsigned int gpio2b_ds_3; +unsigned int gpio2c_ds_0; +unsigned int gpio2c_ds_1; +unsigned int gpio2c_ds_2; +unsigned int gpio2c_ds_3; +unsigned int gpio2d_ds_0; +unsigned int gpio2d_ds_1; +unsigned int gpio2d_ds_2; +unsigned int gpio2d_ds_3; +unsigned int gpio3a_ds_0; +unsigned int gpio3a_ds_1; +unsigned int gpio3a_ds_2; +unsigned int gpio3a_ds_3; +unsigned int gpio3b_ds_0; +unsigned int gpio3b_ds_1; +unsigned int gpio3b_ds_2; +unsigned int gpio3b_ds_3; +unsigned int gpio3c_ds_0; +unsigned int gpio3c_ds_1; +unsigned int gpio3c_ds_2; +unsigned int gpio3c_ds_3; +unsigned int gpio3d_ds_0; +unsigned int gpio3d_ds_1; +unsigned int gpio3d_ds_2; +unsigned int gpio3d_ds_3; +unsigned int gpio4a_ds_0; +unsigned int gpio4a_ds_1; +unsigned int gpio4a_ds_2; +unsigned int gpio4a_ds_3; +unsigned int gpio4b_ds_0; +unsigned int gpio4b_ds_1; +unsigned int gpio4b_ds_2; +unsigned int gpio4b_ds_3; +unsigned int gpio4c_ds_0; +unsigned int gpio4c_ds_1; +unsigned int gpio4c_ds_2; +unsigned int gpio4c_ds_3; +unsigned int gpio4d_ds_0; +unsigned int gpio4d_ds_1; +unsigned int gpio4d_ds_2; +unsigned int gpio4d_ds_3; +unsigned int iofunc_sel0; +unsigned int iofunc_sel1; +unsigned int iofunc_sel2; +unsigned int iofunc_sel3; +unsigned int iofunc_sel4; +unsigned int iofunc_sel5; +unsigned int reserved2[(0x0340 -0x0314 ) /4 -1 ]; +unsigned int vi_con0; +unsigned int vi_con1; +unsigned int vi_status0; +unsigned int reserved3[(0x0360 -0x0348 ) /4 -1 ]; +unsigned int vo_con0; +unsigned int vo_con1; +unsigned int vo_con2; +unsigned int vo_con3; +unsigned int reserved4[(0x0380 -0x036c ) /4 -1 ]; +unsigned int mac0_con0; +unsigned int mac0_con1; +unsigned int mac1_con0; +unsigned int mac1_con1; +unsigned int reserved5[(0x03a0 -0x038c ) /4 -1 ]; +unsigned int biu_con0; +unsigned int biu_con1; +unsigned int biu_con2; +unsigned int reserved6[(0x03c0 -0x03a8 ) /4 -1 ]; +unsigned int gic_con0; +unsigned int gic_con1; +unsigned int gic_con2; +unsigned int reserved7[(0x03f0 -0x03c8 ) /4 -1 ]; +unsigned int gpu_con0; +unsigned int gpu_con1; +unsigned int reserved8[(0x0400 -0x03f4 ) /4 -1 ]; +unsigned int cpu_con0; +unsigned int reserved9[(0x0420 -0x0400 ) /4 -1 ]; +unsigned int cpu_status0; +unsigned int reserved10[(0x0500 -0x0420 ) /4 -1 ]; +unsigned int soc_con0; +unsigned int soc_con1; +unsigned int soc_con2; +unsigned int soc_con3; +unsigned int reserved11[(0x0514 -0x050c ) /4 -1 ]; +unsigned int soc_con5; +unsigned int soc_con6; +unsigned int reserved12[(0x0580 -0x0518 ) /4 -1 ]; +unsigned int soc_status0; +unsigned int reserved13[(0x05c0 -0x0580 ) /4 -1 ]; +unsigned int ram_con; +unsigned int core_ram_con; +unsigned int reserved14[(0x0600 -0x05c4 ) /4 -1 ]; +unsigned int tsadc_con; +unsigned int reserved15[(0x0610 -0x0600 ) /4 -1 ]; +unsigned int saradc_con; +unsigned int reserved16[(0x0700 -0x0610 ) /4 -1 ]; +unsigned int gpupvtpll_con0; +unsigned int gpupvtpll_con1; +unsigned int gpupvtpll_con2; +unsigned int gpupvtpll_con3; +unsigned int reserved17[(0x0740 -0x070c ) /4 -1 ]; +unsigned int npupvtpll_con0; +unsigned int npupvtpll_con1; +unsigned int npupvtpll_con2; +unsigned int npupvtpll_con3; +unsigned int reserved18[(0x0800 -0x074c ) /4 -1 ]; +unsigned int chip_id; +unsigned int reserved19[(0x0840 -0x0800 ) /4 -1 ]; +unsigned int gpio1c5_ds; +unsigned int gpio2a2_ds; +unsigned int gpio2b0_ds; +unsigned int gpio3a0_ds; +unsigned int gpio3a6_ds; +unsigned int gpio4a0_ds; +unsigned int reserved20[(0x0900 -0x0854 ) /4 -1 ]; +unsigned int dmac0_con0; +unsigned int dmac0_con1; +unsigned int dmac0_con2; +unsigned int dmac0_con3; +unsigned int dmac0_con4; +unsigned int dmac0_con5; +unsigned int dmac0_con6; +unsigned int dmac0_con7; +unsigned int dmac0_con8; +unsigned int dmac0_con9; +unsigned int reserved21[(0x0940 -0x0924 ) /4 -1 ]; +unsigned int dmac1_con0; +unsigned int dmac1_con1; +unsigned int dmac1_con2; +unsigned int dmac1_con3; +unsigned int dmac1_con4; +unsigned int dmac1_con5; +unsigned int dmac1_con6; +unsigned int dmac1_con7; +unsigned int dmac1_con8; +unsigned int dmac1_con9; +}; + +check_member (rk3568_grf, dmac1_con9,0x0964 ); + +struct rk3568_pmugrf { +unsigned int pmu_gpio0a_iomux_l; +unsigned int pmu_gpio0a_iomux_h; +unsigned int pmu_gpio0b_iomux_l; +unsigned int pmu_gpio0b_iomux_h; +unsigned int pmu_gpio0c_iomux_l; +unsigned int pmu_gpio0c_iomux_h; +unsigned int pmu_gpio0d_iomux_l; +unsigned int reserved0[(0x0020 -0x0018 ) /4 -1 ]; +unsigned int pmu_gpio0a_p; +unsigned int pmu_gpio0b_p; +unsigned int pmu_gpio0c_p; +unsigned int pmu_gpio0d_p; +unsigned int pmu_gpio0a_ie; +unsigned int pmu_gpio0b_ie; +unsigned int pmu_gpio0c_ie; +unsigned int pmu_gpio0d_ie; +unsigned int pmu_gpio0a_opd; +unsigned int pmu_gpio0b_opd; +unsigned int pmu_gpio0c_opd; +unsigned int pmu_gpio0d_opd; +unsigned int pmu_gpio0a_sus; +unsigned int pmu_gpio0b_sus; +unsigned int pmu_gpio0c_sus; +unsigned int pmu_gpio0d_sus; +unsigned int pmu_gpio0a_sl; +unsigned int pmu_gpio0b_sl; +unsigned int pmu_gpio0c_sl; +unsigned int pmu_gpio0d_sl; +unsigned int pmu_gpio0a_ds_0; +unsigned int pmu_gpio0a_ds_1; +unsigned int pmu_gpio0a_ds_2; +unsigned int pmu_gpio0a_ds_3; +unsigned int pmu_gpio0b_ds_0; +unsigned int pmu_gpio0b_ds_1; +unsigned int pmu_gpio0b_ds_2; +unsigned int pmu_gpio0b_ds_3; +unsigned int pmu_gpio0c_ds_0; +unsigned int pmu_gpio0c_ds_1; +unsigned int pmu_gpio0c_ds_2; +unsigned int pmu_gpio0c_ds_3; +unsigned int pmu_gpio0d_ds_0; +unsigned int pmu_gpio0d_ds_1; +unsigned int pmu_gpio0d_ds_2; +unsigned int pmu_gpio0d_ds_3; +unsigned int reserved1[(0x0100 -0x00ac ) /4 -1 ]; +unsigned int pmu_soc_con0; +unsigned int pmu_soc_con1; +unsigned int pmu_soc_con2; +unsigned int pmu_soc_con3; +unsigned int pmu_soc_con4; +unsigned int pmu_soc_con5; +unsigned int reserved2[(0x0124 -0x0114 ) /4 -1 ]; +unsigned int pmu_io_vsel0; +unsigned int pmu_io_vsel1; +unsigned int pmu_io_vsel2; +unsigned int reserved3[(0x0180 -0x012c ) /4 -1 ]; +unsigned int pmu_dll_con0; +unsigned int reserved4[(0x0200 -0x0180 ) /4 -1 ]; +unsigned int pmu_os_reg0; +unsigned int pmu_os_reg1; +unsigned int pmu_os_reg2; +unsigned int pmu_os_reg3; +unsigned int pmu_os_reg4; +unsigned int pmu_os_reg5; +unsigned int pmu_os_reg6; +unsigned int pmu_os_reg7; +unsigned int pmu_os_reg8; +unsigned int pmu_os_reg9; +unsigned int pmu_os_reg10; +unsigned int pmu_os_reg11; +unsigned int pmu_reset_function_status; +unsigned int pmu_reset_function_clr; +unsigned int reserved5[(0x0380 -0x0234 ) /4 -1 ]; +unsigned int pmu_sig_detect_con; +unsigned int reserved6[(0x0390 -0x0380 ) /4 -1 ]; +unsigned int pmu_sig_detect_status; +unsigned int reserved7[(0x03a0 -0x0390 ) /4 -1 ]; +unsigned int pmu_sig_detect_status_clear; +unsigned int reserved8[(0x03b0 -0x03a0 ) /4 -1 ]; +unsigned int pmu_sdmmc_det_counter; +}; + +check_member (rk3568_pmugrf, pmu_sdmmc_det_counter,0x03b0 ); + +#endif arch/arm/mach-rockchip/Kconfig +17
-0@@ -257,6 +257,23 @@ config ROCKCHIP_RK3399 and video codec support. Peripherals include Gigabit Ethernet, USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs. +config ROCKCHIP_RK3568 + bool "Support Rockchip RK3568" + select ARM64 + select CLK + select PINCTRL + select RAM + select REGMAP + select SYSCON + select BOARD_LATE_INIT + imply ROCKCHIP_COMMON_BOARD + help + The Rockchip RK3568 is a ARM-based SoC with quad-core Cortex-A55, + including NEON and GPU, 512K L3 cache, Mali-G52 based 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_RV1108 bool "Support Rockchip RV1108" select CPU_V7Aarch/arm/mach-rockchip/Makefile +1
-0@@ -42,6 +42,7 @@ obj-$(CONFIG_ROCKCHIP_RK3308) += rk3308/ obj-$(CONFIG_ROCKCHIP_RK3328) += rk3328/ obj-$(CONFIG_ROCKCHIP_RK3368) += rk3368/ obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399/ +obj-$(CONFIG_ROCKCHIP_RK3568) += rk3568/ obj-$(CONFIG_ROCKCHIP_RV1108) += rv1108/ # Clear out SPL objects, in case this is a TPL buildarch/arm/mach-rockchip/rk3568/Kconfig new file +20
-0@@ -0,0 +1,20 @@ +if ROCKCHIP_RK3568 + +config TARGET_EVB_RK3568 + bool "RK3568 evaluation board" + select BOARD_LATE_INIT + help + RK3568 EVB is a evaluation board for Rockchp RK3568. + +config ROCKCHIP_BOOT_MODE_REG + default 0xfdc20200 + +config SYS_SOC + default "rk3568" + +config SYS_MALLOC_F_LEN + default 0x2000 + +source "board/rockchip/evb_rk3568/Kconfig" + +endifarch/arm/mach-rockchip/rk3568/Makefile new file +9
-0@@ -0,0 +1,9 @@ +# +# (C) Copyright 2021 Rockchip Electronics Co., Ltd +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += clk_rk3568.o +obj-y += rk3568.o +obj-y += syscon_rk3568.oarch/arm/mach-rockchip/rk3568/clk_rk3568.c new file +53
-0@@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/arch-rockchip/clock.h> +#include <asm/arch-rockchip/cru_rk3568.h> +#include <linux/err.h> + +int rockchip_get_clk (struct udevice **devp) +{ +return uclass_get_device_by_driver (UCLASS_CLK , +DM_DRIVER_GET (rockchip_rk3568_cru), devp); +} + +void *rockchip_get_cru (void ) +{ +struct rk3568_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; +} + +static int rockchip_get_pmucruclk (struct udevice **devp) +{ +return uclass_get_device_by_driver (UCLASS_CLK , +DM_DRIVER_GET (rockchip_rk3568_pmucru), devp); +} + +void *rockchip_get_pmucru (void ) +{ +struct rk3568_pmuclk_priv *priv; +struct udevice *dev; +int ret; + + ret =rockchip_get_pmucruclk (&dev); +if (ret) +return ERR_PTR (ret); + + priv =dev_get_priv (dev); + +return priv->pmucru; +}arch/arm/mach-rockchip/rk3568/rk3568.c new file +85
-0@@ -0,0 +1,85 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <asm/armv8/mmu.h> +#include <asm/io.h> +#include <asm/arch-rockchip/grf_rk3568.h> +#include <asm/arch-rockchip/hardware.h> +#include <dt-bindings/clock/rk3568-cru.h> + +#define PMUGRF_BASE 0xfdc20000 +#define GRF_BASE 0xfdc60000 + +/* PMU_GRF_GPIO0D_IOMUX_L */ +enum { +GPIO0D1_SHIFT =4 , +GPIO0D1_MASK =GENMASK (6 ,4 ), +GPIO0D1_GPIO =0 , +GPIO0D1_UART2_TXM0 , + +GPIO0D0_SHIFT =0 , +GPIO0D0_MASK =GENMASK (2 ,0 ), +GPIO0D0_GPIO =0 , +GPIO0D0_UART2_RXM0 , +}; + +/* GRF_IOFUNC_SEL3 */ +enum { +UART2_IO_SEL_SHIFT =10 , +UART2_IO_SEL_MASK =GENMASK (11 ,10 ), +UART2_IO_SEL_M0 =0 , +}; + +static struct mm_region rk3568_mem_map[] = { + { + .virt =0x0UL , + .phys =0x0UL , + .size =0xf0000000UL , + .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 + }, { + .virt =0x300000000 , + .phys =0x300000000 , + .size =0x0c0c00000 , + .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 = rk3568_mem_map; + +void board_debug_uart_init (void ) +{ +static struct rk3568_pmugrf *const pmugrf = (void *)PMUGRF_BASE ; +static struct rk3568_grf *const grf = (void *)GRF_BASE ; + +/* UART2 M0 */ +rk_clrsetreg (&grf->iofunc_sel3,UART2_IO_SEL_MASK , +UART2_IO_SEL_M0 <<UART2_IO_SEL_SHIFT ); + +/* Switch iomux */ +rk_clrsetreg (&pmugrf->pmu_gpio0d_iomux_l, +GPIO0D1_MASK |GPIO0D0_MASK , +GPIO0D1_UART2_TXM0 <<GPIO0D1_SHIFT | +GPIO0D0_UART2_RXM0 <<GPIO0D0_SHIFT ); +} + +int arch_cpu_init (void ) +{ +return 0 ; +}arch/arm/mach-rockchip/rk3568/syscon_rk3568.c new file +24
-0@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/arch-rockchip/clock.h> + +static const struct udevice_id rk3568_syscon_ids[] = { + { .compatible ="rockchip,rk3568-grf" , .data =ROCKCHIP_SYSCON_GRF }, + { .compatible ="rockchip,rk3568-pmugrf" , .data =ROCKCHIP_SYSCON_PMUGRF }, + { } +}; + +U_BOOT_DRIVER (syscon_rk3568) = { + .name ="rk3568_syscon" , + .id =UCLASS_SYSCON , + .of_match = rk3568_syscon_ids, +#if !CONFIG_IS_ENABLED(OF_PLATDATA) + .bind = dm_scan_fdt_dev, +#endif +};include/configs/rk3568_common.h new file +43
-1@@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __CONFIG_RK3568_COMMON_H +#define __CONFIG_RK3568_COMMON_H + +#include "rockchip-common.h" + +#define CONFIG_SYS_CBSIZE 1024 +#define CONFIG_SKIP_LOWLEVEL_INIT + +#define COUNTER_FREQUENCY 24000000 +#define CONFIG_ROCKCHIP_STIMER_BASE 0xfdd1c020 + +#define CONFIG_IRAM_BASE 0xfdcc0000 + +#define CONFIG_SYS_INIT_SP_ADDR 0x00c00000 +#define CONFIG_SYS_LOAD_ADDR 0x00c00800 +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* 64M */ + +#define CONFIG_SYS_SDRAM_BASE 0 +#define SDRAM_MAX_SIZE 0xf0000000 + +#ifndef CONFIG_SPL_BUILD +#define ENV_MEM_LAYOUT_SETTINGS \ + "scriptaddr=0x00c00000\0" \ + "pxefile_addr_r=0x00e00000\0" \ + "fdt_addr_r=0x0a100000\0" \ + "kernel_addr_r=0x02080000\0" \ + "ramdisk_addr_r=0x0a200000\0" + +#include <config_distro_bootcmd.h> +#define CONFIG_EXTRA_ENV_SETTINGS \ + ENV_MEM_LAYOUT_SETTINGS \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ + "partitions=" PARTS_DEFAULT \ + ROCKCHIP_DEVICE_SETTINGS \ + BOOTENV +#endif + +#endif --2.17.1
Signature · 7 lines
陈健洪 (Joseph.Chen) E-mail:[email protected] 福州瑞芯微电子股份有限公司 Fuzhou Rockchip Electronics Co.Ltd 福建省福州市铜盘路软件大道89号软件园A区21号楼 (350003) No. 21 Building, A District, No.89,software Boulevard Fuzhou,Fujian,PRC TEL:0591-83991906/07-8573
Re: [PATCH v1 4/5] rockchip: Add rk3568 architecture core
Quoted 19 lines · 陈健洪
Hi, Peter:
Quoted 15 lines · Peter Robinson
Quoted 14 lines · Joseph Chen
RK3568 is a high-performance and low power quad-core application processor designed for personal mobile internet device and AIoT equipments.
Signed-off-by Joseph Chen <[email protected]>---
arch/arm/include/asm/arch-rk3568/boot0.h | 11 + arch/arm/include/asm/arch-rk3568/gpio.h | 11 + .../include/asm/arch-rockchip/grf_rk3568.h | 369 ++++++++++++++++++ arch/arm/mach-rockchip/Kconfig | 17 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rk3568/Kconfig | 20 + arch/arm/mach-rockchip/rk3568/Makefile | 9 +
Quoted 5 lines
Quoted 2 lines
I wonder if this directory structure should be called rk35xx given that at least the rk3566 shares a lot with the rk3568?
Rockchip doesn't plan to add rk3566 support to U-Boot and Kernel mainline, only rk3568 will be supported.
Why not? What happens if others do?
Quoted 752 lines
Quoted 731 lines
Quoted 731 lines
arch/arm/mach-rockchip/rk3568/clk_rk3568.c | 53 +++ arch/arm/mach-rockchip/rk3568/rk3568.c | 85 ++++ arch/arm/mach-rockchip/rk3568/syscon_rk3568.c | 24 ++ include/configs/rk3568_common.h | 43 ++ 11 files changed, 643 insertions(+)create mode 100644
arch/arm/include/asm/arch-rk3568/boot0.hcreate mode 100644arch/arm/include/asm/arch-rk3568/gpio.hcreate mode 100644arch/arm/include/asm/arch-rockchip/grf_rk3568.hcreate mode 100644arch/arm/mach-rockchip/rk3568/Kconfigcreate mode 100644arch/arm/mach-rockchip/rk3568/Makefilecreate mode 100644arch/arm/mach-rockchip/rk3568/clk_rk3568.ccreate mode 100644arch/arm/mach-rockchip/rk3568/rk3568.ccreate mode 100644arch/arm/mach-rockchip/rk3568/syscon_rk3568.ccreate mode 100644include/configs/rk3568_common.harch/arm/include/asm/arch-rk3568/boot0.h new file +11
-0@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __ASM_ARCH_BOOT0_H__ +#define __ASM_ARCH_BOOT0_H__ + +#include <asm/arch-rockchip/boot0.h> + +#endif arch/arm/include/asm/arch-rk3568/gpio.h new file +11
-0@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __ASM_ARCH_GPIO_H__ +#define __ASM_ARCH_GPIO_H__ + +#include <asm/arch-rockchip/gpio.h> + +#endif arch/arm/include/asm/arch-rockchip/grf_rk3568.h new file +369
-0@@ -0,0 +1,369 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __SOC_ROCKCHIP_RK3568_GRF_H__ +#define __SOC_ROCKCHIP_RK3568_GRF_H__ + +struct rk3568_grf { +unsigned int gpio1a_iomux_l; +unsigned int gpio1a_iomux_h; +unsigned int gpio1b_iomux_l; +unsigned int gpio1b_iomux_h; +unsigned int gpio1c_iomux_l; +unsigned int gpio1c_iomux_h; +unsigned int gpio1d_iomux_l; +unsigned int gpio1d_iomux_h; +unsigned int gpio2a_iomux_l; +unsigned int gpio2a_iomux_h; +unsigned int gpio2b_iomux_l; +unsigned int gpio2b_iomux_h; +unsigned int gpio2c_iomux_l; +unsigned int gpio2c_iomux_h; +unsigned int gpio2d_iomux_l; +unsigned int gpio2d_iomux_h; +unsigned int gpio3a_iomux_l; +unsigned int gpio3a_iomux_h; +unsigned int gpio3b_iomux_l; +unsigned int gpio3b_iomux_h; +unsigned int gpio3c_iomux_l; +unsigned int gpio3c_iomux_h; +unsigned int gpio3d_iomux_l; +unsigned int gpio3d_iomux_h; +unsigned int gpio4a_iomux_l; +unsigned int gpio4a_iomux_h; +unsigned int gpio4b_iomux_l; +unsigned int gpio4b_iomux_h; +unsigned int gpio4c_iomux_l; +unsigned int gpio4c_iomux_h; +unsigned int gpio4d_iomux_l; +unsigned int reserved0[(0x0080 -0x0078 ) /4 -1 ]; +unsigned int gpio1a_p; +unsigned int gpio1b_p; +unsigned int gpio1c_p; +unsigned int gpio1d_p; +unsigned int gpio2a_p; +unsigned int gpio2b_p; +unsigned int gpio2c_p; +unsigned int gpio2d_p; +unsigned int gpio3a_p; +unsigned int gpio3b_p; +unsigned int gpio3c_p; +unsigned int gpio3d_p; +unsigned int gpio4a_p; +unsigned int gpio4b_p; +unsigned int gpio4c_p; +unsigned int gpio4d_p; +unsigned int gpio1a_ie; +unsigned int gpio1b_ie; +unsigned int gpio1c_ie; +unsigned int gpio1d_ie; +unsigned int gpio2a_ie; +unsigned int gpio2b_ie; +unsigned int gpio2c_ie; +unsigned int gpio2d_ie; +unsigned int gpio3a_ie; +unsigned int gpio3b_ie; +unsigned int gpio3c_ie; +unsigned int gpio3d_ie; +unsigned int gpio4a_ie; +unsigned int gpio4b_ie; +unsigned int gpio4c_ie; +unsigned int gpio4d_ie; +unsigned int gpio1a_opd; +unsigned int gpio1b_opd; +unsigned int gpio1c_opd; +unsigned int gpio1d_opd; +unsigned int gpio2a_opd; +unsigned int gpio2b_opd; +unsigned int gpio2c_opd; +unsigned int gpio2d_opd; +unsigned int gpio3a_opd; +unsigned int gpio3b_opd; +unsigned int gpio3c_opd; +unsigned int gpio3d_opd; +unsigned int gpio4a_opd; +unsigned int gpio4b_opd; +unsigned int gpio4c_opd; +unsigned int gpio4d_opd; +unsigned int gpio1a_sus; +unsigned int gpio1b_sus; +unsigned int gpio1c_sus; +unsigned int gpio1d_sus; +unsigned int gpio2a_sus; +unsigned int gpio2b_sus; +unsigned int gpio2c_sus; +unsigned int gpio2d_sus; +unsigned int gpio3a_sus; +unsigned int gpio3b_sus; +unsigned int gpio3c_sus; +unsigned int gpio3d_sus; +unsigned int gpio4a_sus; +unsigned int gpio4b_sus; +unsigned int gpio4c_sus; +unsigned int gpio4d_sus; +unsigned int gpio1a_sl; +unsigned int gpio1b_sl; +unsigned int gpio1c_sl; +unsigned int gpio1d_sl; +unsigned int gpio2a_sl; +unsigned int gpio2b_sl; +unsigned int gpio2c_sl; +unsigned int gpio2d_sl; +unsigned int gpio3a_sl; +unsigned int gpio3b_sl; +unsigned int gpio3c_sl; +unsigned int gpio3d_sl; +unsigned int gpio4a_sl; +unsigned int gpio4b_sl; +unsigned int gpio4c_sl; +unsigned int gpio4d_sl; +unsigned int reserved1[(0x0200 -0x01bc ) /4 -1 ]; +unsigned int gpio1a_ds_0; +unsigned int gpio1a_ds_1; +unsigned int gpio1a_ds_2; +unsigned int gpio1a_ds_3; +unsigned int gpio1b_ds_0; +unsigned int gpio1b_ds_1; +unsigned int gpio1b_ds_2; +unsigned int gpio1b_ds_3; +unsigned int gpio1c_ds_0; +unsigned int gpio1c_ds_1; +unsigned int gpio1c_ds_2; +unsigned int gpio1c_ds_3; +unsigned int gpio1d_ds_0; +unsigned int gpio1d_ds_1; +unsigned int gpio1d_ds_2; +unsigned int gpio1d_ds_3; +unsigned int gpio2a_ds_0; +unsigned int gpio2a_ds_1; +unsigned int gpio2a_ds_2; +unsigned int gpio2a_ds_3; +unsigned int gpio2b_ds_0; +unsigned int gpio2b_ds_1; +unsigned int gpio2b_ds_2; +unsigned int gpio2b_ds_3; +unsigned int gpio2c_ds_0; +unsigned int gpio2c_ds_1; +unsigned int gpio2c_ds_2; +unsigned int gpio2c_ds_3; +unsigned int gpio2d_ds_0; +unsigned int gpio2d_ds_1; +unsigned int gpio2d_ds_2; +unsigned int gpio2d_ds_3; +unsigned int gpio3a_ds_0; +unsigned int gpio3a_ds_1; +unsigned int gpio3a_ds_2; +unsigned int gpio3a_ds_3; +unsigned int gpio3b_ds_0; +unsigned int gpio3b_ds_1; +unsigned int gpio3b_ds_2; +unsigned int gpio3b_ds_3; +unsigned int gpio3c_ds_0; +unsigned int gpio3c_ds_1; +unsigned int gpio3c_ds_2; +unsigned int gpio3c_ds_3; +unsigned int gpio3d_ds_0; +unsigned int gpio3d_ds_1; +unsigned int gpio3d_ds_2; +unsigned int gpio3d_ds_3; +unsigned int gpio4a_ds_0; +unsigned int gpio4a_ds_1; +unsigned int gpio4a_ds_2; +unsigned int gpio4a_ds_3; +unsigned int gpio4b_ds_0; +unsigned int gpio4b_ds_1; +unsigned int gpio4b_ds_2; +unsigned int gpio4b_ds_3; +unsigned int gpio4c_ds_0; +unsigned int gpio4c_ds_1; +unsigned int gpio4c_ds_2; +unsigned int gpio4c_ds_3; +unsigned int gpio4d_ds_0; +unsigned int gpio4d_ds_1; +unsigned int gpio4d_ds_2; +unsigned int gpio4d_ds_3; +unsigned int iofunc_sel0; +unsigned int iofunc_sel1; +unsigned int iofunc_sel2; +unsigned int iofunc_sel3; +unsigned int iofunc_sel4; +unsigned int iofunc_sel5; +unsigned int reserved2[(0x0340 -0x0314 ) /4 -1 ]; +unsigned int vi_con0; +unsigned int vi_con1; +unsigned int vi_status0; +unsigned int reserved3[(0x0360 -0x0348 ) /4 -1 ]; +unsigned int vo_con0; +unsigned int vo_con1; +unsigned int vo_con2; +unsigned int vo_con3; +unsigned int reserved4[(0x0380 -0x036c ) /4 -1 ]; +unsigned int mac0_con0; +unsigned int mac0_con1; +unsigned int mac1_con0; +unsigned int mac1_con1; +unsigned int reserved5[(0x03a0 -0x038c ) /4 -1 ]; +unsigned int biu_con0; +unsigned int biu_con1; +unsigned int biu_con2; +unsigned int reserved6[(0x03c0 -0x03a8 ) /4 -1 ]; +unsigned int gic_con0; +unsigned int gic_con1; +unsigned int gic_con2; +unsigned int reserved7[(0x03f0 -0x03c8 ) /4 -1 ]; +unsigned int gpu_con0; +unsigned int gpu_con1; +unsigned int reserved8[(0x0400 -0x03f4 ) /4 -1 ]; +unsigned int cpu_con0; +unsigned int reserved9[(0x0420 -0x0400 ) /4 -1 ]; +unsigned int cpu_status0; +unsigned int reserved10[(0x0500 -0x0420 ) /4 -1 ]; +unsigned int soc_con0; +unsigned int soc_con1; +unsigned int soc_con2; +unsigned int soc_con3; +unsigned int reserved11[(0x0514 -0x050c ) /4 -1 ]; +unsigned int soc_con5; +unsigned int soc_con6; +unsigned int reserved12[(0x0580 -0x0518 ) /4 -1 ]; +unsigned int soc_status0; +unsigned int reserved13[(0x05c0 -0x0580 ) /4 -1 ]; +unsigned int ram_con; +unsigned int core_ram_con; +unsigned int reserved14[(0x0600 -0x05c4 ) /4 -1 ]; +unsigned int tsadc_con; +unsigned int reserved15[(0x0610 -0x0600 ) /4 -1 ]; +unsigned int saradc_con; +unsigned int reserved16[(0x0700 -0x0610 ) /4 -1 ]; +unsigned int gpupvtpll_con0; +unsigned int gpupvtpll_con1; +unsigned int gpupvtpll_con2; +unsigned int gpupvtpll_con3; +unsigned int reserved17[(0x0740 -0x070c ) /4 -1 ]; +unsigned int npupvtpll_con0; +unsigned int npupvtpll_con1; +unsigned int npupvtpll_con2; +unsigned int npupvtpll_con3; +unsigned int reserved18[(0x0800 -0x074c ) /4 -1 ]; +unsigned int chip_id; +unsigned int reserved19[(0x0840 -0x0800 ) /4 -1 ]; +unsigned int gpio1c5_ds; +unsigned int gpio2a2_ds; +unsigned int gpio2b0_ds; +unsigned int gpio3a0_ds; +unsigned int gpio3a6_ds; +unsigned int gpio4a0_ds; +unsigned int reserved20[(0x0900 -0x0854 ) /4 -1 ]; +unsigned int dmac0_con0; +unsigned int dmac0_con1; +unsigned int dmac0_con2; +unsigned int dmac0_con3; +unsigned int dmac0_con4; +unsigned int dmac0_con5; +unsigned int dmac0_con6; +unsigned int dmac0_con7; +unsigned int dmac0_con8; +unsigned int dmac0_con9; +unsigned int reserved21[(0x0940 -0x0924 ) /4 -1 ]; +unsigned int dmac1_con0; +unsigned int dmac1_con1; +unsigned int dmac1_con2; +unsigned int dmac1_con3; +unsigned int dmac1_con4; +unsigned int dmac1_con5; +unsigned int dmac1_con6; +unsigned int dmac1_con7; +unsigned int dmac1_con8; +unsigned int dmac1_con9; +}; + +check_member (rk3568_grf, dmac1_con9,0x0964 ); + +struct rk3568_pmugrf { +unsigned int pmu_gpio0a_iomux_l; +unsigned int pmu_gpio0a_iomux_h; +unsigned int pmu_gpio0b_iomux_l; +unsigned int pmu_gpio0b_iomux_h; +unsigned int pmu_gpio0c_iomux_l; +unsigned int pmu_gpio0c_iomux_h; +unsigned int pmu_gpio0d_iomux_l; +unsigned int reserved0[(0x0020 -0x0018 ) /4 -1 ]; +unsigned int pmu_gpio0a_p; +unsigned int pmu_gpio0b_p; +unsigned int pmu_gpio0c_p; +unsigned int pmu_gpio0d_p; +unsigned int pmu_gpio0a_ie; +unsigned int pmu_gpio0b_ie; +unsigned int pmu_gpio0c_ie; +unsigned int pmu_gpio0d_ie; +unsigned int pmu_gpio0a_opd; +unsigned int pmu_gpio0b_opd; +unsigned int pmu_gpio0c_opd; +unsigned int pmu_gpio0d_opd; +unsigned int pmu_gpio0a_sus; +unsigned int pmu_gpio0b_sus; +unsigned int pmu_gpio0c_sus; +unsigned int pmu_gpio0d_sus; +unsigned int pmu_gpio0a_sl; +unsigned int pmu_gpio0b_sl; +unsigned int pmu_gpio0c_sl; +unsigned int pmu_gpio0d_sl; +unsigned int pmu_gpio0a_ds_0; +unsigned int pmu_gpio0a_ds_1; +unsigned int pmu_gpio0a_ds_2; +unsigned int pmu_gpio0a_ds_3; +unsigned int pmu_gpio0b_ds_0; +unsigned int pmu_gpio0b_ds_1; +unsigned int pmu_gpio0b_ds_2; +unsigned int pmu_gpio0b_ds_3; +unsigned int pmu_gpio0c_ds_0; +unsigned int pmu_gpio0c_ds_1; +unsigned int pmu_gpio0c_ds_2; +unsigned int pmu_gpio0c_ds_3; +unsigned int pmu_gpio0d_ds_0; +unsigned int pmu_gpio0d_ds_1; +unsigned int pmu_gpio0d_ds_2; +unsigned int pmu_gpio0d_ds_3; +unsigned int reserved1[(0x0100 -0x00ac ) /4 -1 ]; +unsigned int pmu_soc_con0; +unsigned int pmu_soc_con1; +unsigned int pmu_soc_con2; +unsigned int pmu_soc_con3; +unsigned int pmu_soc_con4; +unsigned int pmu_soc_con5; +unsigned int reserved2[(0x0124 -0x0114 ) /4 -1 ]; +unsigned int pmu_io_vsel0; +unsigned int pmu_io_vsel1; +unsigned int pmu_io_vsel2; +unsigned int reserved3[(0x0180 -0x012c ) /4 -1 ]; +unsigned int pmu_dll_con0; +unsigned int reserved4[(0x0200 -0x0180 ) /4 -1 ]; +unsigned int pmu_os_reg0; +unsigned int pmu_os_reg1; +unsigned int pmu_os_reg2; +unsigned int pmu_os_reg3; +unsigned int pmu_os_reg4; +unsigned int pmu_os_reg5; +unsigned int pmu_os_reg6; +unsigned int pmu_os_reg7; +unsigned int pmu_os_reg8; +unsigned int pmu_os_reg9; +unsigned int pmu_os_reg10; +unsigned int pmu_os_reg11; +unsigned int pmu_reset_function_status; +unsigned int pmu_reset_function_clr; +unsigned int reserved5[(0x0380 -0x0234 ) /4 -1 ]; +unsigned int pmu_sig_detect_con; +unsigned int reserved6[(0x0390 -0x0380 ) /4 -1 ]; +unsigned int pmu_sig_detect_status; +unsigned int reserved7[(0x03a0 -0x0390 ) /4 -1 ]; +unsigned int pmu_sig_detect_status_clear; +unsigned int reserved8[(0x03b0 -0x03a0 ) /4 -1 ]; +unsigned int pmu_sdmmc_det_counter; +}; + +check_member (rk3568_pmugrf, pmu_sdmmc_det_counter,0x03b0 ); + +#endif arch/arm/mach-rockchip/Kconfig +17
-0@@ -257,6 +257,23 @@ config ROCKCHIP_RK3399 and video codec support. Peripherals include Gigabit Ethernet, USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs. +config ROCKCHIP_RK3568 + bool "Support Rockchip RK3568" + select ARM64 + select CLK + select PINCTRL + select RAM + select REGMAP + select SYSCON + select BOARD_LATE_INIT + imply ROCKCHIP_COMMON_BOARD + help + The Rockchip RK3568 is a ARM-based SoC with quad-core Cortex-A55, + including NEON and GPU, 512K L3 cache, Mali-G52 based 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_RV1108 bool "Support Rockchip RV1108" select CPU_V7Aarch/arm/mach-rockchip/Makefile +1
-0@@ -42,6 +42,7 @@ obj-$(CONFIG_ROCKCHIP_RK3308) += rk3308/ obj-$(CONFIG_ROCKCHIP_RK3328) += rk3328/ obj-$(CONFIG_ROCKCHIP_RK3368) += rk3368/ obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399/ +obj-$(CONFIG_ROCKCHIP_RK3568) += rk3568/ obj-$(CONFIG_ROCKCHIP_RV1108) += rv1108/ # Clear out SPL objects, in case this is a TPL buildarch/arm/mach-rockchip/rk3568/Kconfig new file +20
-0@@ -0,0 +1,20 @@ +if ROCKCHIP_RK3568 + +config TARGET_EVB_RK3568 + bool "RK3568 evaluation board" + select BOARD_LATE_INIT + help + RK3568 EVB is a evaluation board for Rockchp RK3568. + +config ROCKCHIP_BOOT_MODE_REG + default 0xfdc20200 + +config SYS_SOC + default "rk3568" + +config SYS_MALLOC_F_LEN + default 0x2000 + +source "board/rockchip/evb_rk3568/Kconfig" + +endifarch/arm/mach-rockchip/rk3568/Makefile new file +9
-0@@ -0,0 +1,9 @@ +# +# (C) Copyright 2021 Rockchip Electronics Co., Ltd +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += clk_rk3568.o +obj-y += rk3568.o +obj-y += syscon_rk3568.oarch/arm/mach-rockchip/rk3568/clk_rk3568.c new file +53
-0@@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/arch-rockchip/clock.h> +#include <asm/arch-rockchip/cru_rk3568.h> +#include <linux/err.h> + +int rockchip_get_clk (struct udevice **devp) +{ +return uclass_get_device_by_driver (UCLASS_CLK , +DM_DRIVER_GET (rockchip_rk3568_cru), devp); +} + +void *rockchip_get_cru (void ) +{ +struct rk3568_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; +} + +static int rockchip_get_pmucruclk (struct udevice **devp) +{ +return uclass_get_device_by_driver (UCLASS_CLK , +DM_DRIVER_GET (rockchip_rk3568_pmucru), devp); +} + +void *rockchip_get_pmucru (void ) +{ +struct rk3568_pmuclk_priv *priv; +struct udevice *dev; +int ret; + + ret =rockchip_get_pmucruclk (&dev); +if (ret) +return ERR_PTR (ret); + + priv =dev_get_priv (dev); + +return priv->pmucru; +}arch/arm/mach-rockchip/rk3568/rk3568.c new file +85
-0@@ -0,0 +1,85 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <asm/armv8/mmu.h> +#include <asm/io.h> +#include <asm/arch-rockchip/grf_rk3568.h> +#include <asm/arch-rockchip/hardware.h> +#include <dt-bindings/clock/rk3568-cru.h> + +#define PMUGRF_BASE 0xfdc20000 +#define GRF_BASE 0xfdc60000 + +/* PMU_GRF_GPIO0D_IOMUX_L */ +enum { +GPIO0D1_SHIFT =4 , +GPIO0D1_MASK =GENMASK (6 ,4 ), +GPIO0D1_GPIO =0 , +GPIO0D1_UART2_TXM0 , + +GPIO0D0_SHIFT =0 , +GPIO0D0_MASK =GENMASK (2 ,0 ), +GPIO0D0_GPIO =0 , +GPIO0D0_UART2_RXM0 , +}; + +/* GRF_IOFUNC_SEL3 */ +enum { +UART2_IO_SEL_SHIFT =10 , +UART2_IO_SEL_MASK =GENMASK (11 ,10 ), +UART2_IO_SEL_M0 =0 , +}; + +static struct mm_region rk3568_mem_map[] = { + { + .virt =0x0UL , + .phys =0x0UL , + .size =0xf0000000UL , + .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 + }, { + .virt =0x300000000 , + .phys =0x300000000 , + .size =0x0c0c00000 , + .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 = rk3568_mem_map; + +void board_debug_uart_init (void ) +{ +static struct rk3568_pmugrf *const pmugrf = (void *)PMUGRF_BASE ; +static struct rk3568_grf *const grf = (void *)GRF_BASE ; + +/* UART2 M0 */ +rk_clrsetreg (&grf->iofunc_sel3,UART2_IO_SEL_MASK , +UART2_IO_SEL_M0 <<UART2_IO_SEL_SHIFT ); + +/* Switch iomux */ +rk_clrsetreg (&pmugrf->pmu_gpio0d_iomux_l, +GPIO0D1_MASK |GPIO0D0_MASK , +GPIO0D1_UART2_TXM0 <<GPIO0D1_SHIFT | +GPIO0D0_UART2_RXM0 <<GPIO0D0_SHIFT ); +} + +int arch_cpu_init (void ) +{ +return 0 ; +}arch/arm/mach-rockchip/rk3568/syscon_rk3568.c new file +24
-0@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/arch-rockchip/clock.h> + +static const struct udevice_id rk3568_syscon_ids[] = { + { .compatible ="rockchip,rk3568-grf" , .data =ROCKCHIP_SYSCON_GRF }, + { .compatible ="rockchip,rk3568-pmugrf" , .data =ROCKCHIP_SYSCON_PMUGRF }, + { } +}; + +U_BOOT_DRIVER (syscon_rk3568) = { + .name ="rk3568_syscon" , + .id =UCLASS_SYSCON , + .of_match = rk3568_syscon_ids, +#if !CONFIG_IS_ENABLED(OF_PLATDATA) + .bind = dm_scan_fdt_dev, +#endif +};include/configs/rk3568_common.h new file +40
-0@@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __CONFIG_RK3568_COMMON_H +#define __CONFIG_RK3568_COMMON_H + +#include "rockchip-common.h" + +#define CONFIG_SYS_CBSIZE 1024 +#define CONFIG_SKIP_LOWLEVEL_INIT + +#define COUNTER_FREQUENCY 24000000 +#define CONFIG_ROCKCHIP_STIMER_BASE 0xfdd1c020 + +#define CONFIG_IRAM_BASE 0xfdcc0000 + +#define CONFIG_SYS_INIT_SP_ADDR 0x00c00000 +#define CONFIG_SYS_LOAD_ADDR 0x00c00800 +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* 64M */ + +#define CONFIG_SYS_SDRAM_BASE 0 +#define SDRAM_MAX_SIZE 0xf0000000 + +#ifndef CONFIG_SPL_BUILD +#define ENV_MEM_LAYOUT_SETTINGS \ + "scriptaddr=0x00c00000\0" \ + "pxefile_addr_r=0x00e00000\0" \ + "fdt_addr_r=0x0a100000\0" \ + "kernel_addr_r=0x02080000\0" \ + "ramdisk_addr_r=0x0a200000\0" + +#include <config_distro_bootcmd.h> +#define CONFIG_EXTRA_ENV_SETTINGS \ + ENV_MEM_LAYOUT_SETTINGS \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ + "partitions=" PARTS_DEFAULT \ + ROCKCHIP_DEVICE_SETTINGS \ + BOOTENVQuoted 10 lines
Quoted 8 lines
include/configs/rk3568_common.h new file +3
-1+#endif + +#endif --2.17.1
--
陈健洪 (Joseph.Chen)
E-mail:[email protected]
福州瑞芯微电子股份有限公司
Fuzhou Rockchip Electronics Co.Ltd
福建省福州市铜盘路软件大道89号软件园A区21号楼 (350003)
No. 21 Building, A District, No.89,software Boulevard Fuzhou,Fujian,PRC TEL:0591-83991906/07-8573
Re: [PATCH v1 4/5] rockchip: Add rk3568 architecture core
In reply to Peter RobinsonHi Peter
Quoted 15 lines · Peter Robinson
Quoted 7 lines · Joseph Chen
RK3568 is a high-performance and low power quad-core application processor designed for personal mobile internet device and AIoT equipments.
Signed-off-by Joseph Chen <[email protected]>---
Quoted 7 lines
arch/arm/include/asm/arch-rk3568/boot0.h | 11 + arch/arm/include/asm/arch-rk3568/gpio.h | 11 + .../include/asm/arch-rockchip/grf_rk3568.h | 369 ++++++++++++++++++ arch/arm/mach-rockchip/Kconfig | 17 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rk3568/Kconfig | 20 + arch/arm/mach-rockchip/rk3568/Makefile | 9 +
Quoted 2 lines
I wonder if this directory structure should be called rk35xx given that at least the rk3566 shares a lot with the rk3568?
Yes, rk356x is an option, but I think it's OK to use 'rk3568' to name all the module compatible and soc basic
folder name, which we can sync from kernel directly. And for rk3566, we can know its relation with rk3568
from dtsi and defconfig file.
Thanks,
- Kever
Re: [PATCH v1 4/5] rockchip: Add rk3568 architecture core
In reply to Joseph ChenQuoted 5 lines · Joseph Chen
RK3568 is a high-performance and low power quad-core application processor designed for personal mobile internet device and AIoT equipments.
Signed-off-by Joseph Chen <[email protected]>
Thanks,
- Kever
Quoted 743 lines
---
arch/arm/include/asm/arch-rk3568/boot0.h | 11 + arch/arm/include/asm/arch-rk3568/gpio.h | 11 + .../include/asm/arch-rockchip/grf_rk3568.h | 369 ++++++++++++++++++ arch/arm/mach-rockchip/Kconfig | 17 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rk3568/Kconfig | 20 + arch/arm/mach-rockchip/rk3568/Makefile | 9 + arch/arm/mach-rockchip/rk3568/clk_rk3568.c | 53 +++ arch/arm/mach-rockchip/rk3568/rk3568.c | 85 ++++ arch/arm/mach-rockchip/rk3568/syscon_rk3568.c | 24 ++ include/configs/rk3568_common.h | 43 ++ 11 files changed, 643 insertions(+)create mode 100644
arch/arm/include/asm/arch-rk3568/boot0.hcreate mode 100644arch/arm/include/asm/arch-rk3568/gpio.hcreate mode 100644arch/arm/include/asm/arch-rockchip/grf_rk3568.hcreate mode 100644arch/arm/mach-rockchip/rk3568/Kconfigcreate mode 100644arch/arm/mach-rockchip/rk3568/Makefilecreate mode 100644arch/arm/mach-rockchip/rk3568/clk_rk3568.ccreate mode 100644arch/arm/mach-rockchip/rk3568/rk3568.ccreate mode 100644arch/arm/mach-rockchip/rk3568/syscon_rk3568.ccreate mode 100644include/configs/rk3568_common.harch/arm/include/asm/arch-rk3568/boot0.h new file +11
-0@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __ASM_ARCH_BOOT0_H__ +#define __ASM_ARCH_BOOT0_H__ + +#include <asm/arch-rockchip/boot0.h> + +#endif arch/arm/include/asm/arch-rk3568/gpio.h new file +11
-0@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __ASM_ARCH_GPIO_H__ +#define __ASM_ARCH_GPIO_H__ + +#include <asm/arch-rockchip/gpio.h> + +#endif arch/arm/include/asm/arch-rockchip/grf_rk3568.h new file +369
-0@@ -0,0 +1,369 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __SOC_ROCKCHIP_RK3568_GRF_H__ +#define __SOC_ROCKCHIP_RK3568_GRF_H__ + +struct rk3568_grf { +unsigned int gpio1a_iomux_l; +unsigned int gpio1a_iomux_h; +unsigned int gpio1b_iomux_l; +unsigned int gpio1b_iomux_h; +unsigned int gpio1c_iomux_l; +unsigned int gpio1c_iomux_h; +unsigned int gpio1d_iomux_l; +unsigned int gpio1d_iomux_h; +unsigned int gpio2a_iomux_l; +unsigned int gpio2a_iomux_h; +unsigned int gpio2b_iomux_l; +unsigned int gpio2b_iomux_h; +unsigned int gpio2c_iomux_l; +unsigned int gpio2c_iomux_h; +unsigned int gpio2d_iomux_l; +unsigned int gpio2d_iomux_h; +unsigned int gpio3a_iomux_l; +unsigned int gpio3a_iomux_h; +unsigned int gpio3b_iomux_l; +unsigned int gpio3b_iomux_h; +unsigned int gpio3c_iomux_l; +unsigned int gpio3c_iomux_h; +unsigned int gpio3d_iomux_l; +unsigned int gpio3d_iomux_h; +unsigned int gpio4a_iomux_l; +unsigned int gpio4a_iomux_h; +unsigned int gpio4b_iomux_l; +unsigned int gpio4b_iomux_h; +unsigned int gpio4c_iomux_l; +unsigned int gpio4c_iomux_h; +unsigned int gpio4d_iomux_l; +unsigned int reserved0[(0x0080 -0x0078 ) /4 -1 ]; +unsigned int gpio1a_p; +unsigned int gpio1b_p; +unsigned int gpio1c_p; +unsigned int gpio1d_p; +unsigned int gpio2a_p; +unsigned int gpio2b_p; +unsigned int gpio2c_p; +unsigned int gpio2d_p; +unsigned int gpio3a_p; +unsigned int gpio3b_p; +unsigned int gpio3c_p; +unsigned int gpio3d_p; +unsigned int gpio4a_p; +unsigned int gpio4b_p; +unsigned int gpio4c_p; +unsigned int gpio4d_p; +unsigned int gpio1a_ie; +unsigned int gpio1b_ie; +unsigned int gpio1c_ie; +unsigned int gpio1d_ie; +unsigned int gpio2a_ie; +unsigned int gpio2b_ie; +unsigned int gpio2c_ie; +unsigned int gpio2d_ie; +unsigned int gpio3a_ie; +unsigned int gpio3b_ie; +unsigned int gpio3c_ie; +unsigned int gpio3d_ie; +unsigned int gpio4a_ie; +unsigned int gpio4b_ie; +unsigned int gpio4c_ie; +unsigned int gpio4d_ie; +unsigned int gpio1a_opd; +unsigned int gpio1b_opd; +unsigned int gpio1c_opd; +unsigned int gpio1d_opd; +unsigned int gpio2a_opd; +unsigned int gpio2b_opd; +unsigned int gpio2c_opd; +unsigned int gpio2d_opd; +unsigned int gpio3a_opd; +unsigned int gpio3b_opd; +unsigned int gpio3c_opd; +unsigned int gpio3d_opd; +unsigned int gpio4a_opd; +unsigned int gpio4b_opd; +unsigned int gpio4c_opd; +unsigned int gpio4d_opd; +unsigned int gpio1a_sus; +unsigned int gpio1b_sus; +unsigned int gpio1c_sus; +unsigned int gpio1d_sus; +unsigned int gpio2a_sus; +unsigned int gpio2b_sus; +unsigned int gpio2c_sus; +unsigned int gpio2d_sus; +unsigned int gpio3a_sus; +unsigned int gpio3b_sus; +unsigned int gpio3c_sus; +unsigned int gpio3d_sus; +unsigned int gpio4a_sus; +unsigned int gpio4b_sus; +unsigned int gpio4c_sus; +unsigned int gpio4d_sus; +unsigned int gpio1a_sl; +unsigned int gpio1b_sl; +unsigned int gpio1c_sl; +unsigned int gpio1d_sl; +unsigned int gpio2a_sl; +unsigned int gpio2b_sl; +unsigned int gpio2c_sl; +unsigned int gpio2d_sl; +unsigned int gpio3a_sl; +unsigned int gpio3b_sl; +unsigned int gpio3c_sl; +unsigned int gpio3d_sl; +unsigned int gpio4a_sl; +unsigned int gpio4b_sl; +unsigned int gpio4c_sl; +unsigned int gpio4d_sl; +unsigned int reserved1[(0x0200 -0x01bc ) /4 -1 ]; +unsigned int gpio1a_ds_0; +unsigned int gpio1a_ds_1; +unsigned int gpio1a_ds_2; +unsigned int gpio1a_ds_3; +unsigned int gpio1b_ds_0; +unsigned int gpio1b_ds_1; +unsigned int gpio1b_ds_2; +unsigned int gpio1b_ds_3; +unsigned int gpio1c_ds_0; +unsigned int gpio1c_ds_1; +unsigned int gpio1c_ds_2; +unsigned int gpio1c_ds_3; +unsigned int gpio1d_ds_0; +unsigned int gpio1d_ds_1; +unsigned int gpio1d_ds_2; +unsigned int gpio1d_ds_3; +unsigned int gpio2a_ds_0; +unsigned int gpio2a_ds_1; +unsigned int gpio2a_ds_2; +unsigned int gpio2a_ds_3; +unsigned int gpio2b_ds_0; +unsigned int gpio2b_ds_1; +unsigned int gpio2b_ds_2; +unsigned int gpio2b_ds_3; +unsigned int gpio2c_ds_0; +unsigned int gpio2c_ds_1; +unsigned int gpio2c_ds_2; +unsigned int gpio2c_ds_3; +unsigned int gpio2d_ds_0; +unsigned int gpio2d_ds_1; +unsigned int gpio2d_ds_2; +unsigned int gpio2d_ds_3; +unsigned int gpio3a_ds_0; +unsigned int gpio3a_ds_1; +unsigned int gpio3a_ds_2; +unsigned int gpio3a_ds_3; +unsigned int gpio3b_ds_0; +unsigned int gpio3b_ds_1; +unsigned int gpio3b_ds_2; +unsigned int gpio3b_ds_3; +unsigned int gpio3c_ds_0; +unsigned int gpio3c_ds_1; +unsigned int gpio3c_ds_2; +unsigned int gpio3c_ds_3; +unsigned int gpio3d_ds_0; +unsigned int gpio3d_ds_1; +unsigned int gpio3d_ds_2; +unsigned int gpio3d_ds_3; +unsigned int gpio4a_ds_0; +unsigned int gpio4a_ds_1; +unsigned int gpio4a_ds_2; +unsigned int gpio4a_ds_3; +unsigned int gpio4b_ds_0; +unsigned int gpio4b_ds_1; +unsigned int gpio4b_ds_2; +unsigned int gpio4b_ds_3; +unsigned int gpio4c_ds_0; +unsigned int gpio4c_ds_1; +unsigned int gpio4c_ds_2; +unsigned int gpio4c_ds_3; +unsigned int gpio4d_ds_0; +unsigned int gpio4d_ds_1; +unsigned int gpio4d_ds_2; +unsigned int gpio4d_ds_3; +unsigned int iofunc_sel0; +unsigned int iofunc_sel1; +unsigned int iofunc_sel2; +unsigned int iofunc_sel3; +unsigned int iofunc_sel4; +unsigned int iofunc_sel5; +unsigned int reserved2[(0x0340 -0x0314 ) /4 -1 ]; +unsigned int vi_con0; +unsigned int vi_con1; +unsigned int vi_status0; +unsigned int reserved3[(0x0360 -0x0348 ) /4 -1 ]; +unsigned int vo_con0; +unsigned int vo_con1; +unsigned int vo_con2; +unsigned int vo_con3; +unsigned int reserved4[(0x0380 -0x036c ) /4 -1 ]; +unsigned int mac0_con0; +unsigned int mac0_con1; +unsigned int mac1_con0; +unsigned int mac1_con1; +unsigned int reserved5[(0x03a0 -0x038c ) /4 -1 ]; +unsigned int biu_con0; +unsigned int biu_con1; +unsigned int biu_con2; +unsigned int reserved6[(0x03c0 -0x03a8 ) /4 -1 ]; +unsigned int gic_con0; +unsigned int gic_con1; +unsigned int gic_con2; +unsigned int reserved7[(0x03f0 -0x03c8 ) /4 -1 ]; +unsigned int gpu_con0; +unsigned int gpu_con1; +unsigned int reserved8[(0x0400 -0x03f4 ) /4 -1 ]; +unsigned int cpu_con0; +unsigned int reserved9[(0x0420 -0x0400 ) /4 -1 ]; +unsigned int cpu_status0; +unsigned int reserved10[(0x0500 -0x0420 ) /4 -1 ]; +unsigned int soc_con0; +unsigned int soc_con1; +unsigned int soc_con2; +unsigned int soc_con3; +unsigned int reserved11[(0x0514 -0x050c ) /4 -1 ]; +unsigned int soc_con5; +unsigned int soc_con6; +unsigned int reserved12[(0x0580 -0x0518 ) /4 -1 ]; +unsigned int soc_status0; +unsigned int reserved13[(0x05c0 -0x0580 ) /4 -1 ]; +unsigned int ram_con; +unsigned int core_ram_con; +unsigned int reserved14[(0x0600 -0x05c4 ) /4 -1 ]; +unsigned int tsadc_con; +unsigned int reserved15[(0x0610 -0x0600 ) /4 -1 ]; +unsigned int saradc_con; +unsigned int reserved16[(0x0700 -0x0610 ) /4 -1 ]; +unsigned int gpupvtpll_con0; +unsigned int gpupvtpll_con1; +unsigned int gpupvtpll_con2; +unsigned int gpupvtpll_con3; +unsigned int reserved17[(0x0740 -0x070c ) /4 -1 ]; +unsigned int npupvtpll_con0; +unsigned int npupvtpll_con1; +unsigned int npupvtpll_con2; +unsigned int npupvtpll_con3; +unsigned int reserved18[(0x0800 -0x074c ) /4 -1 ]; +unsigned int chip_id; +unsigned int reserved19[(0x0840 -0x0800 ) /4 -1 ]; +unsigned int gpio1c5_ds; +unsigned int gpio2a2_ds; +unsigned int gpio2b0_ds; +unsigned int gpio3a0_ds; +unsigned int gpio3a6_ds; +unsigned int gpio4a0_ds; +unsigned int reserved20[(0x0900 -0x0854 ) /4 -1 ]; +unsigned int dmac0_con0; +unsigned int dmac0_con1; +unsigned int dmac0_con2; +unsigned int dmac0_con3; +unsigned int dmac0_con4; +unsigned int dmac0_con5; +unsigned int dmac0_con6; +unsigned int dmac0_con7; +unsigned int dmac0_con8; +unsigned int dmac0_con9; +unsigned int reserved21[(0x0940 -0x0924 ) /4 -1 ]; +unsigned int dmac1_con0; +unsigned int dmac1_con1; +unsigned int dmac1_con2; +unsigned int dmac1_con3; +unsigned int dmac1_con4; +unsigned int dmac1_con5; +unsigned int dmac1_con6; +unsigned int dmac1_con7; +unsigned int dmac1_con8; +unsigned int dmac1_con9; +}; + +check_member (rk3568_grf, dmac1_con9,0x0964 ); + +struct rk3568_pmugrf { +unsigned int pmu_gpio0a_iomux_l; +unsigned int pmu_gpio0a_iomux_h; +unsigned int pmu_gpio0b_iomux_l; +unsigned int pmu_gpio0b_iomux_h; +unsigned int pmu_gpio0c_iomux_l; +unsigned int pmu_gpio0c_iomux_h; +unsigned int pmu_gpio0d_iomux_l; +unsigned int reserved0[(0x0020 -0x0018 ) /4 -1 ]; +unsigned int pmu_gpio0a_p; +unsigned int pmu_gpio0b_p; +unsigned int pmu_gpio0c_p; +unsigned int pmu_gpio0d_p; +unsigned int pmu_gpio0a_ie; +unsigned int pmu_gpio0b_ie; +unsigned int pmu_gpio0c_ie; +unsigned int pmu_gpio0d_ie; +unsigned int pmu_gpio0a_opd; +unsigned int pmu_gpio0b_opd; +unsigned int pmu_gpio0c_opd; +unsigned int pmu_gpio0d_opd; +unsigned int pmu_gpio0a_sus; +unsigned int pmu_gpio0b_sus; +unsigned int pmu_gpio0c_sus; +unsigned int pmu_gpio0d_sus; +unsigned int pmu_gpio0a_sl; +unsigned int pmu_gpio0b_sl; +unsigned int pmu_gpio0c_sl; +unsigned int pmu_gpio0d_sl; +unsigned int pmu_gpio0a_ds_0; +unsigned int pmu_gpio0a_ds_1; +unsigned int pmu_gpio0a_ds_2; +unsigned int pmu_gpio0a_ds_3; +unsigned int pmu_gpio0b_ds_0; +unsigned int pmu_gpio0b_ds_1; +unsigned int pmu_gpio0b_ds_2; +unsigned int pmu_gpio0b_ds_3; +unsigned int pmu_gpio0c_ds_0; +unsigned int pmu_gpio0c_ds_1; +unsigned int pmu_gpio0c_ds_2; +unsigned int pmu_gpio0c_ds_3; +unsigned int pmu_gpio0d_ds_0; +unsigned int pmu_gpio0d_ds_1; +unsigned int pmu_gpio0d_ds_2; +unsigned int pmu_gpio0d_ds_3; +unsigned int reserved1[(0x0100 -0x00ac ) /4 -1 ]; +unsigned int pmu_soc_con0; +unsigned int pmu_soc_con1; +unsigned int pmu_soc_con2; +unsigned int pmu_soc_con3; +unsigned int pmu_soc_con4; +unsigned int pmu_soc_con5; +unsigned int reserved2[(0x0124 -0x0114 ) /4 -1 ]; +unsigned int pmu_io_vsel0; +unsigned int pmu_io_vsel1; +unsigned int pmu_io_vsel2; +unsigned int reserved3[(0x0180 -0x012c ) /4 -1 ]; +unsigned int pmu_dll_con0; +unsigned int reserved4[(0x0200 -0x0180 ) /4 -1 ]; +unsigned int pmu_os_reg0; +unsigned int pmu_os_reg1; +unsigned int pmu_os_reg2; +unsigned int pmu_os_reg3; +unsigned int pmu_os_reg4; +unsigned int pmu_os_reg5; +unsigned int pmu_os_reg6; +unsigned int pmu_os_reg7; +unsigned int pmu_os_reg8; +unsigned int pmu_os_reg9; +unsigned int pmu_os_reg10; +unsigned int pmu_os_reg11; +unsigned int pmu_reset_function_status; +unsigned int pmu_reset_function_clr; +unsigned int reserved5[(0x0380 -0x0234 ) /4 -1 ]; +unsigned int pmu_sig_detect_con; +unsigned int reserved6[(0x0390 -0x0380 ) /4 -1 ]; +unsigned int pmu_sig_detect_status; +unsigned int reserved7[(0x03a0 -0x0390 ) /4 -1 ]; +unsigned int pmu_sig_detect_status_clear; +unsigned int reserved8[(0x03b0 -0x03a0 ) /4 -1 ]; +unsigned int pmu_sdmmc_det_counter; +}; + +check_member (rk3568_pmugrf, pmu_sdmmc_det_counter,0x03b0 ); + +#endif arch/arm/mach-rockchip/Kconfig +17
-0@@ -257,6 +257,23 @@ config ROCKCHIP_RK3399 and video codec support. Peripherals include Gigabit Ethernet, USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs. +config ROCKCHIP_RK3568 + bool "Support Rockchip RK3568" + select ARM64 + select CLK + select PINCTRL + select RAM + select REGMAP + select SYSCON + select BOARD_LATE_INIT + imply ROCKCHIP_COMMON_BOARD + help + The Rockchip RK3568 is a ARM-based SoC with quad-core Cortex-A55, + including NEON and GPU, 512K L3 cache, Mali-G52 based 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_RV1108 bool "Support Rockchip RV1108" select CPU_V7Aarch/arm/mach-rockchip/Makefile +1
-0@@ -42,6 +42,7 @@ obj-$(CONFIG_ROCKCHIP_RK3308) += rk3308/ obj-$(CONFIG_ROCKCHIP_RK3328) += rk3328/ obj-$(CONFIG_ROCKCHIP_RK3368) += rk3368/ obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399/ +obj-$(CONFIG_ROCKCHIP_RK3568) += rk3568/ obj-$(CONFIG_ROCKCHIP_RV1108) += rv1108/ # Clear out SPL objects, in case this is a TPL buildarch/arm/mach-rockchip/rk3568/Kconfig new file +20
-0@@ -0,0 +1,20 @@ +if ROCKCHIP_RK3568 + +config TARGET_EVB_RK3568 + bool "RK3568 evaluation board" + select BOARD_LATE_INIT + help + RK3568 EVB is a evaluation board for Rockchp RK3568. + +config ROCKCHIP_BOOT_MODE_REG + default 0xfdc20200 + +config SYS_SOC + default "rk3568" + +config SYS_MALLOC_F_LEN + default 0x2000 + +source "board/rockchip/evb_rk3568/Kconfig" + +endifarch/arm/mach-rockchip/rk3568/Makefile new file +9
-0@@ -0,0 +1,9 @@ +# +# (C) Copyright 2021 Rockchip Electronics Co., Ltd +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += clk_rk3568.o +obj-y += rk3568.o +obj-y += syscon_rk3568.oarch/arm/mach-rockchip/rk3568/clk_rk3568.c new file +53
-0@@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/arch-rockchip/clock.h> +#include <asm/arch-rockchip/cru_rk3568.h> +#include <linux/err.h> + +int rockchip_get_clk (struct udevice **devp) +{ +return uclass_get_device_by_driver (UCLASS_CLK , +DM_DRIVER_GET (rockchip_rk3568_cru), devp); +} + +void *rockchip_get_cru (void ) +{ +struct rk3568_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; +} + +static int rockchip_get_pmucruclk (struct udevice **devp) +{ +return uclass_get_device_by_driver (UCLASS_CLK , +DM_DRIVER_GET (rockchip_rk3568_pmucru), devp); +} + +void *rockchip_get_pmucru (void ) +{ +struct rk3568_pmuclk_priv *priv; +struct udevice *dev; +int ret; + + ret =rockchip_get_pmucruclk (&dev); +if (ret) +return ERR_PTR (ret); + + priv =dev_get_priv (dev); + +return priv->pmucru; +}arch/arm/mach-rockchip/rk3568/rk3568.c new file +85
-0@@ -0,0 +1,85 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <asm/armv8/mmu.h> +#include <asm/io.h> +#include <asm/arch-rockchip/grf_rk3568.h> +#include <asm/arch-rockchip/hardware.h> +#include <dt-bindings/clock/rk3568-cru.h> + +#define PMUGRF_BASE 0xfdc20000 +#define GRF_BASE 0xfdc60000 + +/* PMU_GRF_GPIO0D_IOMUX_L */ +enum { +GPIO0D1_SHIFT =4 , +GPIO0D1_MASK =GENMASK (6 ,4 ), +GPIO0D1_GPIO =0 , +GPIO0D1_UART2_TXM0 , + +GPIO0D0_SHIFT =0 , +GPIO0D0_MASK =GENMASK (2 ,0 ), +GPIO0D0_GPIO =0 , +GPIO0D0_UART2_RXM0 , +}; + +/* GRF_IOFUNC_SEL3 */ +enum { +UART2_IO_SEL_SHIFT =10 , +UART2_IO_SEL_MASK =GENMASK (11 ,10 ), +UART2_IO_SEL_M0 =0 , +}; + +static struct mm_region rk3568_mem_map[] = { + { + .virt =0x0UL , + .phys =0x0UL , + .size =0xf0000000UL , + .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 + }, { + .virt =0x300000000 , + .phys =0x300000000 , + .size =0x0c0c00000 , + .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 = rk3568_mem_map; + +void board_debug_uart_init (void ) +{ +static struct rk3568_pmugrf *const pmugrf = (void *)PMUGRF_BASE ; +static struct rk3568_grf *const grf = (void *)GRF_BASE ; + +/* UART2 M0 */ +rk_clrsetreg (&grf->iofunc_sel3,UART2_IO_SEL_MASK , +UART2_IO_SEL_M0 <<UART2_IO_SEL_SHIFT ); + +/* Switch iomux */ +rk_clrsetreg (&pmugrf->pmu_gpio0d_iomux_l, +GPIO0D1_MASK |GPIO0D0_MASK , +GPIO0D1_UART2_TXM0 <<GPIO0D1_SHIFT | +GPIO0D0_UART2_RXM0 <<GPIO0D0_SHIFT ); +} + +int arch_cpu_init (void ) +{ +return 0 ; +}arch/arm/mach-rockchip/rk3568/syscon_rk3568.c new file +24
-0@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/arch-rockchip/clock.h> + +static const struct udevice_id rk3568_syscon_ids[] = { + { .compatible ="rockchip,rk3568-grf" , .data =ROCKCHIP_SYSCON_GRF }, + { .compatible ="rockchip,rk3568-pmugrf" , .data =ROCKCHIP_SYSCON_PMUGRF }, + { } +}; + +U_BOOT_DRIVER (syscon_rk3568) = { + .name ="rk3568_syscon" , + .id =UCLASS_SYSCON , + .of_match = rk3568_syscon_ids, +#if !CONFIG_IS_ENABLED(OF_PLATDATA) + .bind = dm_scan_fdt_dev, +#endif +};include/configs/rk3568_common.h new file +43
-0@@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __CONFIG_RK3568_COMMON_H +#define __CONFIG_RK3568_COMMON_H + +#include "rockchip-common.h" + +#define CONFIG_SYS_CBSIZE 1024 +#define CONFIG_SKIP_LOWLEVEL_INIT + +#define COUNTER_FREQUENCY 24000000 +#define CONFIG_ROCKCHIP_STIMER_BASE 0xfdd1c020 + +#define CONFIG_IRAM_BASE 0xfdcc0000 + +#define CONFIG_SYS_INIT_SP_ADDR 0x00c00000 +#define CONFIG_SYS_LOAD_ADDR 0x00c00800 +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* 64M */ + +#define CONFIG_SYS_SDRAM_BASE 0 +#define SDRAM_MAX_SIZE 0xf0000000 + +#ifndef CONFIG_SPL_BUILD +#define ENV_MEM_LAYOUT_SETTINGS \ + "scriptaddr=0x00c00000\0" \ + "pxefile_addr_r=0x00e00000\0" \ + "fdt_addr_r=0x0a100000\0" \ + "kernel_addr_r=0x02080000\0" \ + "ramdisk_addr_r=0x0a200000\0" + +#include <config_distro_bootcmd.h> +#define CONFIG_EXTRA_ENV_SETTINGS \ + ENV_MEM_LAYOUT_SETTINGS \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ + "partitions=" PARTS_DEFAULT \ + ROCKCHIP_DEVICE_SETTINGS \ + BOOTENV +#endif + +#endif
PATCH 5/5 board: rockchip: Add rk3568 evb support
In reply to Joseph ChenAdd support for rk3568 evaluation board.
---
arch/arm/mach-rockchip/Kconfig | 1 + board/rockchip/evb_rk3568/Kconfig | 15 +++++++++++ board/rockchip/evb_rk3568/MAINTAINERS | 6 +++++ board/rockchip/evb_rk3568/Makefile | 7 ++++++ board/rockchip/evb_rk3568/evb_rk3568.c | 4 +++ configs/evb-rk3568_defconfig | 35 ++++++++++++++++++++++++++ include/configs/evb_rk3568.h | 17 +++++++++++++ 7 files changed, 85 insertions(+) create mode 100644 board/rockchip/evb_rk3568/Kconfig create mode 100644 board/rockchip/evb_rk3568/MAINTAINERS create mode 100644 board/rockchip/evb_rk3568/Makefile create mode 100644 board/rockchip/evb_rk3568/evb_rk3568.c create mode 100644 configs/evb-rk3568_defconfig create mode 100644 include/configs/evb_rk3568.h
arch/arm/mach-rockchip/Kconfig +1 -0
@@ -403,5 +403,6 @@ source "arch/arm/mach-rockchip/rk3308/Kconfig" source "arch/arm/mach-rockchip/rk3328/Kconfig" source "arch/arm/mach-rockchip/rk3368/Kconfig" source "arch/arm/mach-rockchip/rk3399/Kconfig" +source "arch/arm/mach-rockchip/rk3568/Kconfig" source "arch/arm/mach-rockchip/rv1108/Kconfig" endif
board/rockchip/evb_rk3568/Kconfig new file +15 -0
@@ -0,0 +1,15 @@ +if TARGET_EVB_RK3568 + +config SYS_BOARD + default "evb_rk3568" + +config SYS_VENDOR + default "rockchip" + +config SYS_CONFIG_NAME + default "evb_rk3568" + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + +endif
board/rockchip/evb_rk3568/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +EVB-RK3568 +M: Joseph Chen <[email protected]> +S: Maintained +F: board/rockchip/evb_rk3568 +F: include/configs/evb_rk3568.h +F: configs/evb-rk3568_defconfig
board/rockchip/evb_rk3568/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# (C) Copyright 2021 Rockchip Electronics Co., Ltd +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += evb_rk3568.o
board/rockchip/evb_rk3568/evb_rk3568.c new file +4 -0
@@ -0,0 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/
configs/evb-rk3568_defconfig new file +35 -0
@@ -0,0 +1,35 @@ +CONFIG_ARM=y +CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_TEXT_BASE=0x00a00000 +CONFIG_NR_DRAM_BANKS=2 +CONFIG_ROCKCHIP_RK3568=y +CONFIG_TARGET_EVB_RK3568=y +CONFIG_DEBUG_UART_BASE=0xFE660000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_DEFAULT_DEVICE_TREE="rk3568-evb" +CONFIG_DEBUG_UART=y +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-evb.dtb" +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_CMD_GPT=y +CONFIG_CMD_MMC=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_ROCKCHIP_GPIO=y +CONFIG_SYS_I2C_ROCKCHIP=y +CONFIG_MISC=y +CONFIG_MMC_DW=y +CONFIG_MMC_DW_ROCKCHIP=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_SDMA=y +CONFIG_MMC_SDHCI_ROCKCHIP=y +CONFIG_DM_ETH=y +CONFIG_ETH_DESIGNWARE=y +CONFIG_GMAC_ROCKCHIP=y +CONFIG_REGULATOR_PWM=y +CONFIG_PWM_ROCKCHIP=y +CONFIG_DM_RESET=y +CONFIG_BAUDRATE=1500000 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_SYSRESET=y +CONFIG_ERRNO_STR=y
include/configs/evb_rk3568.h new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __EVB_RK3568_H +#define __EVB_RK3568_H + +#include <configs/rk3568_common.h> + +#define CONFIG_SUPPORT_EMMC_RPMB + +#define ROCKCHIP_DEVICE_SETTINGS \ + "stdout=serial,vidconsole\0" \ + "stderr=serial,vidconsole\0" + +#endif
Signature · 1 line
2.17.1
Re: [PATCH v1 5/5] board: rockchip: Add rk3568 evb support
Quoted 3 lines · Joseph Chen
Add support for rk3568 evaluation board.
Signed-off-by Joseph Chen <[email protected]>
Thanks,
- Kever
Quoted 148 lines
---
arch/arm/mach-rockchip/Kconfig | 1 + board/rockchip/evb_rk3568/Kconfig | 15 +++++++++++ board/rockchip/evb_rk3568/MAINTAINERS | 6 +++++ board/rockchip/evb_rk3568/Makefile | 7 ++++++ board/rockchip/evb_rk3568/evb_rk3568.c | 4 +++ configs/evb-rk3568_defconfig | 35 ++++++++++++++++++++++++++ include/configs/evb_rk3568.h | 17 +++++++++++++ 7 files changed, 85 insertions(+)create mode 100644 board/rockchip/evb_rk3568/Kconfig create mode 100644 board/rockchip/evb_rk3568/MAINTAINERS create mode 100644 board/rockchip/evb_rk3568/Makefile create mode 100644
board/rockchip/evb_rk3568/evb_rk3568.ccreate mode 100644 configs/evb-rk3568_defconfig create mode 100644include/configs/evb_rk3568.harch/arm/mach-rockchip/Kconfig +1
-0@@ -403,5 +403,6 @@ source "arch/arm/mach-rockchip/rk3308/Kconfig" source "arch/arm/mach-rockchip/rk3328/Kconfig" source "arch/arm/mach-rockchip/rk3368/Kconfig" source "arch/arm/mach-rockchip/rk3399/Kconfig" +source "arch/arm/mach-rockchip/rk3568/Kconfig" source "arch/arm/mach-rockchip/rv1108/Kconfig" endifboard/rockchip/evb_rk3568/Kconfig new file +15
-0@@ -0,0 +1,15 @@ +if TARGET_EVB_RK3568 + +config SYS_BOARD + default "evb_rk3568" + +config SYS_VENDOR + default "rockchip" + +config SYS_CONFIG_NAME + default "evb_rk3568" + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + +endifboard/rockchip/evb_rk3568/MAINTAINERS new file +6
-0@@ -0,0 +1,6 @@ +EVB-RK3568 +M: Joseph Chen <[email protected]> +S: Maintained +F: board/rockchip/evb_rk3568 +F: include/configs/evb_rk3568.h +F: configs/evb-rk3568_defconfigboard/rockchip/evb_rk3568/Makefile new file +7
-0@@ -0,0 +1,7 @@ +# +# (C) Copyright 2021 Rockchip Electronics Co., Ltd +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += evb_rk3568.oboard/rockchip/evb_rk3568/evb_rk3568.c new file +4
-0@@ -0,0 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ configs/evb-rk3568_defconfig new file +35
-0@@ -0,0 +1,35 @@ +CONFIG_ARM=y +CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_TEXT_BASE=0x00a00000 +CONFIG_NR_DRAM_BANKS=2 +CONFIG_ROCKCHIP_RK3568=y +CONFIG_TARGET_EVB_RK3568=y +CONFIG_DEBUG_UART_BASE=0xFE660000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_DEFAULT_DEVICE_TREE="rk3568-evb" +CONFIG_DEBUG_UART=y +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-evb.dtb" +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_CMD_GPT=y +CONFIG_CMD_MMC=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_ROCKCHIP_GPIO=y +CONFIG_SYS_I2C_ROCKCHIP=y +CONFIG_MISC=y +CONFIG_MMC_DW=y +CONFIG_MMC_DW_ROCKCHIP=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_SDMA=y +CONFIG_MMC_SDHCI_ROCKCHIP=y +CONFIG_DM_ETH=y +CONFIG_ETH_DESIGNWARE=y +CONFIG_GMAC_ROCKCHIP=y +CONFIG_REGULATOR_PWM=y +CONFIG_PWM_ROCKCHIP=y +CONFIG_DM_RESET=y +CONFIG_BAUDRATE=1500000 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_SYSRESET=y +CONFIG_ERRNO_STR=yinclude/configs/evb_rk3568.h new file +17
-0@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2021 Rockchip Electronics Co., Ltd +*/ + +#ifndef __EVB_RK3568_H +#define __EVB_RK3568_H + +#include <configs/rk3568_common.h> + +#define CONFIG_SUPPORT_EMMC_RPMB + +#define ROCKCHIP_DEVICE_SETTINGS \ + "stdout=serial,vidconsole\0" \ + "stderr=serial,vidconsole\0" + +#endif