ARM: Add Rockchip RV1126 support
Subsystems (6)
v4 cover ARM: Add Rockchip RV1126 support
RV1126 is a high-performance vision processor SoC for IPC/CVR, especially for AI related application.
This patch series add basic core support for Rockchip RV1126 and boot from eMMC and SD.
Tested RV1126 in Edgeble Neural Compute Module 2.
Changes for v4:
- rebased linux merged patches
- updated changes based on master
Changes for v3:
- dropped px30 SPL size change patch
- rebased on linux-next
- collect Kever r-b
Any inputs?
Jagan.
Jagan Teki (25):
ram: Mark ram-uclass depend on TPL_DM or SPL_DM
ram: rockchip: Add common ddr type configs
ram: rockchip: Compute ddr capacity based on grf split
ram: rockchip: Update ddr pctl regs for px30
ram: rockchip: Add rv1126 ddr3 support
ram: rockchip: Add rv1126 ddr loader params
ram: rockchip: Add rv1126 ddr driver support
ram: rockchip: rv1126: Control ddr init prints via DEBUG
ram: rockchip: Add rv1126 lpddr4 support
pinctrl: rockchip: Add pinctrl route types
pinctrl: rockchip: Add rv1126 support
arch: rockchip: Add cru header for rv1126
dt-bindings: clk: Add dt-binding header for RV1126
clk: rockchip: Add rv1126 clk support
dt-bindings: power: Add power-domain header for rv1126
arm: rockchip: Add grf header for rv1126
ARM: dts: rockchip: Add Rockchip RV1126 pinctrl
ARM: dts: rockchip: Add Rockchip RV1126 SoC
arm: rockchip: Add RV1126 arch core support
arm: rockchip: rv1126: Set dram area unsecure for SPL
rockchip: mkimage: Add rv1126 support
ARM: dts: rockchip: rv1126: Add Edgeble Neural Compute Module 2(Neu2)
ARM: dts: rockchip: rv1126: Add Edgeble Neural Compute Module 2(Neu2) IO
ARM: dts: rockchip: Add rv1126-u-boot.dtsi
board: rockchip: Add Edgeble Neu2 IO Board
arch/arm/dts/Makefile | 3 + .../dts/rv1126-edgeble-neu2-io-u-boot.dtsi | 10 + arch/arm/dts/rv1126-edgeble-neu2-io.dts | 42 + arch/arm/dts/rv1126-edgeble-neu2.dtsi | 338 ++ arch/arm/dts/rv1126-pinctrl.dtsi | 211 + arch/arm/dts/rv1126-u-boot.dtsi | 62 + arch/arm/dts/rv1126.dtsi | 438 ++ .../include/asm/arch-rockchip/cru_rv1126.h | 459 +++ .../asm/arch-rockchip/dram_spec_timing.h | 452 +++ .../include/asm/arch-rockchip/grf_rv1126.h | 251 ++ .../include/asm/arch-rockchip/sdram_common.h | 214 +- .../include/asm/arch-rockchip/sdram_msch.h | 12 + .../asm/arch-rockchip/sdram_pctl_px30.h | 100 +- .../asm/arch-rockchip/sdram_phy_rv1126.h | 93 + .../include/asm/arch-rockchip/sdram_rv1126.h | 420 ++ arch/arm/include/asm/arch-rv1126/boot0.h | 11 + arch/arm/include/asm/arch-rv1126/gpio.h | 11 + arch/arm/mach-rockchip/Kconfig | 46 + arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rv1126/Kconfig | 59 + arch/arm/mach-rockchip/rv1126/Makefile | 13 + arch/arm/mach-rockchip/rv1126/clk_rv1126.c | 33 + arch/arm/mach-rockchip/rv1126/rv1126.c | 75 + arch/arm/mach-rockchip/rv1126/syscon_rv1126.c | 47 + board/edgeble/neural-compute-module-2/Kconfig | 16 + .../neural-compute-module-2/MAINTAINERS | 6 + .../edgeble/neural-compute-module-2/Makefile | 7 + board/edgeble/neural-compute-module-2/neu2.c | 4 + board/engicam/px30_core/Kconfig | 2 +- common/spl/Kconfig.tpl | 2 +- configs/khadas-edge-captain-rk3399_defconfig | 2 +- configs/khadas-edge-rk3399_defconfig | 2 +- configs/khadas-edge-v-rk3399_defconfig | 2 +- configs/leez-rk3399_defconfig | 2 +- configs/nanopi-r4s-rk3399_defconfig | 2 +- configs/neu2-io-rv1126_defconfig | 57 + configs/pinebook-pro-rk3399_defconfig | 2 +- configs/roc-pc-mezzanine-rk3399_defconfig | 2 +- configs/roc-pc-rk3399_defconfig | 2 +- configs/rock-pi-4-rk3399_defconfig | 2 +- configs/rock-pi-4c-rk3399_defconfig | 2 +- configs/rockpro64-rk3399_defconfig | 2 +- doc/board/rockchip/rockchip.rst | 3 + drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk_rv1126.c | 1889 +++++++++ drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl-px30.c | 11 +- drivers/pinctrl/rockchip/pinctrl-rk3128.c | 11 +- drivers/pinctrl/rockchip/pinctrl-rk322x.c | 11 +- drivers/pinctrl/rockchip/pinctrl-rk3288.c | 11 +- drivers/pinctrl/rockchip/pinctrl-rk3308.c | 11 +- drivers/pinctrl/rockchip/pinctrl-rk3328.c | 11 +- drivers/pinctrl/rockchip/pinctrl-rk3399.c | 11 +- .../pinctrl/rockchip/pinctrl-rockchip-core.c | 45 +- drivers/pinctrl/rockchip/pinctrl-rockchip.h | 58 +- drivers/pinctrl/rockchip/pinctrl-rv1126.c | 416 ++ drivers/ram/Makefile | 2 +- drivers/ram/rockchip/Kconfig | 32 +- drivers/ram/rockchip/Makefile | 1 + .../sdram-rv1126-ddr3-detect-1056.inc | 72 + .../rockchip/sdram-rv1126-ddr3-detect-328.inc | 72 + .../rockchip/sdram-rv1126-ddr3-detect-396.inc | 72 + .../rockchip/sdram-rv1126-ddr3-detect-528.inc | 72 + .../rockchip/sdram-rv1126-ddr3-detect-664.inc | 72 + .../rockchip/sdram-rv1126-ddr3-detect-784.inc | 72 + .../rockchip/sdram-rv1126-ddr3-detect-924.inc | 72 + .../rockchip/sdram-rv1126-loader_params.inc | 197 + .../sdram-rv1126-lpddr4-detect-1056.inc | 78 + .../sdram-rv1126-lpddr4-detect-328.inc | 78 + .../sdram-rv1126-lpddr4-detect-396.inc | 78 + .../sdram-rv1126-lpddr4-detect-528.inc | 78 + .../sdram-rv1126-lpddr4-detect-664.inc | 78 + .../sdram-rv1126-lpddr4-detect-784.inc | 78 + .../sdram-rv1126-lpddr4-detect-924.inc | 78 + drivers/ram/rockchip/sdram_common.c | 6 +- drivers/ram/rockchip/sdram_pctl_px30.c | 6 +- drivers/ram/rockchip/sdram_px30.c | 8 +- drivers/ram/rockchip/sdram_rk3328.c | 2 +- drivers/ram/rockchip/sdram_rk3399.c | 9 +- drivers/ram/rockchip/sdram_rv1126.c | 3543 +++++++++++++++++ include/configs/neural-compute-module-2.h | 21 + include/configs/rv1126_common.h | 40 + .../dt-bindings/clock/rockchip,rv1126-cru.h | 632 +++ .../dt-bindings/power/rockchip,rv1126-power.h | 35 + tools/rkcommon.c | 1 + 85 files changed, 11465 insertions(+), 127 deletions(-) create mode 100644 arch/arm/dts/rv1126-edgeble-neu2-io-u-boot.dtsi create mode 100644 arch/arm/dts/rv1126-edgeble-neu2-io.dts create mode 100644 arch/arm/dts/rv1126-edgeble-neu2.dtsi create mode 100644 arch/arm/dts/rv1126-pinctrl.dtsi create mode 100644 arch/arm/dts/rv1126-u-boot.dtsi create mode 100644 arch/arm/dts/rv1126.dtsi create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rv1126.h create mode 100644 arch/arm/include/asm/arch-rockchip/dram_spec_timing.h create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rv1126.h create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_phy_rv1126.h create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_rv1126.h create mode 100644 arch/arm/include/asm/arch-rv1126/boot0.h create mode 100644 arch/arm/include/asm/arch-rv1126/gpio.h create mode 100644 arch/arm/mach-rockchip/rv1126/Kconfig create mode 100644 arch/arm/mach-rockchip/rv1126/Makefile create mode 100644 arch/arm/mach-rockchip/rv1126/clk_rv1126.c create mode 100644 arch/arm/mach-rockchip/rv1126/rv1126.c create mode 100644 arch/arm/mach-rockchip/rv1126/syscon_rv1126.c create mode 100644 board/edgeble/neural-compute-module-2/Kconfig create mode 100644 board/edgeble/neural-compute-module-2/MAINTAINERS create mode 100644 board/edgeble/neural-compute-module-2/Makefile create mode 100644 board/edgeble/neural-compute-module-2/neu2.c create mode 100644 configs/neu2-io-rv1126_defconfig create mode 100644 drivers/clk/rockchip/clk_rv1126.c create mode 100644 drivers/pinctrl/rockchip/pinctrl-rv1126.c create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-1056.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-328.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-396.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-528.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-664.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-784.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-924.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-loader_params.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-1056.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-328.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-396.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-528.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-664.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-784.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-924.inc create mode 100644 drivers/ram/rockchip/sdram_rv1126.c create mode 100644 include/configs/neural-compute-module-2.h create mode 100644 include/configs/rv1126_common.h create mode 100644 include/dt-bindings/clock/rockchip,rv1126-cru.h create mode 100644 include/dt-bindings/power/rockchip,rv1126-power.h
Signature · 1 line
2.25.1
PATCH v4 1/25 ram: Mark ram-uclass depend on TPL_DM or SPL_DM
ram-uclass is building irrespective of whether TPL_DM or SPL_DM is enabled. So control the ram uclass build based on TPL/SPL_DM.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
drivers/ram/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ram/Makefile +1 -1
@@ -3,7 +3,7 @@ # Copyright (c) 2015 Google, Inc # Wolfgang Denk, DENX Software Engineering, [email protected]. # -obj-$(CONFIG_RAM) += ram-uclass.o +obj-$(CONFIG_$(SPL_TPL_)DM) += ram-uclass.o obj-$(CONFIG_MPC83XX_SDRAM) += mpc83xx_sdram.o obj-$(CONFIG_SANDBOX) += sandbox_ram.o obj-$(CONFIG_STM32MP1_DDR) += stm32mp1/
Signature · 1 line
2.25.1
PATCH v4 2/25 ram: rockchip: Add common ddr type configs
In reply to Jagan TekiFrom: Jagan Teki <[email protected]>
We have common ddr types in rockchip or in general. So use the common ddr type names instead of per Rockchip SoC to avoid confusion.
The respective ddr type names will use on the associated ddr SoC driver as these drivers are built per SoC at a time.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
board/engicam/px30_core/Kconfig | 2 +- configs/khadas-edge-captain-rk3399_defconfig | 2 +- configs/khadas-edge-rk3399_defconfig | 2 +- configs/khadas-edge-v-rk3399_defconfig | 2 +- configs/leez-rk3399_defconfig | 2 +- configs/nanopi-r4s-rk3399_defconfig | 2 +- configs/pinebook-pro-rk3399_defconfig | 2 +- configs/roc-pc-mezzanine-rk3399_defconfig | 2 +- configs/roc-pc-rk3399_defconfig | 2 +- configs/rock-pi-4-rk3399_defconfig | 2 +- configs/rock-pi-4c-rk3399_defconfig | 2 +- configs/rockpro64-rk3399_defconfig | 2 +- drivers/ram/rockchip/Kconfig | 32 +++++++++----------- drivers/ram/rockchip/sdram_px30.c | 6 ++-- drivers/ram/rockchip/sdram_rk3399.c | 7 ++--- 15 files changed, 33 insertions(+), 36 deletions(-)
board/engicam/px30_core/Kconfig +1 -1
@@ -11,6 +11,6 @@ config SYS_CONFIG_NAME config BOARD_SPECIFIC_OPTIONS # dummy def_bool y - select RAM_PX30_DDR4 + select RAM_ROCKCHIP_DDR4 endif
configs/khadas-edge-captain-rk3399_defconfig +1 -1
@@ -53,7 +53,7 @@ CONFIG_PMIC_RK8XX=y CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y -CONFIG_RAM_RK3399_LPDDR4=y +CONFIG_RAM_ROCKCHIP_LPDDR4=y CONFIG_BAUDRATE=1500000 CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYSRESET=y
configs/khadas-edge-rk3399_defconfig +1 -1
@@ -52,7 +52,7 @@ CONFIG_PMIC_RK8XX=y CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y -CONFIG_RAM_RK3399_LPDDR4=y +CONFIG_RAM_ROCKCHIP_LPDDR4=y CONFIG_BAUDRATE=1500000 CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYSRESET=y
configs/khadas-edge-v-rk3399_defconfig +1 -1
@@ -53,7 +53,7 @@ CONFIG_PMIC_RK8XX=y CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y -CONFIG_RAM_RK3399_LPDDR4=y +CONFIG_RAM_ROCKCHIP_LPDDR4=y CONFIG_BAUDRATE=1500000 CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYSRESET=y
configs/leez-rk3399_defconfig +1 -1
@@ -48,7 +48,7 @@ CONFIG_PMIC_RK8XX=y CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y -CONFIG_RAM_RK3399_LPDDR4=y +CONFIG_RAM_ROCKCHIP_LPDDR4=y CONFIG_BAUDRATE=1500000 CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYSRESET=y
configs/nanopi-r4s-rk3399_defconfig +1 -1
@@ -49,7 +49,7 @@ CONFIG_PMIC_RK8XX=y CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y -CONFIG_RAM_RK3399_LPDDR4=y +CONFIG_RAM_ROCKCHIP_LPDDR4=y CONFIG_BAUDRATE=1500000 CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYSRESET=y
configs/pinebook-pro-rk3399_defconfig +1 -1
@@ -74,7 +74,7 @@ CONFIG_PMIC_RK8XX=y CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y -CONFIG_RAM_RK3399_LPDDR4=y +CONFIG_RAM_ROCKCHIP_LPDDR4=y CONFIG_DM_RESET=y CONFIG_DM_RNG=y CONFIG_RNG_ROCKCHIP=y
configs/roc-pc-mezzanine-rk3399_defconfig +1 -1
@@ -67,7 +67,7 @@ CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y # CONFIG_RAM_ROCKCHIP_DEBUG is not set -CONFIG_RAM_RK3399_LPDDR4=y +CONFIG_RAM_ROCKCHIP_LPDDR4=y CONFIG_DM_RESET=y CONFIG_BAUDRATE=1500000 CONFIG_DEBUG_UART_SHIFT=2
configs/roc-pc-rk3399_defconfig +1 -1
@@ -64,7 +64,7 @@ CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y # CONFIG_RAM_ROCKCHIP_DEBUG is not set -CONFIG_RAM_RK3399_LPDDR4=y +CONFIG_RAM_ROCKCHIP_LPDDR4=y CONFIG_DM_RESET=y CONFIG_BAUDRATE=1500000 CONFIG_DEBUG_UART_SHIFT=2
configs/rock-pi-4-rk3399_defconfig +1 -1
@@ -58,7 +58,7 @@ CONFIG_PMIC_RK8XX=y CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y -CONFIG_RAM_RK3399_LPDDR4=y +CONFIG_RAM_ROCKCHIP_LPDDR4=y CONFIG_DM_RESET=y CONFIG_BAUDRATE=1500000 CONFIG_DEBUG_UART_SHIFT=2
configs/rock-pi-4c-rk3399_defconfig +1 -1
@@ -58,7 +58,7 @@ CONFIG_PMIC_RK8XX=y CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y -CONFIG_RAM_RK3399_LPDDR4=y +CONFIG_RAM_ROCKCHIP_LPDDR4=y CONFIG_DM_RESET=y CONFIG_BAUDRATE=1500000 CONFIG_DEBUG_UART_SHIFT=2
configs/rockpro64-rk3399_defconfig +1 -1
@@ -71,7 +71,7 @@ CONFIG_PMIC_RK8XX=y CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y -CONFIG_RAM_RK3399_LPDDR4=y +CONFIG_RAM_ROCKCHIP_LPDDR4=y CONFIG_DM_RESET=y CONFIG_DM_RNG=y CONFIG_RNG_ROCKCHIP=y
drivers/ram/rockchip/Kconfig +15 -17
@@ -11,9 +11,10 @@ config ROCKCHIP_SDRAM_COMMON help This enable sdram common driver +if RAM_ROCKCHIP + config RAM_ROCKCHIP_DEBUG bool "Rockchip ram drivers debugging" - depends on RAM_ROCKCHIP default y help This enables debugging ram driver API's for the platforms
@@ -22,31 +23,28 @@ config RAM_ROCKCHIP_DEBUG This is an option for developers to understand the ram drivers initialization, configurations and etc. -config RAM_PX30_DDR4 - bool "DDR4 support for Rockchip PX30" - depends on RAM_ROCKCHIP && ROCKCHIP_PX30 +config RAM_ROCKCHIP_DDR4 + bool "DDR4 support for Rockchip SoCs" help This enables DDR4 sdram support instead of the default DDR3 support - on Rockchip PC30 SoCs. + on Rockchip SoCs. -config RAM_PX30_LPDDR2 - bool "LPDDR2 support for Rockchip PX30" - depends on RAM_ROCKCHIP && ROCKCHIP_PX30 +config RAM_ROCKCHIP_LPDDR2 + bool "LPDDR2 support for Rockchip SoCs" help This enables LPDDR2 sdram support instead of the default DDR3 support - on Rockchip PC30 SoCs. + on Rockchip SoCs. -config RAM_PX30_LPDDR3 - bool "LPDDR3 support for Rockchip PX30" - depends on RAM_ROCKCHIP && ROCKCHIP_PX30 +config RAM_ROCKCHIP_LPDDR3 + bool "LPDDR3 support for Rockchip SoCs" help This enables LPDDR3 sdram support instead of the default DDR3 support - on Rockchip PC30 SoCs. + on Rockchip SoCs. -config RAM_RK3399_LPDDR4 - bool "LPDDR4 support for Rockchip RK3399" - depends on RAM_ROCKCHIP && ROCKCHIP_RK3399 +config RAM_ROCKCHIP_LPDDR4 + bool "LPDDR4 support for Rockchip SoCs" help This enables LPDDR4 sdram code support for the platforms based - on Rockchip RK3399 SoC. + on Rockchip SoCs. +endif # RAM_ROCKCHIP
drivers/ram/rockchip/sdram_px30.c +3 -3
@@ -125,11 +125,11 @@ u32 addrmap[][8] = {struct dram_info dram_info; struct px30_sdram_params sdram_configs[] = { -#if defined(CONFIG_RAM_PX30_DDR4 ) +#if defined(CONFIG_RAM_ROCKCHIP_DDR4 )#include "sdram-px30-ddr4-detect-333.inc" -#elif defined(CONFIG_RAM_PX30_LPDDR2 ) +#elif defined(CONFIG_RAM_ROCKCHIP_LPDDR2 )#include "sdram-px30-lpddr2-detect-333.inc" -#elif defined(CONFIG_RAM_PX30_LPDDR3 ) +#elif defined(CONFIG_RAM_ROCKCHIP_LPDDR3 )#include "sdram-px30-lpddr3-detect-333.inc" #else #include "sdram-px30-ddr3-detect-333.inc"
drivers/ram/rockchip/sdram_rk3399.c +3 -4
@@ -1625,7 +1625,7 @@ static void set_ddr_stride(struct rk3399_pmusgrf_regs *pmusgrf, u32 stride)rk_clrsetreg (&pmusgrf->soc_con4,0x1f <<10 , stride <<10 ); } -#if !defined(CONFIG_RAM_RK3399_LPDDR4 ) +#if !defined(CONFIG_RAM_ROCKCHIP_LPDDR4 )static int data_training_first (struct dram_info *dram,u32 channel,u8 rank,struct rk3399_sdram_params *params) {
@@ -2558,8 +2558,7 @@ static int lpddr4_set_rate(struct dram_info *dram, return 0; } - -#endif /* CONFIG_RAM_RK3399_LPDDR4 */ +#endif /* CONFIG_RAM_ROCKCHIP_LPDDR4 */ /* CS0,n=1 * CS1,n=2
@@ -3059,7 +3058,7 @@ static int conv_of_plat(struct udevice *dev)#endif static const struct sdram_rk3399_ops rk3399_ops = { -#if !defined(CONFIG_RAM_RK3399_LPDDR4) +#if !defined(CONFIG_RAM_ROCKCHIP_LPDDR4) .data_training_first = data_training_first, .set_rate_index = switch_to_phy_index1, .modify_param = modify_param,
Signature · 1 line
2.25.1
PATCH v4 3/25 ram: rockchip: Compute ddr capacity based on grf split
In reply to Jagan TekiDDR chip capacity is computed based on GRF split in some Rockchip SoC's like PX30 and RV1126.
Add split argument in ddr print info so-that the respective ddr driver will pass the grf split.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
arch/arm/include/asm/arch-rockchip/sdram_common.h | 2 +- drivers/ram/rockchip/sdram_common.c | 6 ++++-- drivers/ram/rockchip/sdram_px30.c | 2 +- drivers/ram/rockchip/sdram_rk3328.c | 2 +- drivers/ram/rockchip/sdram_rk3399.c | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-)
arch/arm/include/asm/arch-rockchip/sdram_common.h +1 -1
@@ -116,7 +116,7 @@ struct sdram_base_params {void sdram_print_dram_type (unsigned char dramtype);void sdram_print_ddr_info (struct sdram_cap_info *cap_info, -struct sdram_base_params *base); +struct sdram_base_params *base,u32 split);void sdram_print_stride (unsigned int stride); void sdram_org_config(struct sdram_cap_info *cap_info,
drivers/ram/rockchip/sdram_common.c +4 -2
@@ -36,7 +36,7 @@ void sdram_print_dram_type(unsigned char dramtype) }void sdram_print_ddr_info (struct sdram_cap_info *cap_info, -struct sdram_base_params *base) +struct sdram_base_params *base,u32 split) {u64 cap;u32 bg;
@@ -83,6 +83,8 @@ void sdram_print_ddr_info(struct sdram_cap_info *cap_info, cap =sdram_get_cs_cap (cap_info,3 , base->dramtype);if (cap_info->row_3_4) cap = cap *3 /4 ; +else if (split) + cap = cap /2 + (split <<24 ) /2 ;printascii (" Size=" );printdec (cap >>20 );
@@ -123,7 +125,7 @@ inline void sdram_print_dram_type(unsigned char dramtype) }inline void sdram_print_ddr_info (struct sdram_cap_info *cap_info, -struct sdram_base_params *base) +struct sdram_base_params *base,u32 split) { }
drivers/ram/rockchip/sdram_px30.c +1 -1
@@ -711,7 +711,7 @@ int sdram_init(void)if (ret) goto error; -sdram_print_ddr_info (&sdram_params->ch.cap_info, &sdram_params->base); +sdram_print_ddr_info (&sdram_params->ch.cap_info, &sdram_params->base,0 );printascii ("out\n" );return ret;
drivers/ram/rockchip/sdram_rk3328.c +1 -1
@@ -506,7 +506,7 @@ static int sdram_init_detect(struct dram_info *dram,writel (sys_reg3, &dram->grf->os_reg[3 ]); } -sdram_print_ddr_info (&sdram_params->ch.cap_info, &sdram_params->base); +sdram_print_ddr_info (&sdram_params->ch.cap_info, &sdram_params->base,0 );return 0 ; }
drivers/ram/rockchip/sdram_rk3399.c +1 -1
@@ -2986,7 +2986,7 @@ static int sdram_init(struct dram_info *dram,continue ; } -sdram_print_ddr_info (cap_info, ¶ms->base); +sdram_print_ddr_info (cap_info, ¶ms->base,0 );set_memory_map (chan, channel, params); cap_info->ddrconfig =calculate_ddrconfig (params, channel);
Signature · 1 line
2.25.1
PATCH v4 4/25 ram: rockchip: Update ddr pctl regs for px30
In reply to Jagan TekiAdd full ddr pctl registers and bit masks for px30.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
.../asm/arch-rockchip/sdram_pctl_px30.h | 100 +++++++++++++++++- drivers/ram/rockchip/sdram_pctl_px30.c | 6 +- 2 files changed, 101 insertions(+), 5 deletions(-)
arch/arm/include/asm/arch-rockchip/sdram_pctl_px30.h +98 -2
@@ -12,7 +12,7 @@#endif struct ddr_pctl_regs { -u32 pctl[30 ][2 ]; +u32 pctl[35 ][2 ]; };/* ddr pctl registers define */
@@ -25,6 +25,7 @@ struct ddr_pctl_regs {#define DDR_PCTL2_MRCTRL2 0x1c#define DDR_PCTL2_DERATEEN 0x20#define DDR_PCTL2_DERATEINT 0x24 +#define DDR_PCTL2_MSTR2 0x28#define DDR_PCTL2_PWRCTL 0x30#define DDR_PCTL2_PWRTMG 0x34#define DDR_PCTL2_HWLPCTL 0x38
@@ -122,8 +123,103 @@ struct ddr_pctl_regs {#define DDR_PCTL2_PCFGW_n 0x408#define DDR_PCTL2_PCTRL_n 0x490 +#define UMCTL2_REGS_FREQ (n) \ + ((0x1000 * (n) + (((n) > 0) ? 0x1000 : 0))) + +/* PCTL2_MSTR */ +#define PCTL2_FREQUENCY_MODE_MASK (1) +#define PCTL2_FREQUENCY_MODE_SHIFT (29) +#define PCTL2_DLL_OFF_MODE BIT(15) +/* PCTL2_STAT */ +#define PCTL2_SELFREF_TYPE_MASK (3 << 4) +#define PCTL2_SELFREF_TYPE_SR_NOT_AUTO (2 << 4) +#define PCTL2_OPERATING_MODE_MASK (7) +#define PCTL2_OPERATING_MODE_INIT (0) +#define PCTL2_OPERATING_MODE_NORMAL (1) +#define PCTL2_OPERATING_MODE_PD (2) +#define PCTL2_OPERATING_MODE_SR (3) +/* PCTL2_MRCTRL0 */ +#define PCTL2_MR_WR BIT(31) +#define PCTL2_MR_ADDR_SHIFT (12) +#define PCTL2_MR_RANK_SHIFT (4) +#define PCTL2_MR_TYPE_WR (0) +#define PCTL2_MR_TYPE_RD (1) +/* PCTL2_MRCTRL1 */ +#define PCTL2_MR_ADDRESS_SHIFT (8) +#define PCTL2_MR_DATA_MASK (0xff)/* PCTL2_MRSTAT */ -#define MR_WR_BUSY BIT(0) +#define PCTL2_MR_WR_BUSY BIT(0) +/* PCTL2_DERATEEN */ +#define PCTL2_DERATE_ENABLE (1) +/* PCTL2_PWRCTL */ +#define PCTL2_SELFREF_SW BIT(5) +#define PCTL2_POWERDOWN_EN BIT(1) +#define PCTL2_SELFREF_EN (1) +/* PCTL2_PWRTMG */ +#define PCTL2_SELFREF_TO_X32_MASK (0xFF) +#define PCTL2_SELFREF_TO_X32_SHIFT (16) +#define PCTL2_POWERDOWN_TO_X32_MASK (0x1F) +/* PCTL2_INIT3 */ +#define PCTL2_DDR34_MR0_SHIFT (16) +#define PCTL2_LPDDR234_MR1_SHIFT (16) +#define PCTL2_DDR34_MR1_SHIFT (0) +#define PCTL2_LPDDR234_MR2_SHIFT (0) +/* PCTL2_INIT4 */ +#define PCTL2_DDR34_MR2_SHIFT (16) +#define PCTL2_LPDDR234_MR3_SHIFT (16) +#define PCTL2_DDR34_MR3_SHIFT (0) +#define PCTL2_LPDDR4_MR13_SHIFT (0) + +/* PCTL2_INIT6 */ +#define PCTL2_DDR4_MR4_SHIFT (16) +#define PCTL2_LPDDR4_MR11_SHIFT (16) +#define PCTL2_DDR4_MR5_SHIFT (0) +#define PCTL2_LPDDR4_MR12_SHIFT (0) + +/* PCTL2_INIT7 */ +#define PCTL2_LPDDR4_MR22_SHIFT (16) +#define PCTL2_DDR4_MR6_SHIFT (0) +#define PCTL2_LPDDR4_MR14_SHIFT (0) + +#define PCTL2_MR_MASK (0xffff) + +/* PCTL2_RFSHCTL3 */ +#define PCTL2_DIS_AUTO_REFRESH (1) +/* PCTL2_ZQCTL0 */ +#define PCTL2_DIS_AUTO_ZQ BIT(31) +#define PCTL2_DIS_SRX_ZQCL BIT(30) +/* PCTL2_DFILPCFG0 */ +#define PCTL2_DFI_LP_EN_SR BIT(8) +#define PCTL2_DFI_LP_EN_SR_MASK BIT(8) +#define PCTL2_DFI_LP_EN_SR_SHIFT (8) +/* PCTL2_DFIMISC */ +#define PCTL2_DFI_INIT_COMPLETE_EN (1) +/* PCTL2_DFISTAT */ +#define PCTL2_DFI_LP_ACK BIT(1) +#define PCTL2_DFI_INIT_COMPLETE (1) +/* PCTL2_DBG1 */ +#define PCTL2_DIS_HIF BIT(1) +/* PCTL2_DBGCAM */ +#define PCTL2_DBG_WR_Q_EMPTY BIT(26) +#define PCTL2_DBG_RD_Q_EMPTY BIT(25) +#define PCTL2_DBG_LPR_Q_DEPTH_MASK (0xffff << 8) +#define PCTL2_DBG_LPR_Q_DEPTH_EMPTY (0x0 << 8) +/* PCTL2_DBGCMD */ +#define PCTL2_RANK1_REFRESH BIT(1) +#define PCTL2_RANK0_REFRESH (1) +/* PCTL2_DBGSTAT */ +#define PCTL2_RANK1_REFRESH_BUSY BIT(1) +#define PCTL2_RANK0_REFRESH_BUSY (1) +/* PCTL2_SWCTL */ +#define PCTL2_SW_DONE (1) +#define PCTL2_SW_DONE_CLEAR (0) +/* PCTL2_SWSTAT */ +#define PCTL2_SW_DONE_ACK (1) +/* PCTL2_PSTAT */ +#define PCTL2_WR_PORT_BUSY_0 BIT(16) +#define PCTL2_RD_PORT_BUSY_0 (1) +/* PCTL2_PCTRLn */ +#define PCTL2_PORT_EN (1)void pctl_read_mr (void __iomem *pctl_base,u32 rank,u32 mr_num); int pctl_write_mr(void __iomem *pctl_base, u32 rank, u32 mr_num, u32 arg,
drivers/ram/rockchip/sdram_pctl_px30.c +3 -3
@@ -21,7 +21,7 @@ void pctl_read_mr(void __iomem *pctl_base, u32 rank, u32 mr_num)setbits_le32 (pctl_base +DDR_PCTL2_MRCTRL0 ,1u <<31 );while (readl (pctl_base +DDR_PCTL2_MRCTRL0 ) & (1u <<31 ))continue ; -while (readl (pctl_base +DDR_PCTL2_MRSTAT ) &MR_WR_BUSY ) +while (readl (pctl_base +DDR_PCTL2_MRSTAT ) &PCTL2_MR_WR_BUSY )continue ; }
@@ -33,7 +33,7 @@ void pctl_read_mr(void __iomem *pctl_base, u32 rank, u32 mr_num)int pctl_write_mr (void __iomem *pctl_base,u32 rank,u32 mr_num,u32 arg,u32 dramtype) { -while (readl (pctl_base +DDR_PCTL2_MRSTAT ) &MR_WR_BUSY ) +while (readl (pctl_base +DDR_PCTL2_MRSTAT ) &PCTL2_MR_WR_BUSY )continue ;if (dramtype ==DDR3 || dramtype ==DDR4 ) { writel((mr_num << 12) | (rank << 4) | (0 << 0),
@@ -49,7 +49,7 @@ int pctl_write_mr(void __iomem *pctl_base, u32 rank, u32 mr_num, u32 arg,setbits_le32 (pctl_base +DDR_PCTL2_MRCTRL0 ,1u <<31 );while (readl (pctl_base +DDR_PCTL2_MRCTRL0 ) & (1u <<31 ))continue ; -while (readl (pctl_base +DDR_PCTL2_MRSTAT ) &MR_WR_BUSY ) +while (readl (pctl_base +DDR_PCTL2_MRSTAT ) &PCTL2_MR_WR_BUSY )continue ;return 0 ;
Signature · 1 line
2.25.1
PATCH v4 5/25 ram: rockchip: Add rv1126 ddr3 support
In reply to Jagan TekiAdd DDR3 detection timings for Rockchip RV1126 SoC.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
.../sdram-rv1126-ddr3-detect-1056.inc | 72 +++++++++++++++++++ .../rockchip/sdram-rv1126-ddr3-detect-328.inc | 72 +++++++++++++++++++ .../rockchip/sdram-rv1126-ddr3-detect-396.inc | 72 +++++++++++++++++++ .../rockchip/sdram-rv1126-ddr3-detect-528.inc | 72 +++++++++++++++++++ .../rockchip/sdram-rv1126-ddr3-detect-664.inc | 72 +++++++++++++++++++ .../rockchip/sdram-rv1126-ddr3-detect-784.inc | 72 +++++++++++++++++++ .../rockchip/sdram-rv1126-ddr3-detect-924.inc | 72 +++++++++++++++++++ 7 files changed, 504 insertions(+) create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-1056.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-328.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-396.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-528.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-664.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-784.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-ddr3-detect-924.inc
drivers/ram/rockchip/sdram-rv1126-ddr3-detect-1056.inc new file +72 -0
@@ -0,0 +1,72 @@ +{ + { + { + .rank = 0x1, + .col = 0xC, + .bk = 0x3, + .bw = 0x0, + .dbw = 0x0, + .row_3_4 = 0x0, + .cs0_row = 0x10, + .cs1_row = 0x10, + .cs0_high16bit_row = 0x10, + .cs1_high16bit_row = 0x10, + .ddrconfig = 0 + }, + { + {0x351b1019}, + {0x12030903}, + {0x00000002}, + {0x00001111}, + {0x0000000c}, + {0x00000000}, + 0x000000ff + } + }, + { + .ddr_freq = 1056, /* clock rate(MHz) */ + .dramtype = DDR3, + .num_channels = 1, + .stride = 0, + .odt = 1 + }, + { + { + {0x00000000, 0x43042001}, /* MSTR */ + {0x00000064, 0x008000b9}, /* RFSHTMG */ + {0x000000d0, 0x00020103}, /* INIT0 */ + {0x000000d4, 0x00690000}, /* INIT1 */ + {0x000000d8, 0x00000100}, /* INIT2 */ + {0x000000dc, 0x01240040}, /* INIT3 */ + {0x000000e0, 0x00280000}, /* INIT4 */ + {0x000000e4, 0x000c0000}, /* INIT5 */ + {0x000000f4, 0x000f011f}, /* RANKCTL */ + {0x00000100, 0x0f132414}, /* DRAMTMG0 */ + {0x00000104, 0x000d0419}, /* DRAMTMG1 */ + {0x00000108, 0x0507050b}, /* DRAMTMG2 */ + {0x0000010c, 0x00202008}, /* DRAMTMG3 */ + {0x00000110, 0x07020408}, /* DRAMTMG4 */ + {0x00000114, 0x06060404}, /* DRAMTMG5 */ + {0x00000120, 0x00000907}, /* DRAMTMG8 */ + {0x00000180, 0x00a9002b}, /* ZQCTL0 */ + {0x00000184, 0x00000000}, /* ZQCTL1 */ + {0x00000190, 0x07050003}, /* DFITMG0 */ + {0x00000198, 0x07000101}, /* DFILPCFG0 */ + {0x000001a0, 0xc0400003}, /* DFIUPD0 */ + {0x00000240, 0x06000610}, /* ODTCFG */ + {0x00000244, 0x00000201}, /* ODTMAP */ + {0x00000250, 0x00001f00}, /* SCHED */ + {0x00000490, 0x00000001}, /* PCTRL_0 */ + {0xffffffff, 0xffffffff} + } + }, + { + { + {0x00000004, 0x0000008a}, /* PHYREG01 */ + {0x00000014, 0x0000000e}, /* PHYREG05 */ + {0x00000018, 0x00000000}, /* PHYREG06 */ + {0x0000001c, 0x0000000a}, /* PHYREG07 */ + {0xffffffff, 0xffffffff} + } + } +},
drivers/ram/rockchip/sdram-rv1126-ddr3-detect-328.inc new file +72 -0
72 lines not on this page · raw message
drivers/ram/rockchip/sdram-rv1126-ddr3-detect-396.inc new file +72 -0
72 lines not on this page · raw message
drivers/ram/rockchip/sdram-rv1126-ddr3-detect-528.inc new file +72 -0
72 lines not on this page · raw message
drivers/ram/rockchip/sdram-rv1126-ddr3-detect-664.inc new file +72 -0
72 lines not on this page · raw message
drivers/ram/rockchip/sdram-rv1126-ddr3-detect-784.inc new file +72 -0
72 lines not on this page · raw message
drivers/ram/rockchip/sdram-rv1126-ddr3-detect-924.inc new file +72 -0
72 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v4 6/25 ram: rockchip: Add rv1126 ddr loader params
In reply to Jagan TekiAdd DDR loader parameters for Rockchip RV1126 SoC.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
.../rockchip/sdram-rv1126-loader_params.inc | 197 ++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 drivers/ram/rockchip/sdram-rv1126-loader_params.inc
drivers/ram/rockchip/sdram-rv1126-loader_params.inc new file +197 -0
@@ -0,0 +1,197 @@ +0x12345678, +2,/* version */ +(0 << 0) | (1 << 8) | (9 << 16) | (8 << 24),/* cpu_gen,global index */ +(0 << 0) | (9 << 8) | (17 << 16) | (9 << 24),/* d2,d3 index */ +(26 << 0) | (9 << 8) | (0 << 16) | (0 << 24),/* d4,d5 index */ +(0 << 0) | (9 << 8) | (35 << 16) | (9 << 24),/* lp2,lp3 index */ +(44 << 0) | (13 << 8) | (0 << 16) | (0 << 24),/* lp4,lp5 index */ +(0 << 0) | (0 << 8) | (57 << 16) | (8 << 24),/* skew index, dq_map index */ +(65 << 0) | (13 << 8) | (0 << 16) | (0 << 24), /*lp4x index*/ +/* global info */ +0, +(93 << 16) | 13,/* sr_idle << 16 | pd_idle */ +0,/* channel info */ +1,/* 2t info */ +0, 0, 0, 0,/* reserved */ + +/* ddr3 */ +(924 << DDR_FREQ_F0_SHIFT) | (328 << DDR_FREQ_F1_SHIFT), +(528 << DDR_FREQ_F2_SHIFT) | (784 << DDR_FREQ_F3_SHIFT), +(0 << DDR_FREQ_F4_SHIFT) | (0 << DDR_FREQ_F5_SHIFT), +/* drv when odt on */ +(30 << PHY_DQ_DRV_SHIFT) | (41 << PHY_CA_DRV_SHIFT) | + (38 << PHY_CLK_DRV_SHIFT) | (34 << DRAM_DQ_DRV_SHIFT), +/* drv when odt off */ +(30 << PHY_DQ_DRV_SHIFT) | (30 << PHY_CA_DRV_SHIFT) | + (38 << PHY_CLK_DRV_SHIFT) | (34 << DRAM_DQ_DRV_SHIFT), +/* odt info */ +(120 << DRAM_ODT_SHIFT) | (141 << PHY_ODT_SHIFT) | + (1 << PHY_ODT_PUUP_EN_SHIFT) | + (0 << PHY_ODT_PUDN_EN_SHIFT), +/* odt enable freq */ +(333 << DRAM_ODT_EN_FREQ_SHIFT) | (333 << PHY_ODT_EN_FREQ_SHIFT), +/* slew rate when odt enable */ +(0x1f << PHY_DQ_SR_SHIFT) | (0x1f << PHY_CA_SR_SHIFT) | + (0x1f << PHY_CLK_SR_SHIFT), +/* slew ratee when odt disable */ +(0x1f << PHY_DQ_SR_SHIFT) | (0x1f << PHY_CA_SR_SHIFT) | + (0x1f << PHY_CLK_SR_SHIFT), + +/* ddr4 */ +(924 << DDR_FREQ_F0_SHIFT) | (328 << DDR_FREQ_F1_SHIFT), +(528 << DDR_FREQ_F2_SHIFT) | (784 << DDR_FREQ_F3_SHIFT), +(0 << DDR_FREQ_F4_SHIFT) | (0 << DDR_FREQ_F5_SHIFT), +/* drv when odt on */ +(37 << PHY_DQ_DRV_SHIFT) | (44 << PHY_CA_DRV_SHIFT) | + (37 << PHY_CLK_DRV_SHIFT) | (34 << DRAM_DQ_DRV_SHIFT), +/* drv when odt off */ +(37 << PHY_DQ_DRV_SHIFT) | (44 << PHY_CA_DRV_SHIFT) | + (37 << PHY_CLK_DRV_SHIFT) | (34 << DRAM_DQ_DRV_SHIFT), +/* odt info */ +(120 << DRAM_ODT_SHIFT) | (148 << PHY_ODT_SHIFT) | + (1 << PHY_ODT_PUUP_EN_SHIFT) | (1 << PHY_ODT_PUDN_EN_SHIFT), +/* odt enable freq */ +(625 << DRAM_ODT_EN_FREQ_SHIFT) | (625 << PHY_ODT_EN_FREQ_SHIFT), +/* slew rate when odt enable */ +(0xe << PHY_DQ_SR_SHIFT) | (0x3 << PHY_CA_SR_SHIFT) | + (0x3 << PHY_CLK_SR_SHIFT), +/* slew ratee when odt disable */ +(0xe << PHY_DQ_SR_SHIFT) | (0x3 << PHY_CA_SR_SHIFT) | + (0x3 << PHY_CLK_SR_SHIFT), + +/* lpddr3 */ +(924 << DDR_FREQ_F0_SHIFT) | (328 << DDR_FREQ_F1_SHIFT), +(528 << DDR_FREQ_F2_SHIFT) | (784 << DDR_FREQ_F3_SHIFT), +(0 << DDR_FREQ_F4_SHIFT) | (0 << DDR_FREQ_F5_SHIFT), +/* drv when odt on */ +(28 << PHY_DQ_DRV_SHIFT) | (37 << PHY_CA_DRV_SHIFT) | + (34 << PHY_CLK_DRV_SHIFT) | (34 << DRAM_DQ_DRV_SHIFT), +/* drv when odt off */ +(28 << PHY_DQ_DRV_SHIFT) | (37 << PHY_CA_DRV_SHIFT) | + (34 << PHY_CLK_DRV_SHIFT) | (34 << DRAM_DQ_DRV_SHIFT), +/* odt info */ +(120 << DRAM_ODT_SHIFT) | (148 << PHY_ODT_SHIFT) | + (1 << PHY_ODT_PUUP_EN_SHIFT) | (1 << PHY_ODT_PUDN_EN_SHIFT), +/* odt enable freq */ +(333 << DRAM_ODT_EN_FREQ_SHIFT) | (333 << PHY_ODT_EN_FREQ_SHIFT), + +/* slew rate when odt enable */ +(0xe << PHY_DQ_SR_SHIFT) | (0x0 << PHY_CA_SR_SHIFT) | + (0x0 << PHY_CLK_SR_SHIFT), +/* slew ratee when odt disable */ +(0xe << PHY_DQ_SR_SHIFT) | (0x0 << PHY_CA_SR_SHIFT) | + (0x0 << PHY_CLK_SR_SHIFT), + +/* lpddr4 */ +(924 << DDR_FREQ_F0_SHIFT) | (328 << DDR_FREQ_F1_SHIFT), +(528 << DDR_FREQ_F2_SHIFT) | (784 << DDR_FREQ_F3_SHIFT), +(0 << DDR_FREQ_F4_SHIFT) | (0 << DDR_FREQ_F5_SHIFT), + +/* drv when odt on */ +(38 << PHY_DQ_DRV_SHIFT) | (46 << PHY_CA_DRV_SHIFT) | + (38 << PHY_CLK_DRV_SHIFT) | (40 << DRAM_DQ_DRV_SHIFT), +/* drv when odt off */ +(38 << PHY_DQ_DRV_SHIFT) | (46 << PHY_CA_DRV_SHIFT) | + (38 << PHY_CLK_DRV_SHIFT) | (40 << DRAM_DQ_DRV_SHIFT), +/* odt info and PU-cal info */ +(240 << DRAM_ODT_SHIFT) | (80 << PHY_ODT_SHIFT) | + (0 << LP4_CA_ODT_SHIFT) | + (LPDDR4_VDDQ_2_5 << LP4_DRV_PU_CAL_ODTEN_SHIFT) | + (LPDDR4_VDDQ_2_5 << LP4_DRV_PU_CAL_ODTOFF_SHIFT) | + (0 << PHY_LP4_DRV_PULLDOWN_EN_ODTEN_SHIFT) | + (0 << PHY_LP4_DRV_PULLDOWN_EN_ODTOFF_SHIFT), +/* odt enable freq */ +(333 << PHY_LP4_ODT_EN_FREQ_SHIFT) | (333 << LP4_DQ_ODT_EN_FREQ_SHIFT), +/* slew rate when odt enable */ +(0xf << PHY_DQ_SR_SHIFT) | (0xf << PHY_CA_SR_SHIFT) | + (0xf << PHY_CLK_SR_SHIFT), +/* slew ratee when odt disable */ +(0xf << PHY_DQ_SR_SHIFT) | (0xf << PHY_CA_SR_SHIFT) | + (0xf << PHY_CLK_SR_SHIFT), +/* ca odt en freq */ +(333 << LP4_CA_ODT_EN_FREQ_SHIFT), +/* cs drv info and ca odt info */ +(0 << PHY_LP4_CS_DRV_ODTEN_SHIFT) | + (0 << PHY_LP4_CS_DRV_ODTOFF_SHIFT) | + (0 << LP4_ODTE_CK_SHIFT) | (0 << LP4_ODTE_CS_EN_SHIFT) | + (0 << LP4_ODTD_CA_EN_SHIFT), +/* vref info when odt enable */ +(200 << PHY_LP4_DQ_VREF_SHIFT) | (420 << LP4_DQ_VREF_SHIFT) | + (420 << LP4_CA_VREF_SHIFT), +/* vref info when odt disable */ +(420 << PHY_LP4_DQ_VREF_SHIFT) | (420 << LP4_DQ_VREF_SHIFT) | + (420 << LP4_CA_VREF_SHIFT), +/* ddr4 map << 0 | ddr3 map << 24 */ +((0x2 << 6) | (0x1 << 4) | (0x3 << 2) | (0x0 << 0)) | + (0 << 8) | (0 << 16) | + (((0x2 << 6) | (0x1 << 4) | (0x3 << 2) | (0x0 << 0)) << 24), +/* lp3 map << 16 | lp4 map << 24 */ +/* lp4 should equal to 0xc9 */ +(((0x3 << 6) | (0x2 << 4) | (0x1 << 2) | (0x0 << 0)) << 16) | + (((0x3 << 6) | (0x0 << 4) | (0x2 << 2) | (0x1 << 0)) << 24), +/* lp3 dq0-7 map */ +(2 << 0) | (6 << 4) | (4 << 8) | (0 << 12) | (3 << 16) | (7 << 20) | + ( 5 << 24) | (1 << 28), +/* lp2 dq0-7 map */ +0, +/* ddr4 dq map */ +/* cs0 dq0-15 */ + ((2 << 0 | 0 << 2 | 3 << 4 | 1 << 6) << 0) | + ((0 << 0 | 2 << 2 | 3 << 4 | 1 << 6) << 8) | + ((2 << 0 | 2 << 2 | 1 << 4 | 3 << 6) << 16) | + ((1 << 0 | 3 << 2 | 0 << 4 | 0 << 6) << 24), +/* cs0 dq16-31 */ + ((2 << 0 | 0 << 2 | 2 << 4 | 0 << 6) << 0) | + ((1 << 0 | 3 << 2 | 3 << 4 | 1 << 6) << 8) | + ((0 << 0 | 0 << 2 | 1 << 4 | 3 << 6) << 16) | + ((1 << 0 | 3 << 2 | 2 << 4 | 2 << 6) << 24), +/* cs1 dq0-15 */ + ((2 << 0 | 0 << 2 | 3 << 4 | 1 << 6) << 0) | + ((0 << 0 | 2 << 2 | 3 << 4 | 1 << 6) << 8) | + ((2 << 0 | 2 << 2 | 1 << 4 | 3 << 6) << 16) | + ((1 << 0 | 3 << 2 | 0 << 4 | 0 << 6) << 24), +/* cs1 dq16-31 */ + ((2 << 0 | 0 << 2 | 2 << 4 | 0 << 6) << 0) | + ((1 << 0 | 3 << 2 | 3 << 4 | 1 << 6) << 8) | + ((0 << 0 | 0 << 2 | 1 << 4 | 3 << 6) << 16) | + ((1 << 0 | 3 << 2 | 2 << 4 | 2 << 6) << 24), + +/* lpddr4x */ +(1056 << DDR_FREQ_F0_SHIFT) | (328 << DDR_FREQ_F1_SHIFT), +(528 << DDR_FREQ_F2_SHIFT) | (784 << DDR_FREQ_F3_SHIFT), +(0 << DDR_FREQ_F4_SHIFT) | (0 << DDR_FREQ_F5_SHIFT), + +/* drv when odt on */ +(38 << PHY_DQ_DRV_SHIFT) | (38 << PHY_CA_DRV_SHIFT) | + (38 << PHY_CLK_DRV_SHIFT) | (40 << DRAM_DQ_DRV_SHIFT), +/* drv when odt off */ +(38 << PHY_DQ_DRV_SHIFT) | (38 << PHY_CA_DRV_SHIFT) | + (38 << PHY_CLK_DRV_SHIFT) | (40 << DRAM_DQ_DRV_SHIFT), +/* odt info and PU-cal info */ +(48 << DRAM_ODT_SHIFT) | (60 << PHY_ODT_SHIFT) | + (120 << LP4_CA_ODT_SHIFT) | + (LPDDR4X_VDDQ_0_6 << LP4_DRV_PU_CAL_ODTEN_SHIFT) | + (LPDDR4X_VDDQ_0_6 << LP4_DRV_PU_CAL_ODTOFF_SHIFT) | + (0 << PHY_LP4_DRV_PULLDOWN_EN_ODTEN_SHIFT) | + (0 << PHY_LP4_DRV_PULLDOWN_EN_ODTOFF_SHIFT), +/* odt enable freq */ +(0 << PHY_LP4_ODT_EN_FREQ_SHIFT) | (0 << LP4_DQ_ODT_EN_FREQ_SHIFT), +/* slew rate when odt enable */ +(0xf << PHY_DQ_SR_SHIFT) | (0xf << PHY_CA_SR_SHIFT) | + (0xf << PHY_CLK_SR_SHIFT), +/* slew ratee when odt disable */ +(0xf << PHY_DQ_SR_SHIFT) | (0xf << PHY_CA_SR_SHIFT) | + (0xf << PHY_CLK_SR_SHIFT), +/* ca odt en freq */ +(333 << LP4_CA_ODT_EN_FREQ_SHIFT), +/* cs drv info and ca odt info */ +(0 << PHY_LP4_CS_DRV_ODTEN_SHIFT) | + (0 << PHY_LP4_CS_DRV_ODTOFF_SHIFT) | + (0 << LP4_ODTE_CK_SHIFT) | (0 << LP4_ODTE_CS_EN_SHIFT) | + (0 << LP4_ODTD_CA_EN_SHIFT), +/* vref info when odt enable, phy vddq=1.1V, lp4x vddq=0.6V */ +(153 << PHY_LP4_DQ_VREF_SHIFT) | (515 << LP4_DQ_VREF_SHIFT) | + (629 << LP4_CA_VREF_SHIFT), +/* vref info when odt disable */ +(153 << PHY_LP4_DQ_VREF_SHIFT) | (629 << LP4_DQ_VREF_SHIFT) | + (629 << LP4_CA_VREF_SHIFT),
Signature · 1 line
2.25.1
PATCH v4 7/25 ram: rockchip: Add rv1126 ddr driver support
In reply to Jagan TekiAdd DDR driver for Rockchip RV1126 SoC.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
.../asm/arch-rockchip/dram_spec_timing.h | 452 +++ .../include/asm/arch-rockchip/sdram_common.h | 212 + .../include/asm/arch-rockchip/sdram_msch.h | 12 + .../asm/arch-rockchip/sdram_phy_rv1126.h | 93 + .../include/asm/arch-rockchip/sdram_rv1126.h | 420 ++ drivers/ram/rockchip/Makefile | 1 + drivers/ram/rockchip/sdram_rv1126.c | 3521 +++++++++++++++++ 7 files changed, 4711 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/dram_spec_timing.h create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_phy_rv1126.h create mode 100644 arch/arm/include/asm/arch-rockchip/sdram_rv1126.h create mode 100644 drivers/ram/rockchip/sdram_rv1126.c
arch/arm/include/asm/arch-rockchip/dram_spec_timing.h new file +452 -0
@@ -0,0 +1,452 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2020 Rockchip Electronics Co., Ltd +*/ + +#ifndef __ROCKCHIP_DRAM_SPEC_TIMING_H__ +#define __ROCKCHIP_DRAM_SPEC_TIMING_H__ + +enum ddr3_speed_rate { +/* 5-5-5 */ +DDR3_800D =0 , +/* 6-6-6 */ +DDR3_800E =1 , +/* 6-6-6 */ +DDR3_1066E =2 , +/* 7-7-7 */ +DDR3_1066F =3 , +/* 8-8-8 */ +DDR3_1066G =4 , +/* 7-7-7 */ +DDR3_1333F =5 , +/* 8-8-8 */ +DDR3_1333G =6 , +/* 9-9-9 */ +DDR3_1333H =7 , +/* 10-10-10 */ +DDR3_1333J =8 , +/* 8-8-8 */ +DDR3_1600G =9 , +/* 9-9-9 */ +DDR3_1600H =10 , +/* 10-10-10 */ +DDR3_1600J =11 , +/* 11-11-11 */ +DDR3_1600K =12 , +/* 10-10-10 */ +DDR3_1866J =13 , +/* 11-11-11 */ +DDR3_1866K =14 , +/* 12-12-12 */ +DDR3_1866L =15 , +/* 13-13-13 */ +DDR3_1866M =16 , +/* 11-11-11 */ +DDR3_2133K =17 , +/* 12-12-12 */ +DDR3_2133L =18 , +/* 13-13-13 */ +DDR3_2133M =19 , +/* 14-14-14 */ +DDR3_2133N =20 , +DDR3_DEFAULT =21 , +}; + +enum ddr4_speed_rate { +/* DDR4_1600J (10-10-10) */ +DDR4_1600J =0 , +/* DDR4_1600K (11-11-11) */ +DDR4_1600K =1 , +/* DDR4_1600L (12-12-12) */ +DDR4_1600L =2 , +/* DDR4_1800L (12-12-12) */ +DDR4_1866L =3 , +/* DDR4_1800M (13-13-13) */ +DDR4_1866M =4 , +/* DDR4_1800N (14-14-14) */ +DDR4_1866N =5 , +/* DDR4_2133N (14-14-14) */ +DDR4_2133N =6 , +/* DDR4_2133P (15-15-15) */ +DDR4_2133P =7 , +/* DDR4_2133R (16-16-16) */ +DDR4_2133R =8 , +/* DDR4_2400P (15-15-15) */ +DDR4_2400P =9 , +/* DDR4_2400R (16-16-16) */ +DDR4_2400R =10 , +/* DDR4_2400U (18-18-18) */ +DDR4_2400U =11 , +/* DEFAULT */ +DDR4_DEFAULT =12 , +}; + +/* mr0 for ddr3 */ +#define DDR3_BL8 (0) +#define DDR3_BC4_8 (1) +#define DDR3_BC4 (2) +#define DDR3_CL (n) (((((n) - 4) & 0x7) << 4)\ + | ((((n) - 4) & 0x8) >> 1)) +#define DDR3_WR (n) (((n) & 0x7) << 9) +#define DDR3_DLL_RESET (1 << 8) +#define DDR3_DLL_DERESET (0 << 8) + +/* mr1 for ddr3 */ +#define DDR3_DLL_ENABLE (0) +#define DDR3_DLL_DISABLE (1) +#define DDR3_MR1_AL (n) (((n) & 0x3) << 3) + +#define DDR3_DS_40 (0) +#define DDR3_DS_34 BIT(1) +#define DDR3_DS_MASK ((1 << 1) | (1 << 5)) +#define DDR3_RTT_NOM_MASK ((1 << 2) | (1 << 6) | (1 << 9)) +#define DDR3_RTT_NOM_DIS (0) +#define DDR3_RTT_NOM_60 BIT(2) +#define DDR3_RTT_NOM_120 BIT(6) +#define DDR3_RTT_NOM_40 ((1 << 2) | (1 << 6)) +#define DDR3_TDQS BIT(11) + +/* mr2 for ddr3 */ +#define DDR3_MR2_CWL (n) ((((n) - 5) & 0x7) << 3) +#define DDR3_RTT_WR_DIS (0) +#define DDR3_RTT_WR_60 (1 << 9) +#define DDR3_RTT_WR_120 (2 << 9) + +/* +* MR0 (Device Information) +* 0:DAI complete, 1:DAI still in progress +*/ +#define LPDDR2_DAI (0x1) +/* 0:S2 or S4 SDRAM, 1:NVM */ +#define LPDDR2_DI (0x1 << 1) +/* 0:DNV not supported, 1:DNV supported */ +#define LPDDR2_DNVI (0x1 << 2) +#define LPDDR2_RZQI (0x3 << 3) + +/* +* 00:RZQ self test not supported, +* 01:ZQ-pin may connect to VDDCA or float +* 10:ZQ-pin may short to GND. +* 11:ZQ-pin self test completed, no error condition detected. +*/ + +/* MR1 (Device Feature) */ +#define LPDDR2_BL4 (0x2) +#define LPDDR2_BL8 (0x3) +#define LPDDR2_BL16 (0x4) +#define LPDDR2_N_WR (n) (((n) - 2) << 5) + +/* MR2 (Device Feature 2) */ +#define LPDDR2_RL3_WL1 (0x1) +#define LPDDR2_RL4_WL2 (0x2) +#define LPDDR2_RL5_WL2 (0x3) +#define LPDDR2_RL6_WL3 (0x4) +#define LPDDR2_RL7_WL4 (0x5) +#define LPDDR2_RL8_WL4 (0x6) + +/* MR3 (IO Configuration 1) */ +#define LPDDR2_DS_34 (0x1) +#define LPDDR2_DS_40 (0x2) +#define LPDDR2_DS_48 (0x3) +#define LPDDR2_DS_60 (0x4) +#define LPDDR2_DS_80 (0x6) +/* optional */ +#define LPDDR2_DS_120 (0x7) + +/* MR4 (Device Temperature) */ +#define LPDDR2_TREF_MASK (0x7) +#define LPDDR2_4_TREF (0x1) +#define LPDDR2_2_TREF (0x2) +#define LPDDR2_1_TREF (0x3) +#define LPDDR2_025_TREF (0x5) +#define LPDDR2_025_TREF_DERATE (0x6) + +#define LPDDR2_TUF (0x1 << 7) + +/* MR8 (Basic configuration 4) */ +#define LPDDR2_S4 (0x0) +#define LPDDR2_S2 (0x1) +#define LPDDR2_N (0x2) +/* Unit:MB */ +#define LPDDR2_DENSITY (mr8) (8 << (((mr8) >> 2) & 0xf)) +#define LPDDR2_IO_WIDTH (mr8) (32 >> (((mr8) >> 6) & 0x3)) + +/* MR10 (Calibration) */ +#define LPDDR2_ZQINIT (0xff) +#define LPDDR2_ZQCL (0xab) +#define LPDDR2_ZQCS (0x56) +#define LPDDR2_ZQRESET (0xc3) + +/* MR16 (PASR Bank Mask), S2 SDRAM Only */ +#define LPDDR2_PASR_FULL (0x0) +#define LPDDR2_PASR_1_2 (0x1) +#define LPDDR2_PASR_1_4 (0x2) +#define LPDDR2_PASR_1_8 (0x3) + +/* +* MR0 (Device Information) +* 0:DAI complete, +* 1:DAI still in progress +*/ +#define LPDDR3_DAI (0x1) +/* +* 00:RZQ self test not supported, +* 01:ZQ-pin may connect to VDDCA or float +* 10:ZQ-pin may short to GND. +* 11:ZQ-pin self test completed, no error condition detected. +*/ +#define LPDDR3_RZQI (0x3 << 3) +/* +* 0:DRAM does not support WL(Set B), +* 1:DRAM support WL(Set B) +*/ +#define LPDDR3_WL_SUPOT BIT(6) +/* +* 0:DRAM does not support RL=3,nWR=3,WL=1; +* 1:DRAM supports RL=3,nWR=3,WL=1 for frequencies <=166 +*/ +#define LPDDR3_RL3_SUPOT BIT(7) + +/* MR1 (Device Feature) */ +#define LPDDR3_BL8 (0x3) +#define LPDDR3_N_WR (n) ((n) << 5) + +/* MR2 (Device Feature 2), WL Set A,default */ +/* <=166MHz,optional*/ +#define LPDDR3_RL3_WL1 (0x1) +/* <=400MHz*/ +#define LPDDR3_RL6_WL3 (0x4) +/* <=533MHz*/ +#define LPDDR3_RL8_WL4 (0x6) +/* <=600MHz*/ +#define LPDDR3_RL9_WL5 (0x7) +/* <=667MHz,default*/ +#define LPDDR3_RL10_WL6 (0x8) +/* <=733MHz*/ +#define LPDDR3_RL11_WL6 (0x9) +/* <=800MHz*/ +#define LPDDR3_RL12_WL6 (0xa) +/* <=933MHz*/ +#define LPDDR3_RL14_WL8 (0xc) +/* <=1066MHz*/ +#define LPDDR3_RL16_WL8 (0xe) + +/* WL Set B, optional */ +/* <=667MHz,default*/ +#define LPDDR3_RL10_WL8 (0x8) +/* <=733MHz*/ +#define LPDDR3_RL11_WL9 (0x9) +/* <=800MHz*/ +#define LPDDR3_RL12_WL9 (0xa) +/* <=933MHz*/ +#define LPDDR3_RL14_WL11 (0xc) +/* <=1066MHz*/ +#define LPDDR3_RL16_WL13 (0xe) + +/* 1:enable nWR programming > 9(default)*/ +#define LPDDR3_N_WRE BIT(4) +/* 1:Select WL Set B*/ +#define LPDDR3_WL_S BIT(6) +/* 1:enable*/ +#define LPDDR3_WR_LEVEL BIT(7) + +/* MR3 (IO Configuration 1) */ +#define LPDDR3_DS_34 (0x1) +#define LPDDR3_DS_40 (0x2) +#define LPDDR3_DS_48 (0x3) +#define LPDDR3_DS_60 (0x4) +#define LPDDR3_DS_80 (0x6) +#define LPDDR3_DS_34D_40U (0x9) +#define LPDDR3_DS_40D_48U (0xa) +#define LPDDR3_DS_34D_48U (0xb) + +/* MR4 (Device Temperature) */ +#define LPDDR3_TREF_MASK (0x7) +/* SDRAM Low temperature operating limit exceeded */ +#define LPDDR3_LT_EXED (0x0) +#define LPDDR3_4_TREF (0x1) +#define LPDDR3_2_TREF (0x2) +#define LPDDR3_1_TREF (0x3) +#define LPDDR3_05_TREF (0x4) +#define LPDDR3_025_TREF (0x5) +#define LPDDR3_025_TREF_DERATE (0x6) +/* SDRAM High temperature operating limit exceeded */ +#define LPDDR3_HT_EXED (0x7) + +/* 1:value has changed since last read of MR4 */ +#define LPDDR3_TUF (0x1 << 7) + +/* MR8 (Basic configuration 4) */ +#define LPDDR3_S8 (0x3) +#define LPDDR3_DENSITY (mr8) (8 << (((mr8) >> 2) & 0xf)) +#define LPDDR3_IO_WIDTH (mr8) (32 >> (((mr8) >> 6) & 0x3)) + +/* MR10 (Calibration) */ +#define LPDDR3_ZQINIT (0xff) +#define LPDDR3_ZQCL (0xab) +#define LPDDR3_ZQCS (0x56) +#define LPDDR3_ZQRESET (0xc3) + +/* MR11 (ODT Control) */ +#define LPDDR3_ODT_60 (1) +#define LPDDR3_ODT_120 (2) +#define LPDDR3_ODT_240 (3) +#define LPDDR3_ODT_DIS (0) + +/* MR2 (Device Feature 2) */ +/* RL & nRTP for DBI-RD Disabled */ +#define LPDDR4_RL6_NRTP8 (0x0) +#define LPDDR4_RL10_NRTP8 (0x1) +#define LPDDR4_RL14_NRTP8 (0x2) +#define LPDDR4_RL20_NRTP8 (0x3) +#define LPDDR4_RL24_NRTP10 (0x4) +#define LPDDR4_RL28_NRTP12 (0x5) +#define LPDDR4_RL32_NRTP14 (0x6) +#define LPDDR4_RL36_NRTP16 (0x7) +/* RL & nRTP for DBI-RD Disabled */ +#define LPDDR4_RL12_NRTP8 (0x1) +#define LPDDR4_RL16_NRTP8 (0x2) +#define LPDDR4_RL22_NRTP8 (0x3) +#define LPDDR4_RL28_NRTP10 (0x4) +#define LPDDR4_RL32_NRTP12 (0x5) +#define LPDDR4_RL36_NRTP14 (0x6) +#define LPDDR4_RL40_NRTP16 (0x7) +/* WL Set A,default */ +#define LPDDR4_A_WL4 (0x0 << 3) +#define LPDDR4_A_WL6 (0x1 << 3) +#define LPDDR4_A_WL8 (0x2 << 3) +#define LPDDR4_A_WL10 (0x3 << 3) +#define LPDDR4_A_WL12 (0x4 << 3) +#define LPDDR4_A_WL14 (0x5 << 3) +#define LPDDR4_A_WL16 (0x6 << 3) +#define LPDDR4_A_WL18 (0x7 << 3) +/* WL Set B, optional */ +#define LPDDR4_B_WL4 (0x0 << 3) +#define LPDDR4_B_WL8 (0x1 << 3) +#define LPDDR4_B_WL12 (0x2 << 3) +#define LPDDR4_B_WL18 (0x3 << 3) +#define LPDDR4_B_WL22 (0x4 << 3) +#define LPDDR4_B_WL26 (0x5 << 3) +#define LPDDR4_B_WL30 (0x6 << 3) +#define LPDDR4_B_WL34 (0x7 << 3) +/* 1:Select WL Set B*/ +#define LPDDR4_WL_B BIT(6) +/* 1:enable*/ +#define LPDDR4_WR_LEVEL BIT(7) + +/* MR3 */ +#define LPDDR4_VDDQ_2_5 (0) +#define LPDDR4_VDDQ_3 (1) +#define LPDDR4_PU_CAL_MASK (1) +#define LPDDR4_WRPST_0_5_TCK (0 << 1) +#define LPDDR4_WRPST_1_5_TCK (1 << 1) +#define LPDDR4_PPR_EN (1 << 2) +/* PDDS */ +#define LPDDR4_PDDS_MASK (0x7 << 3) +#define LPDDR4_PDDS_SHIFT (3) +#define LPDDR4_PDDS_240 (0x1 << 3) +#define LPDDR4_PDDS_120 (0x2 << 3) +#define LPDDR4_PDDS_80 (0x3 << 3) +#define LPDDR4_PDDS_60 (0x4 << 3) +#define LPDDR4_PDDS_48 (0x5 << 3) +#define LPDDR4_PDDS_40 (0x6 << 3) +#define LPDDR4_DBI_RD_EN BIT(6) +#define LPDDR4_DBI_WR_EN BIT(7) + +/* MR11 (ODT Control) */ +#define LPDDR4_DQODT_MASK (0x7) +#define LPDDR4_DQODT_SHIFT (0x0) +#define LPDDR4_DQODT_240 (1) +#define LPDDR4_DQODT_120 (2) +#define LPDDR4_DQODT_80 (3) +#define LPDDR4_DQODT_60 (4) +#define LPDDR4_DQODT_48 (5) +#define LPDDR4_DQODT_40 (6) +#define LPDDR4_DQODT_DIS (0) +#define LPDDR4_CAODT_MASK (0x7 << 4) +#define LPDDR4_CAODT_SHIFT (4) +#define LPDDR4_CAODT_240 (1 << 4) +#define LPDDR4_CAODT_120 (2 << 4) +#define LPDDR4_CAODT_80 (3 << 4) +#define LPDDR4_CAODT_60 (4 << 4) +#define LPDDR4_CAODT_48 (5 << 4) +#define LPDDR4_CAODT_40 (6 << 4) +#define LPDDR4_CAODT_DIS (0 << 4) + +/* MR22 */ +#define LPDDR4_ODTE_CK_SHIFT (3) +#define LPDDR4_ODTE_CS_SHIFT (4) +#define LPDDR4_ODTD_CA_SHIFT (5) +#define LPDDR4_SOC_ODT_MASK (0x7) +#define LPDDR4_SOC_ODT_SHIFT (0) +#define LPDDR4_SOC_ODT_240 (1) +#define LPDDR4_SOC_ODT_120 (2) +#define LPDDR4_SOC_ODT_80 (3) +#define LPDDR4_SOC_ODT_60 (4) +#define LPDDR4_SOC_ODT_48 (5) +#define LPDDR4_SOC_ODT_40 (6) +#define LPDDR4_SOC_ODT_DIS (0) + +/* LPDDR4x */ +/* MR3 */ +#define LPDDR4X_VDDQ_0_6 (0) +#define LPDDR4X_VDDQ_0_5 (1) + +/* mr0 for ddr4 */ +#define DDR4_BL8 (0) +#define DDR4_BC4_8 (1) +#define DDR4_BC4 (2) +#define DDR4_WR_RTP (n) ((n) << 9) +#define DDR4_CL (n) ((((n) & 0xe) << 3) | ((n) & 1) << 2) +#define DDR4_DLL_RESET (n) ((n) << 8) +#define DDR4_DLL_ON BIT(0) +#define DDR4_DLL_OFF (0 << 0) + +/* mr1 for ddr4 */ +#define DDR4_AL ((n) << 3) +#define DDR4_DS_34 (0) +#define DDR4_DS_48 BIT(1) +#define DDR4_DS_MASK (0x3 << 1) +#define DDR4_RTT_NOM_MASK (0x7 << 8) +#define DDR4_RTT_NOM_DIS (0) +#define DDR4_RTT_NOM_60 BIT(8) +#define DDR4_RTT_NOM_120 (2 << 8) +#define DDR4_RTT_NOM_40 (0x3 << 8) +#define DDR4_RTT_NOM_240 (0x4 << 8) +#define DDR4_RTT_NOM_48 (0x5 << 8) +#define DDR4_RTT_NOM_80 (0x6 << 8) +#define DDR4_RTT_NOM_34 (0x7 << 8) + +/* mr2 for ddr4 */ +#define DDR4_MR2_CWL (n) ((n) << 3) +#define DDR4_RTT_WR_DIS (0) +#define DDR4_RTT_WR_120 BIT(9) +#define DDR4_RTT_WR_240 (2 << 9) + +/* mr4 for ddr4 */ +#define DDR4_READ_PREAMBLE (n) ((n) << 11) +#define DDR4_WRITE_PREAMBLE (n) ((n) << 12) +#define DDR4_READ_PREAMBLE_TRAIN (n) ((n) << 10) + +/* mr5 for ddr4 */ +#define DDR4_RD_DBI (n) ((n) << 12) +#define DDR4_WR_DBI (n) ((n) << 11) +#define DDR4_DM (n) ((n) << 10) +#define DDR4_RTT_PARK_DIS (0 << 6) +#define DDR4_RTT_PARK_60 (1 << 6) +#define DDR4_RTT_PARK_120 (2 << 6) +#define DDR4_RTT_PARK_40 (3 << 6) +#define DDR4_RTT_PARK_240 (4 << 6) +#define DDR4_RTT_PARK_48 (5 << 6) +#define DDR4_RTT_PARK_80 (6 << 6) +#define DDR4_RTT_PARK_34 (7 << 6) +#define DIS_ODT_PD (1 << 5) +#define EN_ODT_PD (0 << 5) + +/* mr6 for ddr4 */ +#define DDR4_TCCD_L (n) (((n) - 4) << 10) + +#define PS_2_CLK (freq, ps) (((uint64_t)(ps) / 100 * (uint64_t)(freq) +\ + 9999) / 10000) + +#endif /* __ROCKCHIP_DRAM_SPEC_TIMING_H__ */
arch/arm/include/asm/arch-rockchip/sdram_common.h +212 -0
224 lines not on this page · raw message
arch/arm/include/asm/arch-rockchip/sdram_msch.h +12 -0
@@ -57,6 +57,18 @@ union noc_devtodev0 { } b; }; +union noc_devtodev_rv1126 { +u32 d32; +struct { +unsigned busrdtord :3 ; +unsigned reserved0 :1 ; +unsigned busrdtowr :4 ; +unsigned buswrtord :4 ; +unsigned buswrtowr :3 ; +unsigned reserved2 :17 ; + } b; +}; +union noc_ddrmode {u32 d32;struct {
arch/arm/include/asm/arch-rockchip/sdram_phy_rv1126.h new file +93 -0
93 lines not on this page · raw message
arch/arm/include/asm/arch-rockchip/sdram_rv1126.h new file +420 -0
420 lines not on this page · raw message
drivers/ram/rockchip/Makefile +1 -0
@@ -14,4 +14,5 @@ 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_RV1126) += sdram_rv1126.o sdram_pctl_px30.o obj-$(CONFIG_ROCKCHIP_SDRAM_COMMON) += sdram_common.o
drivers/ram/rockchip/sdram_rv1126.c new file +3521 -0
1,788 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.25.1
Part of the diff is not shown here. View the raw message.
PATCH v4 8/25 ram: rockchip: rv1126: Control ddr init prints via DEBUG
In reply to Jagan TekiControl the ddr init print messages via RAM_ROCKCHIP_DEBUG instead of printing by default.
This gives an option to configs to enable these prints or not.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
drivers/ram/rockchip/sdram_rv1126.c | 38 +++++++++++++++++++---------- 1 file changed, 25 insertions(+), 13 deletions(-)
drivers/ram/rockchip/sdram_rv1126.c +25 -13
@@ -3358,22 +3358,33 @@ static void ddr_set_rate_for_fsp(struct dram_info *dram,if (get_wrlvl_val (dram, sdram_params))printascii ("get wrlvl value fail\n" ); -printascii ("change to: " ); -printdec (f1); -printascii ("MHz\n" ); +if (IS_ENABLED (CONFIG_RAM_ROCKCHIP_DEBUG )) { +printascii ("change to: " ); +printdec (f1); +printascii ("MHz\n" ); + }ddr_set_rate (&dram_info, sdram_params, f1, sdram_params->base.ddr_freq,1 ,1 ,1 ); -printascii ("change to: " ); -printdec (f2); -printascii ("MHz\n" ); + +if (IS_ENABLED (CONFIG_RAM_ROCKCHIP_DEBUG )) { +printascii ("change to: " ); +printdec (f2); +printascii ("MHz\n" ); + }ddr_set_rate (&dram_info, sdram_params, f2, f1,2 ,0 ,1 ); -printascii ("change to: " ); -printdec (f3); -printascii ("MHz\n" ); + +if (IS_ENABLED (CONFIG_RAM_ROCKCHIP_DEBUG )) { +printascii ("change to: " ); +printdec (f3); +printascii ("MHz\n" ); + }ddr_set_rate (&dram_info, sdram_params, f3, f2,3 ,1 ,1 ); -printascii ("change to: " ); -printdec (f0); -printascii ("MHz(final freq)\n" ); + +if (IS_ENABLED (CONFIG_RAM_ROCKCHIP_DEBUG )) { +printascii ("change to: " ); +printdec (f0); +printascii ("MHz(final freq)\n" ); + }ddr_set_rate (&dram_info, sdram_params, f0, f3,0 ,0 ,1 ); }
@@ -3465,7 +3476,8 @@ static int rv1126_dmc_init(struct udevice *dev)save_rw_trn_result_to_ddr (&rw_trn_result);#endif -printascii ("out\n" ); +if (IS_ENABLED (CONFIG_RAM_ROCKCHIP_DEBUG )) +printascii ("out\n" );return ret; error:
Signature · 1 line
2.25.1
PATCH v4 9/25 ram: rockchip: Add rv1126 lpddr4 support
In reply to Jagan TekiAdd LPDDR4 detection timings and support for RV1126.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
.../sdram-rv1126-lpddr4-detect-1056.inc | 78 +++++++++++++++++++ .../sdram-rv1126-lpddr4-detect-328.inc | 78 +++++++++++++++++++ .../sdram-rv1126-lpddr4-detect-396.inc | 78 +++++++++++++++++++ .../sdram-rv1126-lpddr4-detect-528.inc | 78 +++++++++++++++++++ .../sdram-rv1126-lpddr4-detect-664.inc | 78 +++++++++++++++++++ .../sdram-rv1126-lpddr4-detect-784.inc | 78 +++++++++++++++++++ .../sdram-rv1126-lpddr4-detect-924.inc | 78 +++++++++++++++++++ drivers/ram/rockchip/sdram_rv1126.c | 10 +++ 8 files changed, 556 insertions(+) create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-1056.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-328.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-396.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-528.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-664.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-784.inc create mode 100644 drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-924.inc
drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-1056.inc new file +78 -0
@@ -0,0 +1,78 @@ +{ + { + { + .rank = 0x1, + .col = 0xB, + .bk = 0x3, + .bw = 0x1, + .dbw = 0x1, + .row_3_4 = 0x0, + .cs0_row = 0x11, + .cs1_row = 0x11, + .cs0_high16bit_row = 0x0, + .cs1_high16bit_row = 0x0, + .ddrconfig = 0 + }, + { + {0x41241522}, + {0x15050b07}, + {0x00000602}, + {0x00001111}, + {0x00000054}, + {0x00000000}, + 0x000000ff + } + }, + { + .ddr_freq = 1056, /* clock rate(MHz) */ + .dramtype = LPDDR4, + .num_channels = 1, + .stride = 0, + .odt = 1 + }, + { + { + {0x00000000, 0x81081020}, /* MSTR */ + {0x00000064, 0x00400094}, /* RFSHTMG */ + {0x000000d0, 0x00030409}, /* INIT0 */ + {0x000000d4, 0x00690000}, /* INIT1 */ + {0x000000d8, 0x00000206}, /* INIT2 */ + {0x000000dc, 0x0034001b}, /* INIT3 */ + {0x000000e0, 0x00310000}, /* INIT4 */ + {0x000000e8, 0x00110000}, /* INIT6 */ + {0x000000ec, 0x00000000}, /* INIT7 */ + {0x000000f4, 0x000f033f}, /* RANKCTL */ + {0x00000100, 0x14161217}, /* DRAMTMG0 */ + {0x00000104, 0x00040422}, /* DRAMTMG1 */ + {0x00000108, 0x050a0e0f}, /* DRAMTMG2 */ + {0x0000010c, 0x00808000}, /* DRAMTMG3 */ + {0x00000110, 0x0a04060c}, /* DRAMTMG4 */ + {0x00000114, 0x02040808}, /* DRAMTMG5 */ + {0x00000118, 0x01010005}, /* DRAMTMG6 */ + {0x0000011c, 0x00000401}, /* DRAMTMG7 */ + {0x00000120, 0x00000606}, /* DRAMTMG8 */ + {0x00000130, 0x00020000}, /* DRAMTMG12 */ + {0x00000134, 0x0a100002}, /* DRAMTMG13 */ + {0x00000138, 0x00000098}, /* DRAMTMG14 */ + {0x00000180, 0x02100010}, /* ZQCTL0 */ + {0x00000184, 0x01b00000}, /* ZQCTL1 */ + {0x00000190, 0x07070001}, /* DFITMG0 */ + {0x00000198, 0x07000101}, /* DFILPCFG0 */ + {0x000001a0, 0xc0400003}, /* DFIUPD0 */ + {0x00000240, 0x0b050d3c}, /* ODTCFG */ + {0x00000244, 0x00000101}, /* ODTMAP */ + {0x00000250, 0x00001f00}, /* SCHED */ + {0x00000490, 0x00000001}, /* PCTRL_0 */ + {0xffffffff, 0xffffffff} + } + }, + { + { + {0x00000004, 0x0000008d}, /* PHYREG01 */ + {0x00000014, 0x00000014}, /* PHYREG05 */ + {0x00000018, 0x00000000}, /* PHYREG06 */ + {0x0000001c, 0x0000000a}, /* PHYREG07 */ + {0xffffffff, 0xffffffff} + } + } +},
drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-328.inc new file +78 -0
78 lines not on this page · raw message
drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-396.inc new file +78 -0
78 lines not on this page · raw message
drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-528.inc new file +78 -0
78 lines not on this page · raw message
drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-664.inc new file +78 -0
78 lines not on this page · raw message
drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-784.inc new file +78 -0
78 lines not on this page · raw message
drivers/ram/rockchip/sdram-rv1126-lpddr4-detect-924.inc new file +78 -0
78 lines not on this page · raw message
drivers/ram/rockchip/sdram_rv1126.c +10 -0
@@ -68,6 +68,15 @@ struct dram_info {struct dram_info dram_info; struct rv1126_sdram_params sdram_configs[] = { +#if defined(CONFIG_RAM_ROCKCHIP_LPDDR4 ) +# include "sdram-rv1126-lpddr4-detect-328.inc" +# include "sdram-rv1126-lpddr4-detect-396.inc" +# include "sdram-rv1126-lpddr4-detect-528.inc" +# include "sdram-rv1126-lpddr4-detect-664.inc" +# include "sdram-rv1126-lpddr4-detect-784.inc" +# include "sdram-rv1126-lpddr4-detect-924.inc" +# include "sdram-rv1126-lpddr4-detect-1056.inc" +#else # include "sdram-rv1126-ddr3-detect-328.inc" # include "sdram-rv1126-ddr3-detect-396.inc" # include "sdram-rv1126-ddr3-detect-528.inc"
@@ -75,6 +84,7 @@ struct rv1126_sdram_params sdram_configs[] = {# include "sdram-rv1126-ddr3-detect-784.inc" # include "sdram-rv1126-ddr3-detect-924.inc" # include "sdram-rv1126-ddr3-detect-1056.inc" +#endif };u32 common_info[] = {
Signature · 1 line
2.25.1
PATCH v4 10/25 pinctrl: rockchip: Add pinctrl route types
In reply to Jagan TekiSome pins in rockchip are routed via Top GRF and PMU GRF instead of direct regmap.
Add support to handle all these routing paths so that the SoC pinctrl drivers will use them accordingly.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
drivers/pinctrl/rockchip/pinctrl-px30.c | 11 +--- drivers/pinctrl/rockchip/pinctrl-rk3128.c | 11 +--- drivers/pinctrl/rockchip/pinctrl-rk322x.c | 11 +--- drivers/pinctrl/rockchip/pinctrl-rk3288.c | 11 +--- drivers/pinctrl/rockchip/pinctrl-rk3308.c | 11 +--- drivers/pinctrl/rockchip/pinctrl-rk3328.c | 11 +--- drivers/pinctrl/rockchip/pinctrl-rk3399.c | 11 +--- .../pinctrl/rockchip/pinctrl-rockchip-core.c | 45 ++++++++++++-- drivers/pinctrl/rockchip/pinctrl-rockchip.h | 58 ++++++++++++++++++- 9 files changed, 102 insertions(+), 78 deletions(-)
drivers/pinctrl/rockchip/pinctrl-px30.c +1 -10
@@ -80,7 +80,7 @@ static int px30_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)struct regmap *regmap;int reg, ret, mask, mux_type;u8 bit; -u32 data, route_reg, route_val; +u32 data; regmap = (bank->iomux[iomux_num].type &IOMUX_SOURCE_PMU ) ? priv->regmap_pmu : priv->regmap_base;
@@ -90,15 +90,6 @@ static int px30_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) reg = bank->iomux[iomux_num].offset; reg +=rockchip_get_mux_data (mux_type, pin, &bit, &mask); -if (bank->route_mask &BIT (pin)) { -if (rockchip_get_mux_route (bank, pin, mux, &route_reg, - &route_val)) { - ret =regmap_write (regmap, route_reg, route_val); -if (ret) -return ret; - } - } - data = (mask << (bit +16 )); data |= (mux & mask) << bit; ret =regmap_write (regmap, reg, data);
drivers/pinctrl/rockchip/pinctrl-rk3128.c +1 -10
@@ -106,7 +106,7 @@ static int rk3128_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)struct regmap *regmap;int reg, ret, mask, mux_type;u8 bit; -u32 data, route_reg, route_val; +u32 data; regmap = (bank->iomux[iomux_num].type &IOMUX_SOURCE_PMU ) ? priv->regmap_pmu : priv->regmap_base;
@@ -119,15 +119,6 @@ static int rk3128_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)if (bank->recalced_mask &BIT (pin))rockchip_get_recalced_mux (bank, pin, ®, &bit, &mask); -if (bank->route_mask &BIT (pin)) { -if (rockchip_get_mux_route (bank, pin, mux, &route_reg, - &route_val)) { - ret =regmap_write (regmap, route_reg, route_val); -if (ret) -return ret; - } - } - data = (mask << (bit +16 )); data |= (mux & mask) << bit; ret =regmap_write (regmap, reg, data);
drivers/pinctrl/rockchip/pinctrl-rk322x.c +1 -10
@@ -150,7 +150,7 @@ static int rk3228_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)struct regmap *regmap;int reg, ret, mask, mux_type;u8 bit; -u32 data, route_reg, route_val; +u32 data; regmap = (bank->iomux[iomux_num].type &IOMUX_SOURCE_PMU ) ? priv->regmap_pmu : priv->regmap_base;
@@ -160,15 +160,6 @@ static int rk3228_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) reg = bank->iomux[iomux_num].offset; reg +=rockchip_get_mux_data (mux_type, pin, &bit, &mask); -if (bank->route_mask &BIT (pin)) { -if (rockchip_get_mux_route (bank, pin, mux, &route_reg, - &route_val)) { - ret =regmap_write (regmap, route_reg, route_val); -if (ret) -return ret; - } - } - data = (mask << (bit +16 )); data |= (mux & mask) << bit; ret =regmap_write (regmap, reg, data);
drivers/pinctrl/rockchip/pinctrl-rk3288.c +1 -10
@@ -37,7 +37,7 @@ static int rk3288_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)struct regmap *regmap;int reg, ret, mask, mux_type;u8 bit; -u32 data, route_reg, route_val; +u32 data; regmap = (bank->iomux[iomux_num].type &IOMUX_SOURCE_PMU ) ? priv->regmap_pmu : priv->regmap_base;
@@ -47,15 +47,6 @@ static int rk3288_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) reg = bank->iomux[iomux_num].offset; reg +=rockchip_get_mux_data (mux_type, pin, &bit, &mask); -if (bank->route_mask &BIT (pin)) { -if (rockchip_get_mux_route (bank, pin, mux, &route_reg, - &route_val)) { - ret =regmap_write (regmap, route_reg, route_val); -if (ret) -return ret; - } - } -/* bank0 is special, there are no higher 16 bit writing bits. */ if (bank->bank_num ==0 ) {regmap_read (regmap, reg, &data);
drivers/pinctrl/rockchip/pinctrl-rk3308.c +1 -10
@@ -258,7 +258,7 @@ static int rk3308_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)struct regmap *regmap;int reg, ret, mask, mux_type;u8 bit; -u32 data, route_reg, route_val; +u32 data; regmap = (bank->iomux[iomux_num].type &IOMUX_SOURCE_PMU ) ? priv->regmap_pmu : priv->regmap_base;
@@ -271,15 +271,6 @@ static int rk3308_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)if (bank->recalced_mask &BIT (pin))rockchip_get_recalced_mux (bank, pin, ®, &bit, &mask); -if (bank->route_mask &BIT (pin)) { -if (rockchip_get_mux_route (bank, pin, mux, &route_reg, - &route_val)) { - ret =regmap_write (regmap, route_reg, route_val); -if (ret) -return ret; - } - } - data = (mask << (bit +16 )); data |= (mux & mask) << bit; ret =regmap_write (regmap, reg, data);
drivers/pinctrl/rockchip/pinctrl-rk3328.c +1 -10
@@ -130,7 +130,7 @@ static int rk3328_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)struct regmap *regmap;int reg, ret, mask, mux_type;u8 bit; -u32 data, route_reg, route_val; +u32 data; regmap = (bank->iomux[iomux_num].type &IOMUX_SOURCE_PMU ) ? priv->regmap_pmu : priv->regmap_base;
@@ -143,15 +143,6 @@ static int rk3328_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)if (bank->recalced_mask &BIT (pin))rockchip_get_recalced_mux (bank, pin, ®, &bit, &mask); -if (bank->route_mask &BIT (pin)) { -if (rockchip_get_mux_route (bank, pin, mux, &route_reg, - &route_val)) { - ret =regmap_write (regmap, route_reg, route_val); -if (ret) -return ret; - } - } - data = (mask << (bit +16 )); data |= (mux & mask) << bit; ret =regmap_write (regmap, reg, data);
drivers/pinctrl/rockchip/pinctrl-rk3399.c +1 -10
@@ -59,7 +59,7 @@ static int rk3399_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)struct regmap *regmap;int reg, ret, mask, mux_type;u8 bit; -u32 data, route_reg, route_val; +u32 data; regmap = (bank->iomux[iomux_num].type &IOMUX_SOURCE_PMU ) ? priv->regmap_pmu : priv->regmap_base;
@@ -69,15 +69,6 @@ static int rk3399_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) reg = bank->iomux[iomux_num].offset; reg +=rockchip_get_mux_data (mux_type, pin, &bit, &mask); -if (bank->route_mask &BIT (pin)) { -if (rockchip_get_mux_route (bank, pin, mux, &route_reg, - &route_val)) { - ret =regmap_write (regmap, route_reg, route_val); -if (ret) -return ret; - } - } - data = (mask << (bit +16 )); data |= (mux & mask) << bit; ret =regmap_write (regmap, reg, data);
drivers/pinctrl/rockchip/pinctrl-rockchip-core.c +39 -6
74 lines not on this page · raw message
drivers/pinctrl/rockchip/pinctrl-rockchip.h +56 -2
106 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v4 11/25 pinctrl: rockchip: Add rv1126 support
In reply to Jagan TekiAdd pinctrl driver for Rockchip RV1126.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
drivers/pinctrl/rockchip/Makefile | 1 + drivers/pinctrl/rockchip/pinctrl-rv1126.c | 416 ++++++++++++++++++++++ 2 files changed, 417 insertions(+) create mode 100644 drivers/pinctrl/rockchip/pinctrl-rv1126.c
drivers/pinctrl/rockchip/Makefile +1 -0
@@ -15,3 +15,4 @@ obj-$(CONFIG_ROCKCHIP_RK3328) += pinctrl-rk3328.o obj-$(CONFIG_ROCKCHIP_RK3368) += pinctrl-rk3368.o obj-$(CONFIG_ROCKCHIP_RK3399) += pinctrl-rk3399.o obj-$(CONFIG_ROCKCHIP_RV1108) += pinctrl-rv1108.o +obj-$(CONFIG_ROCKCHIP_RV1126) += pinctrl-rv1126.o
drivers/pinctrl/rockchip/pinctrl-rv1126.c new file +416 -0
416 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v4 12/25 arch: rockchip: Add cru header for rv1126
In reply to Jagan TekiAdd clock and reset unit header include for rv1126.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
.../include/asm/arch-rockchip/cru_rv1126.h | 459 ++++++++++++++++++ 1 file changed, 459 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rv1126.h
arch/arm/include/asm/arch-rockchip/cru_rv1126.h new file +459 -0
@@ -0,0 +1,459 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (c) 2019 Rockchip Electronics Co. Ltd. +* Author: Finley Xiao <[email protected]> +*/ + +#ifndef _ASM_ARCH_CRU_RV1126_H +#define _ASM_ARCH_CRU_RV1126_H + +#define MHz 1000000 +#define KHz 1000 +#define OSC_HZ (24 * MHz) + +#if defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SPL_KERNEL_BOOT ) +#define APLL_HZ (1008 * MHz) +#else +#define APLL_HZ (816 * MHz) +#endif +#define GPLL_HZ (1188 * MHz) +#define CPLL_HZ (500 * MHz) +#define HPLL_HZ (1400 * MHz) +#define PCLK_PDPMU_HZ (100 * MHz) +#if defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SPL_KERNEL_BOOT ) +#define ACLK_PDBUS_HZ (396 * MHz) +#else +#define ACLK_PDBUS_HZ (500 * MHz) +#endif +#define HCLK_PDBUS_HZ (200 * MHz) +#define PCLK_PDBUS_HZ (100 * MHz) +#define ACLK_PDPHP_HZ (300 * MHz) +#define HCLK_PDPHP_HZ (200 * MHz) +#define HCLK_PDCORE_HZ (200 * MHz) +#define HCLK_PDAUDIO_HZ (150 * MHz) +#define CLK_OSC0_DIV_HZ (32768) +#if defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SPL_KERNEL_BOOT ) +#define ACLK_PDVI_HZ (297 * MHz) +#define CLK_ISP_HZ (297 * MHz) +#define ACLK_PDISPP_HZ (297 * MHz) +#define CLK_ISPP_HZ (237 * MHz) +#define ACLK_VOP_HZ (300 * MHz) +#define DCLK_VOP_HZ (65 * MHz) +#endif + +/* RV1126 pll id */ +enum rv1126_pll_id { +APLL , +DPLL , +CPLL , +HPLL , +GPLL , +PLL_COUNT , +}; + +struct rv1126_clk_info { +unsigned long id; +char *name; +bool is_cru; +}; + +/* Private data for the clock driver - used by rockchip_get_cru() */ +struct rv1126_pmuclk_priv { +struct rv1126_pmucru *pmucru; +ulong gpll_hz; +}; + +struct rv1126_clk_priv { +struct rv1126_cru *cru; +struct rv1126_grf *grf; +ulong gpll_hz; +ulong cpll_hz; +ulong hpll_hz; +ulong armclk_hz; +ulong armclk_enter_hz; +ulong armclk_init_hz; +bool sync_kernel; +bool set_armclk_rate; +}; + +struct rv1126_pll { +unsigned int con0; +unsigned int con1; +unsigned int con2; +unsigned int con3; +unsigned int con4; +unsigned int con5; +unsigned int con6; +unsigned int reserved0[1 ]; +}; + +struct rv1126_pmucru { +unsigned int pmu_mode; +unsigned int reserved1[3 ]; +struct rv1126_pll pll; +unsigned int offsetcal_status; +unsigned int reserved2[51 ]; +unsigned int pmu_clksel_con[14 ]; +unsigned int reserved3[18 ]; +unsigned int pmu_clkgate_con[3 ]; +unsigned int reserved4[29 ]; +unsigned int pmu_softrst_con[2 ]; +unsigned int reserved5[14 ]; +unsigned int pmu_autocs_con[2 ]; +}; + +check_member (rv1126_pmucru, pmu_autocs_con[1 ],0x244 ); + +struct rv1126_cru { +struct rv1126_pll pll[4 ]; +unsigned int offsetcal_status[4 ]; +unsigned int mode; +unsigned int reserved1[27 ]; +unsigned int clksel_con[78 ]; +unsigned int reserved2[18 ]; +unsigned int clkgate_con[25 ]; +unsigned int reserved3[7 ]; +unsigned int softrst_con[15 ]; +unsigned int reserved4[17 ]; +unsigned int ssgtbl[32 ]; +unsigned int glb_cnt_th; +unsigned int glb_rst_st; +unsigned int glb_srst_fst; +unsigned int glb_srst_snd; +unsigned int glb_rst_con; +unsigned int reserved5[11 ]; +unsigned int sdmmc_con[2 ]; +unsigned int sdio_con[2 ]; +unsigned int emmc_con[2 ]; +unsigned int reserved6[2 ]; +unsigned int gmac_con; +unsigned int misc[2 ]; +unsigned int reserved7[45 ]; +unsigned int autocs_con[26 ]; +}; + +check_member (rv1126_cru, autocs_con[25 ],0x584 ); + +struct pll_rate_table { +unsigned long rate; +unsigned int fbdiv; +unsigned int postdiv1; +unsigned int refdiv; +unsigned int postdiv2; +unsigned int dsmpd; +unsigned int frac; +}; + +struct cpu_rate_table { +unsigned long rate; +unsigned int aclk_div; +unsigned int pclk_div; +}; + +#define RV1126_PMU_MODE 0x0 +#define RV1126_PMU_PLL_CON (x) ((x) * 0x4 + 0x10) +#define RV1126_PLL_CON (x) ((x) * 0x4) +#define RV1126_MODE_CON 0x90 + +enum { +/* CRU_PMU_CLK_SEL0_CON */ +RTC32K_SEL_SHIFT =7 , +RTC32K_SEL_MASK =0x3 <<RTC32K_SEL_SHIFT , +RTC32K_SEL_PMUPVTM =0 , +RTC32K_SEL_OSC1_32K , +RTC32K_SEL_OSC0_DIV32K , + +/* CRU_PMU_CLK_SEL1_CON */ +PCLK_PDPMU_DIV_SHIFT =0 , +PCLK_PDPMU_DIV_MASK =0x1f , + +/* CRU_PMU_CLK_SEL2_CON */ +CLK_I2C0_DIV_SHIFT =0 , +CLK_I2C0_DIV_MASK =0x7f , + +/* CRU_PMU_CLK_SEL3_CON */ +CLK_I2C2_DIV_SHIFT =0 , +CLK_I2C2_DIV_MASK =0x7f , + +/* CRU_PMU_CLK_SEL6_CON */ +CLK_PWM1_SEL_SHIFT =15 , +CLK_PWM1_SEL_MASK =1 <<CLK_PWM1_SEL_SHIFT , +CLK_PWM1_SEL_XIN24M =0 , +CLK_PWM1_SEL_GPLL , +CLK_PWM1_DIV_SHIFT =8 , +CLK_PWM1_DIV_MASK =0x7f <<CLK_PWM1_DIV_SHIFT , +CLK_PWM0_SEL_SHIFT =7 , +CLK_PWM0_SEL_MASK =1 <<CLK_PWM0_SEL_SHIFT , +CLK_PWM0_SEL_XIN24M =0 , +CLK_PWM0_SEL_GPLL , +CLK_PWM0_DIV_SHIFT =0 , +CLK_PWM0_DIV_MASK =0x7f , + +/* CRU_PMU_CLK_SEL9_CON */ +CLK_SPI0_SEL_SHIFT =7 , +CLK_SPI0_SEL_MASK =1 <<CLK_SPI0_SEL_SHIFT , +CLK_SPI0_SEL_GPLL =0 , +CLK_SPI0_SEL_XIN24M , +CLK_SPI0_DIV_SHIFT =0 , +CLK_SPI0_DIV_MASK =0x7f , + +/* CRU_PMU_CLK_SEL13_CON */ +CLK_RTC32K_FRAC_NUMERATOR_SHIFT =16 , +CLK_RTC32K_FRAC_NUMERATOR_MASK =0xffff <<16 , +CLK_RTC32K_FRAC_DENOMINATOR_SHIFT =0 , +CLK_RTC32K_FRAC_DENOMINATOR_MASK =0xffff , + +/* CRU_CLK_SEL0_CON */ +CORE_HCLK_DIV_SHIFT =8 , +CORE_HCLK_DIV_MASK =0x1f <<CORE_HCLK_DIV_SHIFT , + +/* CRU_CLK_SEL1_CON */ +CORE_ACLK_DIV_SHIFT =4 , +CORE_ACLK_DIV_MASK =0xf <<CORE_ACLK_DIV_SHIFT , +CORE_DBG_DIV_SHIFT =0 , +CORE_DBG_DIV_MASK =0x7 , + +/* CRU_CLK_SEL2_CON */ +HCLK_PDBUS_SEL_SHIFT =15 , +HCLK_PDBUS_SEL_MASK =1 <<HCLK_PDBUS_SEL_SHIFT , +HCLK_PDBUS_SEL_GPLL =0 , +HCLK_PDBUS_SEL_CPLL , +HCLK_PDBUS_DIV_SHIFT =8 , +HCLK_PDBUS_DIV_MASK =0x1f <<HCLK_PDBUS_DIV_SHIFT , +ACLK_PDBUS_SEL_SHIFT =6 , +ACLK_PDBUS_SEL_MASK =0x3 <<ACLK_PDBUS_SEL_SHIFT , +ACLK_PDBUS_SEL_GPLL =0 , +ACLK_PDBUS_SEL_CPLL , +ACLK_PDBUS_SEL_DPLL , +ACLK_PDBUS_DIV_SHIFT =0 , +ACLK_PDBUS_DIV_MASK =0x1f , + +/* CRU_CLK_SEL3_CON */ +CLK_SCR1_SEL_SHIFT =15 , +CLK_SCR1_SEL_MASK =1 <<CLK_SCR1_SEL_SHIFT , +CLK_SCR1_SEL_GPLL =0 , +CLK_SCR1_SEL_CPLL , +CLK_SCR1_DIV_SHIFT =8 , +CLK_SCR1_DIV_MASK =0x1f <<CLK_SCR1_DIV_SHIFT , +PCLK_PDBUS_SEL_SHIFT =7 , +PCLK_PDBUS_SEL_MASK =1 <<PCLK_PDBUS_SEL_SHIFT , +PCLK_PDBUS_SEL_GPLL =0 , +PCLK_PDBUS_SEL_CPLL , +PCLK_PDBUS_DIV_SHIFT =0 , +PCLK_PDBUS_DIV_MASK =0x1f , + +/* CRU_CLK_SEL4_CON */ +ACLK_CRYPTO_SEL_SHIFT =7 , +ACLK_CRYPTO_SEL_MASK =1 <<ACLK_CRYPTO_SEL_SHIFT , +ACLK_CRYPTO_SEL_GPLL =0 , +ACLK_CRYPTO_SEL_CPLL , +ACLK_CRYPTO_DIV_SHIFT =0 , +ACLK_CRYPTO_DIV_MASK =0x1f , + +/* CRU_CLK_SEL5_CON */ +CLK_I2C3_DIV_SHIFT =8 , +CLK_I2C3_DIV_MASK =0x7f <<CLK_I2C3_DIV_SHIFT , +CLK_I2C1_DIV_SHIFT =0 , +CLK_I2C1_DIV_MASK =0x7f , + +/* CRU_CLK_SEL6_CON */ +CLK_I2C5_DIV_SHIFT =8 , +CLK_I2C5_DIV_MASK =0x7f <<CLK_I2C5_DIV_SHIFT , +CLK_I2C4_DIV_SHIFT =0 , +CLK_I2C4_DIV_MASK =0x7f , + +/* CRU_CLK_SEL7_CON */ +CLK_CRYPTO_PKA_SEL_SHIFT =15 , +CLK_CRYPTO_PKA_SEL_MASK =1 <<CLK_CRYPTO_PKA_SEL_SHIFT , +CLK_CRYPTO_PKA_SEL_GPLL =0 , +CLK_CRYPTO_PKA_SEL_CPLL , +CLK_CRYPTO_PKA_DIV_SHIFT =8 , +CLK_CRYPTO_PKA_DIV_MASK =0x1f <<CLK_CRYPTO_PKA_DIV_SHIFT , +CLK_CRYPTO_CORE_SEL_SHIFT =7 , +CLK_CRYPTO_CORE_SEL_MASK =1 <<CLK_CRYPTO_CORE_SEL_SHIFT , +CLK_CRYPTO_CORE_SEL_GPLL =0 , +CLK_CRYPTO_CORE_SEL_CPLL , +CLK_CRYPTO_CORE_DIV_SHIFT =0 , +CLK_CRYPTO_CORE_DIV_MASK =0x1f , + +/* CRU_CLK_SEL8_CON */ +CLK_SPI1_SEL_SHIFT =8 , +CLK_SPI1_SEL_MASK =1 <<CLK_SPI1_SEL_SHIFT , +CLK_SPI1_SEL_GPLL =0 , +CLK_SPI1_SEL_XIN24M , +CLK_SPI1_DIV_SHIFT =0 , +CLK_SPI1_DIV_MASK =0x7f , + +/* CRU_CLK_SEL9_CON */ +CLK_PWM2_SEL_SHIFT =15 , +CLK_PWM2_SEL_MASK =1 <<CLK_PWM2_SEL_SHIFT , +CLK_PWM2_SEL_XIN24M =0 , +CLK_PWM2_SEL_GPLL , +CLK_PWM2_DIV_SHIFT =8 , +CLK_PWM2_DIV_MASK =0x7f <<CLK_PWM2_DIV_SHIFT , + +/* CRU_CLK_SEL20_CON */ +CLK_SARADC_DIV_SHIFT =0 , +CLK_SARADC_DIV_MASK =0x7ff , + +/* CRU_CLK_SEL25_CON */ +DCLK_DECOM_SEL_SHIFT =15 , +DCLK_DECOM_SEL_MASK =1 <<DCLK_DECOM_SEL_SHIFT , +DCLK_DECOM_SEL_GPLL =0 , +DCLK_DECOM_SEL_CPLL , +DCLK_DECOM_DIV_SHIFT =8 , +DCLK_DECOM_DIV_MASK =0x7f <<DCLK_DECOM_DIV_SHIFT , + +/* CRU_CLK_SEL26_CON */ +HCLK_PDAUDIO_DIV_SHIFT =0 , +HCLK_PDAUDIO_DIV_MASK =0x1f , + +/* CRU_CLK_SEL45_CON */ +ACLK_PDVO_SEL_SHIFT =7 , +ACLK_PDVO_SEL_MASK =1 <<ACLK_PDVO_SEL_SHIFT , +ACLK_PDVO_SEL_GPLL =0 , +ACLK_PDVO_SEL_CPLL , +ACLK_PDVO_DIV_SHIFT =0 , +ACLK_PDVO_DIV_MASK =0x1f , + +/* CRU_CLK_SEL47_CON */ +DCLK_VOP_SEL_SHIFT =8 , +DCLK_VOP_SEL_MASK =1 <<DCLK_VOP_SEL_SHIFT , +DCLK_VOP_SEL_GPLL =0 , +DCLK_VOP_SEL_CPLL , +DCLK_VOP_DIV_SHIFT =0 , +DCLK_VOP_DIV_MASK =0xff , + +#if defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SPL_KERNEL_BOOT ) +/* CRU_CLK_SEL49_CON */ +ACLK_PDVI_SEL_SHIFT =6 , +ACLK_PDVI_SEL_MASK =0x3 <<ACLK_PDVI_SEL_SHIFT , +ACLK_PDVI_SEL_CPLL =0 , +ACLK_PDVI_SEL_GPLL , +ACLK_PDVI_SEL_HPLL , +ACLK_PDVI_DIV_SHIFT =0 , +ACLK_PDVI_DIV_MASK =0x1f , + +/* CRU_CLK_SEL50_CON */ +CLK_ISP_SEL_SHIFT =6 , +CLK_ISP_SEL_MASK =0x3 <<CLK_ISP_SEL_SHIFT , +CLK_ISP_SEL_GPLL =0 , +CLK_ISP_SEL_CPLL , +CLK_ISP_SEL_HPLL , +CLK_ISP_DIV_SHIFT =0 , +CLK_ISP_DIV_MASK =0x1f , +#endif + +/* CRU_CLK_SEL53_CON */ +HCLK_PDPHP_DIV_SHIFT =8 , +HCLK_PDPHP_DIV_MASK =0x1f <<HCLK_PDPHP_DIV_SHIFT , +ACLK_PDPHP_SEL_SHIFT =7 , +ACLK_PDPHP_SEL_MASK =1 <<ACLK_PDPHP_SEL_SHIFT , +ACLK_PDPHP_SEL_GPLL =0 , +ACLK_PDPHP_SEL_CPLL , +ACLK_PDPHP_DIV_SHIFT =0 , +ACLK_PDPHP_DIV_MASK =0x1f , + +/* CRU_CLK_SEL57_CON */ +EMMC_SEL_SHIFT =14 , +EMMC_SEL_MASK =0x3 <<EMMC_SEL_SHIFT , +EMMC_SEL_GPLL =0 , +EMMC_SEL_CPLL , +EMMC_SEL_XIN24M , +EMMC_DIV_SHIFT =0 , +EMMC_DIV_MASK =0xff , + +/* CRU_CLK_SEL58_CON */ +SCLK_SFC_SEL_SHIFT =15 , +SCLK_SFC_SEL_MASK =0x1 <<SCLK_SFC_SEL_SHIFT , +SCLK_SFC_SEL_CPLL =0 , +SCLK_SFC_SEL_GPLL , +SCLK_SFC_DIV_SHIFT =0 , +SCLK_SFC_DIV_MASK =0xff , + +/* CRU_CLK_SEL59_CON */ +CLK_NANDC_SEL_SHIFT =15 , +CLK_NANDC_SEL_MASK =0x1 <<CLK_NANDC_SEL_SHIFT , +CLK_NANDC_SEL_GPLL =0 , +CLK_NANDC_SEL_CPLL , +CLK_NANDC_DIV_SHIFT =0 , +CLK_NANDC_DIV_MASK =0xff , + +/* CRU_CLK_SEL61_CON */ +CLK_GMAC_OUT_SEL_SHIFT =15 , +CLK_GMAC_OUT_SEL_MASK =0x1 <<CLK_GMAC_OUT_SEL_SHIFT , +CLK_GMAC_OUT_SEL_CPLL =0 , +CLK_GMAC_OUT_SEL_GPLL , +CLK_GMAC_OUT_DIV_SHIFT =8 , +CLK_GMAC_OUT_DIV_MASK =0x1f <<CLK_GMAC_OUT_DIV_SHIFT , + +/* CRU_CLK_SEL63_CON */ +PCLK_GMAC_DIV_SHIFT =8 , +PCLK_GMAC_DIV_MASK =0x1f <<PCLK_GMAC_DIV_SHIFT , +CLK_GMAC_SRC_SEL_SHIFT =7 , +CLK_GMAC_SRC_SEL_MASK =0x1 <<CLK_GMAC_SRC_SEL_SHIFT , +CLK_GMAC_SRC_SEL_CPLL =0 , +CLK_GMAC_SRC_SEL_GPLL , +CLK_GMAC_SRC_DIV_SHIFT =0 , +CLK_GMAC_SRC_DIV_MASK =0x1f <<CLK_GMAC_SRC_DIV_SHIFT , + +#if defined(CONFIG_SPL_BUILD ) && defined(CONFIG_SPL_KERNEL_BOOT ) +/* CRU_CLK_SEL68_CON */ +ACLK_PDISPP_SEL_SHIFT =6 , +ACLK_PDISPP_SEL_MASK =0x3 <<ACLK_PDISPP_SEL_SHIFT , +ACLK_PDISPP_SEL_CPLL =0 , +ACLK_PDISPP_SEL_GPLL , +ACLK_PDISPP_SEL_HPLL , +ACLK_PDISPP_DIV_SHIFT =0 , +ACLK_PDISPP_DIV_MASK =0x1f , + +/* CRU_CLK_SEL69_CON */ +CLK_ISPP_SEL_SHIFT =6 , +CLK_ISPP_SEL_MASK =0x3 <<CLK_ISPP_SEL_SHIFT , +CLK_ISPP_SEL_CPLL =0 , +CLK_ISPP_SEL_GPLL , +CLK_ISPP_SEL_HPLL , +CLK_ISPP_DIV_SHIFT =0 , +CLK_ISPP_DIV_MASK =0x1f , + +/* CRU_CLK_SEL73_CON */ +MIPICSI_OUT_SEL_SHIFT =10 , +MIPICSI_OUT_SEL_MASK =0x3 <<MIPICSI_OUT_SEL_SHIFT , +MIPICSI_OUT_SEL_XIN24M =0 , +MIPICSI_OUT_SEL_DIV , +MIPICSI_OUT_SEL_FRACDIV , +MIPICSI_OUT_DIV_SHIFT =0 , +MIPICSI_OUT_DIV_MASK =0x1f , +#endif + +/* CRU_GMAC_CON */ +GMAC_SRC_M1_SEL_SHIFT =5 , +GMAC_SRC_M1_SEL_MASK =0x1 <<GMAC_SRC_M1_SEL_SHIFT , +GMAC_SRC_M1_SEL_INT =0 , +GMAC_SRC_M1_SEL_EXT , +GMAC_MODE_SEL_SHIFT =4 , +GMAC_MODE_SEL_MASK =0x1 <<GMAC_MODE_SEL_SHIFT , +GMAC_RGMII_MODE =0 , +GMAC_RMII_MODE , +RGMII_CLK_SEL_SHIFT =2 , +RGMII_CLK_SEL_MASK =0x3 <<RGMII_CLK_SEL_SHIFT , +RGMII_CLK_DIV0 =0 , +RGMII_CLK_DIV1 , +RGMII_CLK_DIV50 , +RGMII_CLK_DIV5 , +RMII_CLK_SEL_SHIFT =1 , +RMII_CLK_SEL_MASK =0x1 <<RMII_CLK_SEL_SHIFT , +RMII_CLK_DIV20 =0 , +RMII_CLK_DIV2 , +GMAC_SRC_M0_SEL_SHIFT =0 , +GMAC_SRC_M0_SEL_MASK =0x1 , +GMAC_SRC_M0_SEL_INT =0 , +GMAC_SRC_M0_SEL_EXT , + +/* GRF_IOFUNC_CON1 */ +GMAC_SRC_SEL_SHIFT =12 , +GMAC_SRC_SEL_MASK =1 <<GMAC_SRC_SEL_SHIFT , +GMAC_SRC_SEL_M0 =0 , +GMAC_SRC_SEL_M1 , +}; +#endif
Signature · 1 line
2.25.1
PATCH v4 13/25 dt-bindings: clk: Add dt-binding header for RV1126
In reply to Jagan TekiAdd the dt-bindings header for the Rockchip RV1126, that gets shared between the clock controller and the clock references in the dts.
---
Changes for v4:
- sync changes from linux
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
.../dt-bindings/clock/rockchip,rv1126-cru.h | 632 ++++++++++++++++++ 1 file changed, 632 insertions(+) create mode 100644 include/dt-bindings/clock/rockchip,rv1126-cru.h
include/dt-bindings/clock/rockchip,rv1126-cru.h new file +632 -0
@@ -0,0 +1,632 @@ +/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ +/* +* Copyright (c) 2019 Rockchip Electronics Co. Ltd. +* Author: Finley Xiao <[email protected]> +*/ + +#ifndef _DT_BINDINGS_CLK_ROCKCHIP_RV1126_H +#define _DT_BINDINGS_CLK_ROCKCHIP_RV1126_H + +/* pmucru-clocks indices */ + +/* pll clocks */ +#define PLL_GPLL 1 + +/* sclk (special clocks) */ +#define CLK_OSC0_DIV32K 2 +#define CLK_RTC32K 3 +#define CLK_WIFI_DIV 4 +#define CLK_WIFI_OSC0 5 +#define CLK_WIFI 6 +#define CLK_PMU 7 +#define SCLK_UART1_DIV 8 +#define SCLK_UART1_FRACDIV 9 +#define SCLK_UART1_MUX 10 +#define SCLK_UART1 11 +#define CLK_I2C0 12 +#define CLK_I2C2 13 +#define CLK_CAPTURE_PWM0 14 +#define CLK_PWM0 15 +#define CLK_CAPTURE_PWM1 16 +#define CLK_PWM1 17 +#define CLK_SPI0 18 +#define DBCLK_GPIO0 19 +#define CLK_PMUPVTM 20 +#define CLK_CORE_PMUPVTM 21 +#define CLK_REF12M 22 +#define CLK_USBPHY_OTG_REF 23 +#define CLK_USBPHY_HOST_REF 24 +#define CLK_REF24M 25 +#define CLK_MIPIDSIPHY_REF 26 + +/* pclk */ +#define PCLK_PDPMU 30 +#define PCLK_PMU 31 +#define PCLK_UART1 32 +#define PCLK_I2C0 33 +#define PCLK_I2C2 34 +#define PCLK_PWM0 35 +#define PCLK_PWM1 36 +#define PCLK_SPI0 37 +#define PCLK_GPIO0 38 +#define PCLK_PMUSGRF 39 +#define PCLK_PMUGRF 40 +#define PCLK_PMUCRU 41 +#define PCLK_CHIPVEROTP 42 +#define PCLK_PDPMU_NIU 43 +#define PCLK_PMUPVTM 44 +#define PCLK_SCRKEYGEN 45 + +#define CLKPMU_NR_CLKS (PCLK_SCRKEYGEN + 1) + +/* cru-clocks indices */ + +/* pll clocks */ +#define PLL_APLL 1 +#define PLL_DPLL 2 +#define PLL_CPLL 3 +#define PLL_HPLL 4 + +/* sclk (special clocks) */ +#define ARMCLK 5 +#define USB480M 6 +#define CLK_CORE_CPUPVTM 7 +#define CLK_CPUPVTM 8 +#define CLK_SCR1 9 +#define CLK_SCR1_CORE 10 +#define CLK_SCR1_RTC 11 +#define CLK_SCR1_JTAG 12 +#define SCLK_UART0_DIV 13 +#define SCLK_UART0_FRAC 14 +#define SCLK_UART0_MUX 15 +#define SCLK_UART0 16 +#define SCLK_UART2_DIV 17 +#define SCLK_UART2_FRAC 18 +#define SCLK_UART2_MUX 19 +#define SCLK_UART2 20 +#define SCLK_UART3_DIV 21 +#define SCLK_UART3_FRAC 22 +#define SCLK_UART3_MUX 23 +#define SCLK_UART3 24 +#define SCLK_UART4_DIV 25 +#define SCLK_UART4_FRAC 26 +#define SCLK_UART4_MUX 27 +#define SCLK_UART4 28 +#define SCLK_UART5_DIV 29 +#define SCLK_UART5_FRAC 30 +#define SCLK_UART5_MUX 31 +#define SCLK_UART5 32 +#define CLK_I2C1 33 +#define CLK_I2C3 34 +#define CLK_I2C4 35 +#define CLK_I2C5 36 +#define CLK_SPI1 37 +#define CLK_CAPTURE_PWM2 38 +#define CLK_PWM2 39 +#define DBCLK_GPIO1 40 +#define DBCLK_GPIO2 41 +#define DBCLK_GPIO3 42 +#define DBCLK_GPIO4 43 +#define CLK_SARADC 44 +#define CLK_TIMER0 45 +#define CLK_TIMER1 46 +#define CLK_TIMER2 47 +#define CLK_TIMER3 48 +#define CLK_TIMER4 49 +#define CLK_TIMER5 50 +#define CLK_CAN 51 +#define CLK_NPU_TSADC 52 +#define CLK_NPU_TSADCPHY 53 +#define CLK_CPU_TSADC 54 +#define CLK_CPU_TSADCPHY 55 +#define CLK_CRYPTO_CORE 56 +#define CLK_CRYPTO_PKA 57 +#define MCLK_I2S0_TX_DIV 58 +#define MCLK_I2S0_TX_FRACDIV 59 +#define MCLK_I2S0_TX_MUX 60 +#define MCLK_I2S0_TX 61 +#define MCLK_I2S0_RX_DIV 62 +#define MCLK_I2S0_RX_FRACDIV 63 +#define MCLK_I2S0_RX_MUX 64 +#define MCLK_I2S0_RX 65 +#define MCLK_I2S0_TX_OUT2IO 66 +#define MCLK_I2S0_RX_OUT2IO 67 +#define MCLK_I2S1_DIV 68 +#define MCLK_I2S1_FRACDIV 69 +#define MCLK_I2S1_MUX 70 +#define MCLK_I2S1 71 +#define MCLK_I2S1_OUT2IO 72 +#define MCLK_I2S2_DIV 73 +#define MCLK_I2S2_FRACDIV 74 +#define MCLK_I2S2_MUX 75 +#define MCLK_I2S2 76 +#define MCLK_I2S2_OUT2IO 77 +#define MCLK_PDM 78 +#define SCLK_ADUPWM_DIV 79 +#define SCLK_AUDPWM_FRACDIV 80 +#define SCLK_AUDPWM_MUX 81 +#define SCLK_AUDPWM 82 +#define CLK_ACDCDIG_ADC 83 +#define CLK_ACDCDIG_DAC 84 +#define CLK_ACDCDIG_I2C 85 +#define CLK_VENC_CORE 86 +#define CLK_VDEC_CORE 87 +#define CLK_VDEC_CA 88 +#define CLK_VDEC_HEVC_CA 89 +#define CLK_RGA_CORE 90 +#define CLK_IEP_CORE 91 +#define CLK_ISP_DIV 92 +#define CLK_ISP_NP5 93 +#define CLK_ISP_NUX 94 +#define CLK_ISP 95 +#define CLK_CIF_OUT_DIV 96 +#define CLK_CIF_OUT_FRACDIV 97 +#define CLK_CIF_OUT_MUX 98 +#define CLK_CIF_OUT 99 +#define CLK_MIPICSI_OUT_DIV 100 +#define CLK_MIPICSI_OUT_FRACDIV 101 +#define CLK_MIPICSI_OUT_MUX 102 +#define CLK_MIPICSI_OUT 103 +#define CLK_ISPP_DIV 104 +#define CLK_ISPP_NP5 105 +#define CLK_ISPP_NUX 106 +#define CLK_ISPP 107 +#define CLK_SDMMC 108 +#define SCLK_SDMMC_DRV 109 +#define SCLK_SDMMC_SAMPLE 110 +#define CLK_SDIO 111 +#define SCLK_SDIO_DRV 112 +#define SCLK_SDIO_SAMPLE 113 +#define CLK_EMMC 114 +#define SCLK_EMMC_DRV 115 +#define SCLK_EMMC_SAMPLE 116 +#define CLK_NANDC 117 +#define SCLK_SFC 118 +#define CLK_USBHOST_UTMI_OHCI 119 +#define CLK_USBOTG_REF 120 +#define CLK_GMAC_DIV 121 +#define CLK_GMAC_RGMII_M0 122 +#define CLK_GMAC_SRC_M0 123 +#define CLK_GMAC_RGMII_M1 124 +#define CLK_GMAC_SRC_M1 125 +#define CLK_GMAC_SRC 126 +#define CLK_GMAC_REF 127 +#define CLK_GMAC_TX_SRC 128 +#define CLK_GMAC_TX_DIV5 129 +#define CLK_GMAC_TX_DIV50 130 +#define RGMII_MODE_CLK 131 +#define CLK_GMAC_RX_SRC 132 +#define CLK_GMAC_RX_DIV2 133 +#define CLK_GMAC_RX_DIV20 134 +#define RMII_MODE_CLK 135 +#define CLK_GMAC_TX_RX 136 +#define CLK_GMAC_PTPREF 137 +#define CLK_GMAC_ETHERNET_OUT 138 +#define CLK_DDRPHY 139 +#define CLK_DDR_MON 140 +#define TMCLK_DDR_MON 141 +#define CLK_NPU_DIV 142 +#define CLK_NPU_NP5 143 +#define CLK_CORE_NPU 144 +#define CLK_CORE_NPUPVTM 145 +#define CLK_NPUPVTM 146 +#define SCLK_DDRCLK 147 +#define CLK_OTP 148 + +/* dclk */ +#define DCLK_DECOM 150 +#define DCLK_VOP_DIV 151 +#define DCLK_VOP_FRACDIV 152 +#define DCLK_VOP_MUX 153 +#define DCLK_VOP 154 +#define DCLK_CIF 155 +#define DCLK_CIFLITE 156 + +/* aclk */ +#define ACLK_PDBUS 160 +#define ACLK_DMAC 161 +#define ACLK_DCF 162 +#define ACLK_SPINLOCK 163 +#define ACLK_DECOM 164 +#define ACLK_PDCRYPTO 165 +#define ACLK_CRYPTO 166 +#define ACLK_PDVEPU 167 +#define ACLK_VENC 168 +#define ACLK_PDVDEC 169 +#define ACLK_PDJPEG 170 +#define ACLK_VDEC 171 +#define ACLK_JPEG 172 +#define ACLK_PDVO 173 +#define ACLK_RGA 174 +#define ACLK_VOP 175 +#define ACLK_IEP 176 +#define ACLK_PDVI_DIV 177 +#define ACLK_PDVI_NP5 178 +#define ACLK_PDVI 179 +#define ACLK_ISP 180 +#define ACLK_CIF 181 +#define ACLK_CIFLITE 182 +#define ACLK_PDISPP_DIV 183 +#define ACLK_PDISPP_NP5 184 +#define ACLK_PDISPP 185 +#define ACLK_ISPP 186 +#define ACLK_PDPHP 187 +#define ACLK_PDUSB 188 +#define ACLK_USBOTG 189 +#define ACLK_PDGMAC 190 +#define ACLK_GMAC 191 +#define ACLK_PDNPU_DIV 192 +#define ACLK_PDNPU_NP5 193 +#define ACLK_PDNPU 194 +#define ACLK_NPU 195 + +/* hclk */ +#define HCLK_PDCORE_NIU 200 +#define HCLK_PDUSB 201 +#define HCLK_PDCRYPTO 202 +#define HCLK_CRYPTO 203 +#define HCLK_PDAUDIO 204 +#define HCLK_I2S0 205 +#define HCLK_I2S1 206 +#define HCLK_I2S2 207 +#define HCLK_PDM 208 +#define HCLK_AUDPWM 209 +#define HCLK_PDVEPU 210 +#define HCLK_VENC 211 +#define HCLK_PDVDEC 212 +#define HCLK_PDJPEG 213 +#define HCLK_VDEC 214 +#define HCLK_JPEG 215 +#define HCLK_PDVO 216 +#define HCLK_RGA 217 +#define HCLK_VOP 218 +#define HCLK_IEP 219 +#define HCLK_PDVI 220 +#define HCLK_ISP 221 +#define HCLK_CIF 222 +#define HCLK_CIFLITE 223 +#define HCLK_PDISPP 224 +#define HCLK_ISPP 225 +#define HCLK_PDPHP 226 +#define HCLK_PDSDMMC 227 +#define HCLK_SDMMC 228 +#define HCLK_PDSDIO 229 +#define HCLK_SDIO 230 +#define HCLK_PDNVM 231 +#define HCLK_EMMC 232 +#define HCLK_NANDC 233 +#define HCLK_SFC 234 +#define HCLK_SFCXIP 235 +#define HCLK_PDBUS 236 +#define HCLK_USBHOST 237 +#define HCLK_USBHOST_ARB 238 +#define HCLK_PDNPU 239 +#define HCLK_NPU 240 + +/* pclk */ +#define PCLK_CPUPVTM 245 +#define PCLK_PDBUS 246 +#define PCLK_DCF 247 +#define PCLK_WDT 248 +#define PCLK_MAILBOX 249 +#define PCLK_UART0 250 +#define PCLK_UART2 251 +#define PCLK_UART3 252 +#define PCLK_UART4 253 +#define PCLK_UART5 254 +#define PCLK_I2C1 255 +#define PCLK_I2C3 256 +#define PCLK_I2C4 257 +#define PCLK_I2C5 258 +#define PCLK_SPI1 259 +#define PCLK_PWM2 261 +#define PCLK_GPIO1 262 +#define PCLK_GPIO2 263 +#define PCLK_GPIO3 264 +#define PCLK_GPIO4 265 +#define PCLK_SARADC 266 +#define PCLK_TIMER 267 +#define PCLK_DECOM 268 +#define PCLK_CAN 269 +#define PCLK_NPU_TSADC 270 +#define PCLK_CPU_TSADC 271 +#define PCLK_ACDCDIG 272 +#define PCLK_PDVO 273 +#define PCLK_DSIHOST 274 +#define PCLK_PDVI 275 +#define PCLK_CSIHOST 276 +#define PCLK_PDGMAC 277 +#define PCLK_GMAC 278 +#define PCLK_PDDDR 279 +#define PCLK_DDR_MON 280 +#define PCLK_PDNPU 281 +#define PCLK_NPUPVTM 282 +#define PCLK_PDTOP 283 +#define PCLK_TOPCRU 284 +#define PCLK_TOPGRF 285 +#define PCLK_CPUEMADET 286 +#define PCLK_DDRPHY 287 +#define PCLK_DSIPHY 289 +#define PCLK_CSIPHY0 290 +#define PCLK_CSIPHY1 291 +#define PCLK_USBPHY_HOST 292 +#define PCLK_USBPHY_OTG 293 +#define PCLK_OTP 294 + +#define CLK_NR_CLKS (PCLK_OTP + 1) + +/* pmu soft-reset indices */ + +/* pmu_cru_softrst_con0 */ +#define SRST_PDPMU_NIU_P 0 +#define SRST_PMU_SGRF_P 1 +#define SRST_PMU_SGRF_REMAP_P 2 +#define SRST_I2C0_P 3 +#define SRST_I2C0 4 +#define SRST_I2C2_P 7 +#define SRST_I2C2 8 +#define SRST_UART1_P 9 +#define SRST_UART1 10 +#define SRST_PWM0_P 11 +#define SRST_PWM0 12 +#define SRST_PWM1_P 13 +#define SRST_PWM1 14 +#define SRST_DDR_FAIL_SAFE 15 + +/* pmu_cru_softrst_con1 */ +#define SRST_GPIO0_P 17 +#define SRST_GPIO0_DB 18 +#define SRST_SPI0_P 19 +#define SRST_SPI0 20 +#define SRST_PMUGRF_P 21 +#define SRST_CHIPVEROTP_P 22 +#define SRST_PMUPVTM 24 +#define SRST_PMUPVTM_P 25 +#define SRST_PMUCRU_P 30 + +/* soft-reset indices */ + +/* cru_softrst_con0 */ +#define SRST_CORE0_PO 0 +#define SRST_CORE1_PO 1 +#define SRST_CORE2_PO 2 +#define SRST_CORE3_PO 3 +#define SRST_CORE0 4 +#define SRST_CORE1 5 +#define SRST_CORE2 6 +#define SRST_CORE3 7 +#define SRST_CORE0_DBG 8 +#define SRST_CORE1_DBG 9 +#define SRST_CORE2_DBG 10 +#define SRST_CORE3_DBG 11 +#define SRST_NL2 12 +#define SRST_CORE_NIU_A 13 +#define SRST_DBG_DAPLITE_P 14 +#define SRST_DAPLITE_P 15 + +/* cru_softrst_con1 */ +#define SRST_PDBUS_NIU1_A 16 +#define SRST_PDBUS_NIU1_H 17 +#define SRST_PDBUS_NIU1_P 18 +#define SRST_PDBUS_NIU2_A 19 +#define SRST_PDBUS_NIU2_H 20 +#define SRST_PDBUS_NIU3_A 21 +#define SRST_PDBUS_NIU3_H 22 +#define SRST_PDBUS_HOLD_NIU1_A 23 +#define SRST_DBG_NIU_P 24 +#define SRST_PDCORE_NIIU_H 25 +#define SRST_MUC_NIU 26 +#define SRST_DCF_A 29 +#define SRST_DCF_P 30 +#define SRST_SYSTEM_SRAM_A 31 + +/* cru_softrst_con2 */ +#define SRST_I2C1_P 32 +#define SRST_I2C1 33 +#define SRST_I2C3_P 34 +#define SRST_I2C3 35 +#define SRST_I2C4_P 36 +#define SRST_I2C4 37 +#define SRST_I2C5_P 38 +#define SRST_I2C5 39 +#define SRST_SPI1_P 40 +#define SRST_SPI1 41 +#define SRST_MCU_CORE 42 +#define SRST_PWM2_P 44 +#define SRST_PWM2 45 +#define SRST_SPINLOCK_A 46 + +/* cru_softrst_con3 */ +#define SRST_UART0_P 48 +#define SRST_UART0 49 +#define SRST_UART2_P 50 +#define SRST_UART2 51 +#define SRST_UART3_P 52 +#define SRST_UART3 53 +#define SRST_UART4_P 54 +#define SRST_UART4 55 +#define SRST_UART5_P 56 +#define SRST_UART5 57 +#define SRST_WDT_P 58 +#define SRST_SARADC_P 59 +#define SRST_GRF_P 61 +#define SRST_TIMER_P 62 +#define SRST_MAILBOX_P 63 + +/* cru_softrst_con4 */ +#define SRST_TIMER0 64 +#define SRST_TIMER1 65 +#define SRST_TIMER2 66 +#define SRST_TIMER3 67 +#define SRST_TIMER4 68 +#define SRST_TIMER5 69 +#define SRST_INTMUX_P 70 +#define SRST_GPIO1_P 72 +#define SRST_GPIO1_DB 73 +#define SRST_GPIO2_P 74 +#define SRST_GPIO2_DB 75 +#define SRST_GPIO3_P 76 +#define SRST_GPIO3_DB 77 +#define SRST_GPIO4_P 78 +#define SRST_GPIO4_DB 79 + +/* cru_softrst_con5 */ +#define SRST_CAN_P 80 +#define SRST_CAN 81 +#define SRST_DECOM_A 85 +#define SRST_DECOM_P 86 +#define SRST_DECOM_D 87 +#define SRST_PDCRYPTO_NIU_A 88 +#define SRST_PDCRYPTO_NIU_H 89 +#define SRST_CRYPTO_A 90 +#define SRST_CRYPTO_H 91 +#define SRST_CRYPTO_CORE 92 +#define SRST_CRYPTO_PKA 93 +#define SRST_SGRF_P 95 + +/* cru_softrst_con6 */ +#define SRST_PDAUDIO_NIU_H 96 +#define SRST_PDAUDIO_NIU_P 97 +#define SRST_I2S0_H 98 +#define SRST_I2S0_TX_M 99 +#define SRST_I2S0_RX_M 100 +#define SRST_I2S1_H 101 +#define SRST_I2S1_M 102 +#define SRST_I2S2_H 103 +#define SRST_I2S2_M 104 +#define SRST_PDM_H 105 +#define SRST_PDM_M 106 +#define SRST_AUDPWM_H 107 +#define SRST_AUDPWM 108 +#define SRST_ACDCDIG_P 109 +#define SRST_ACDCDIG 110 + +/* cru_softrst_con7 */ +#define SRST_PDVEPU_NIU_A 112 +#define SRST_PDVEPU_NIU_H 113 +#define SRST_VENC_A 114 +#define SRST_VENC_H 115 +#define SRST_VENC_CORE 116 +#define SRST_PDVDEC_NIU_A 117 +#define SRST_PDVDEC_NIU_H 118 +#define SRST_VDEC_A 119 +#define SRST_VDEC_H 120 +#define SRST_VDEC_CORE 121 +#define SRST_VDEC_CA 122 +#define SRST_VDEC_HEVC_CA 123 +#define SRST_PDJPEG_NIU_A 124 +#define SRST_PDJPEG_NIU_H 125 +#define SRST_JPEG_A 126 +#define SRST_JPEG_H 127 + +/* cru_softrst_con8 */ +#define SRST_PDVO_NIU_A 128 +#define SRST_PDVO_NIU_H 129 +#define SRST_PDVO_NIU_P 130 +#define SRST_RGA_A 131 +#define SRST_RGA_H 132 +#define SRST_RGA_CORE 133 +#define SRST_VOP_A 134 +#define SRST_VOP_H 135 +#define SRST_VOP_D 136 +#define SRST_TXBYTEHS_DSIHOST 137 +#define SRST_DSIHOST_P 138 +#define SRST_IEP_A 139 +#define SRST_IEP_H 140 +#define SRST_IEP_CORE 141 +#define SRST_ISP_RX_P 142 + +/* cru_softrst_con9 */ +#define SRST_PDVI_NIU_A 144 +#define SRST_PDVI_NIU_H 145 +#define SRST_PDVI_NIU_P 146 +#define SRST_ISP 147 +#define SRST_CIF_A 148 +#define SRST_CIF_H 149 +#define SRST_CIF_D 150 +#define SRST_CIF_P 151 +#define SRST_CIF_I 152 +#define SRST_CIF_RX_P 153 +#define SRST_PDISPP_NIU_A 154 +#define SRST_PDISPP_NIU_H 155 +#define SRST_ISPP_A 156 +#define SRST_ISPP_H 157 +#define SRST_ISPP 158 +#define SRST_CSIHOST_P 159 + +/* cru_softrst_con10 */ +#define SRST_PDPHPMID_NIU_A 160 +#define SRST_PDPHPMID_NIU_H 161 +#define SRST_PDNVM_NIU_H 163 +#define SRST_SDMMC_H 164 +#define SRST_SDIO_H 165 +#define SRST_EMMC_H 166 +#define SRST_SFC_H 167 +#define SRST_SFCXIP_H 168 +#define SRST_SFC 169 +#define SRST_NANDC_H 170 +#define SRST_NANDC 171 +#define SRST_PDSDMMC_H 173 +#define SRST_PDSDIO_H 174 + +/* cru_softrst_con11 */ +#define SRST_PDUSB_NIU_A 176 +#define SRST_PDUSB_NIU_H 177 +#define SRST_USBHOST_H 178 +#define SRST_USBHOST_ARB_H 179 +#define SRST_USBHOST_UTMI 180 +#define SRST_USBOTG_A 181 +#define SRST_USBPHY_OTG_P 182 +#define SRST_USBPHY_HOST_P 183 +#define SRST_USBPHYPOR_OTG 184 +#define SRST_USBPHYPOR_HOST 185 +#define SRST_PDGMAC_NIU_A 188 +#define SRST_PDGMAC_NIU_P 189 +#define SRST_GMAC_A 190 + +/* cru_softrst_con12 */ +#define SRST_DDR_DFICTL_P 193 +#define SRST_DDR_MON_P 194 +#define SRST_DDR_STANDBY_P 195 +#define SRST_DDR_GRF_P 196 +#define SRST_DDR_MSCH_P 197 +#define SRST_DDR_SPLIT_A 198 +#define SRST_DDR_MSCH 199 +#define SRST_DDR_DFICTL 202 +#define SRST_DDR_STANDBY 203 +#define SRST_NPUMCU_NIU 205 +#define SRST_DDRPHY_P 206 +#define SRST_DDRPHY 207 + +/* cru_softrst_con13 */ +#define SRST_PDNPU_NIU_A 208 +#define SRST_PDNPU_NIU_H 209 +#define SRST_PDNPU_NIU_P 210 +#define SRST_NPU_A 211 +#define SRST_NPU_H 212 +#define SRST_NPU 213 +#define SRST_NPUPVTM_P 214 +#define SRST_NPUPVTM 215 +#define SRST_NPU_TSADC_P 216 +#define SRST_NPU_TSADC 217 +#define SRST_NPU_TSADCPHY 218 +#define SRST_CIFLITE_A 220 +#define SRST_CIFLITE_H 221 +#define SRST_CIFLITE_D 222 +#define SRST_CIFLITE_RX_P 223 + +/* cru_softrst_con14 */ +#define SRST_TOPNIU_P 224 +#define SRST_TOPCRU_P 225 +#define SRST_TOPGRF_P 226 +#define SRST_CPUEMADET_P 227 +#define SRST_CSIPHY0_P 228 +#define SRST_CSIPHY1_P 229 +#define SRST_DSIPHY_P 230 +#define SRST_CPU_TSADC_P 232 +#define SRST_CPU_TSADC 233 +#define SRST_CPU_TSADCPHY 234 +#define SRST_CPUPVTM_P 235 +#define SRST_CPUPVTM 236 + +#endif
Signature · 1 line
2.25.1
PATCH v4 14/25 clk: rockchip: Add rv1126 clk support
In reply to Jagan TekiAdd clock driver support for Rockchip RV1126 SoC.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
drivers/clk/rockchip/Makefile | 1 + drivers/clk/rockchip/clk_rv1126.c | 1889 +++++++++++++++++++++++++++++ 2 files changed, 1890 insertions(+) create mode 100644 drivers/clk/rockchip/clk_rv1126.c
drivers/clk/rockchip/Makefile +1 -0
@@ -17,3 +17,4 @@ obj-$(CONFIG_ROCKCHIP_RK3368) += clk_rk3368.o obj-$(CONFIG_ROCKCHIP_RK3399) += clk_rk3399.o obj-$(CONFIG_ROCKCHIP_RK3568) += clk_rk3568.o obj-$(CONFIG_ROCKCHIP_RV1108) += clk_rv1108.o +obj-$(CONFIG_ROCKCHIP_RV1126) += clk_rv1126.o
drivers/clk/rockchip/clk_rv1126.c new file +1889 -0
1,889 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v4 15/25 dt-bindings: power: Add power-domain header for rv1126
In reply to Jagan TekiAdd power-domain header for RV1126 SoC from description in TRM.
---
Changes for v4:
- sync changes from linux
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
.../dt-bindings/power/rockchip,rv1126-power.h | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 include/dt-bindings/power/rockchip,rv1126-power.h
include/dt-bindings/power/rockchip,rv1126-power.h new file +35 -0
@@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef __DT_BINDINGS_POWER_RV1126_POWER_H__ +#define __DT_BINDINGS_POWER_RV1126_POWER_H__ + +/* VD_CORE */ +#define RV1126_PD_CPU_0 0 +#define RV1126_PD_CPU_1 1 +#define RV1126_PD_CPU_2 2 +#define RV1126_PD_CPU_3 3 +#define RV1126_PD_CORE_ALIVE 4 + +/* VD_PMU */ +#define RV1126_PD_PMU 5 +#define RV1126_PD_PMU_ALIVE 6 + +/* VD_NPU */ +#define RV1126_PD_NPU 7 + +/* VD_VEPU */ +#define RV1126_PD_VEPU 8 + +/* VD_LOGIC */ +#define RV1126_PD_VI 9 +#define RV1126_PD_VO 10 +#define RV1126_PD_ISPP 11 +#define RV1126_PD_VDPU 12 +#define RV1126_PD_CRYPTO 13 +#define RV1126_PD_DDR 14 +#define RV1126_PD_NVM 15 +#define RV1126_PD_SDIO 16 +#define RV1126_PD_USB 17 +#define RV1126_PD_LOGIC_ALIVE 18 + +#endif
Signature · 1 line
2.25.1
PATCH v4 16/25 arm: rockchip: Add grf header for rv1126
In reply to Jagan TekiAdd GRF header for Rockchip RV1126.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
.../include/asm/arch-rockchip/grf_rv1126.h | 251 ++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rv1126.h
arch/arm/include/asm/arch-rockchip/grf_rv1126.h new file +251 -0
@@ -0,0 +1,251 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2019 Rockchip Electronics Co., Ltd. +*/ + +#ifndef _ASM_ARCH_GRF_RV1126_H +#define _ASM_ARCH_GRF_RV1126_H + +struct rv1126_grf { +unsigned int soc_con0; +unsigned int soc_con1; +unsigned int soc_con2; +unsigned int reserved0[1 ]; +unsigned int soc_status0; +unsigned int soc_status1; +unsigned int reserved1[2 ]; +unsigned int cpu_con0; +unsigned int cpu_con1; +unsigned int reserved2[2 ]; +unsigned int cpu_status0; +unsigned int reserved3[3 ]; +unsigned int noc_con0; +unsigned int noc_con1; +unsigned int noc_con2; +unsigned int noc_con3; +unsigned int usbhost_con0; +unsigned int usbhost_con1; +unsigned int usbhost_status0; +unsigned int usbotg_con0; +unsigned int usbotg_con1; +unsigned int usbotg_status0; +unsigned int usbotg_status1; +unsigned int usbotg_status2; +unsigned int mac_con0; +unsigned int mac_con1; +unsigned int mac_con2; +unsigned int reserved4[2 ]; +unsigned int mac_status0; +unsigned int mac_status1; +unsigned int mac_status2; +unsigned int mem_con0; +unsigned int mem_con1; +unsigned int mem_con2; +unsigned int mem_con3; +unsigned int reserved5[(0x100 -0x09c ) /4 -1 ]; +unsigned int tsadc_con0; +unsigned int reserved6[3 ]; +unsigned int chip_id; +unsigned int reserved7[(0x10000 -0x110 ) /4 -1 ]; +unsigned int gpio0c_iomux_h; +unsigned int gpio0d_iomux_l; +unsigned int gpio0d_iomux_h; +unsigned int reserved8[1 ]; +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 reserved9[3 ]; +unsigned int gpio0c_ds_h; +unsigned int gpio0d_ds_l; +unsigned int gpio0d_ds_h; +unsigned int reserved10[1 ]; +unsigned int gpio1a_ds_l; +unsigned int gpio1a_ds_h; +unsigned int gpio1b_ds_l; +unsigned int gpio1b_ds_h; +unsigned int gpio1c_ds_l; +unsigned int gpio1c_ds_h; +unsigned int gpio1d_ds_l; +unsigned int gpio1d_ds_h; +unsigned int gpio2a_ds_l; +unsigned int gpio2a_ds_h; +unsigned int gpio2b_ds_l; +unsigned int gpio2b_ds_h; +unsigned int gpio2c_ds_l; +unsigned int gpio2c_ds_h; +unsigned int gpio2d_ds_l; +unsigned int gpio2d_ds_h; +unsigned int gpio3a_ds_l; +unsigned int gpio3a_ds_h; +unsigned int gpio3b_ds_l; +unsigned int gpio3b_ds_h; +unsigned int gpio3c_ds_l; +unsigned int gpio3c_ds_h; +unsigned int gpio3d_ds_l; +unsigned int gpio3d_ds_h; +unsigned int gpio4a_ds_l; +unsigned int reserved12[3 ]; +unsigned int gpio0c_p_h; +unsigned int gpio0d_p; +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 reserved13[1 ]; +unsigned int gpio0c_ie_h; +unsigned int gpio0d_ie; +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 reserved14[1 ]; +unsigned int gpio0c_smt_h; +unsigned int gpio0d_smt; +unsigned int gpio1a_smt; +unsigned int gpio1b_smt; +unsigned int gpio1c_smt; +unsigned int gpio1d_smt; +unsigned int gpio2a_smt; +unsigned int gpio2b_smt; +unsigned int gpio2c_smt; +unsigned int gpio2d_smt; +unsigned int gpio3a_smt; +unsigned int gpio3b_smt; +unsigned int gpio3c_smt; +unsigned int gpio3d_smt; +unsigned int gpio4a_smt; +unsigned int reserved15[(0x10200 -0x101b8 ) /4 -1 ]; +unsigned int csiphy0_con; +unsigned int reserved16[1 ]; +unsigned int csiphy0_status; +unsigned int reserved17[1 ]; +unsigned int csiphy1_con; +unsigned int reserved18[1 ]; +unsigned int csiphy1_status; +unsigned int reserved19[1 ]; +unsigned int dsiphy_con; +unsigned int reserved20[3 ]; +unsigned int usbphy_con0; +unsigned int usbphy_con1; +unsigned int usbphy_con2; +unsigned int reserved21[3 ]; +unsigned int usbphy_status; +unsigned int reserved22[1 ]; +unsigned int cifio_con; +unsigned int sddetflt_con; +unsigned int uart2rx_low_con; +unsigned int reserved23[1 ]; +unsigned int iofunc_con0; +unsigned int iofunc_con1; +unsigned int iofunc_con2; +unsigned int iofunc_con3; +unsigned int usbphy0_cfg_con; +unsigned int usbphy0_cfg_addrin; +unsigned int usbphy0_cfg_addrout; +unsigned int usbphy0_cfg_dly_con; +unsigned int usbphy1_cfg_con; +unsigned int usbphy1_cfg_addrin; +unsigned int usbphy1_cfg_addrout; +unsigned int usbphy1_cfg_dly_con; +unsigned int reserved24[(0x10300 -0x1028c ) /4 -1 ]; +unsigned int usb_sig_detect_con; +unsigned int usb_sig_detect_status; +unsigned int usb_sig_detect_clr; +unsigned int reserved25[1 ]; +unsigned int usb_linestate_con; +unsigned int usb_disconnect_con; +unsigned int usb_bvalid_con; +unsigned int usb_id_con; +}; + +check_member (rv1126_grf, usb_id_con,0x1031c ); + +struct rv1126_pmugrf { +unsigned int gpio0a_iomux_l; +unsigned int gpio0a_iomux_h; +unsigned int gpio0b_iomux_l; +unsigned int gpio0b_iomux_h; +unsigned int gpio0c_iomux_l; +unsigned int reserved0[3 ]; +unsigned int gpio0a_ds_l; +unsigned int gpio0a_ds_h; +unsigned int gpio0b_ds_l; +unsigned int gpio0b_ds_h; +unsigned int gpio0c_ds_l; +unsigned int osc_ds; +unsigned int reserved1[2 ]; +unsigned int gpio0a_p; +unsigned int gpio0b_p; +unsigned int gpio0c_p_l; +unsigned int reserved2[1 ]; +unsigned int gpio0a_ie; +unsigned int gpio0b_ie; +unsigned int gpio0c_ie_l; +unsigned int reserved3[1 ]; +unsigned int gpio0a_smt; +unsigned int gpio0b_smt; +unsigned int gpio0c_smt_l; +unsigned int reserved4[(0x100 -0x68 ) /4 -1 ]; +unsigned int soc_con[7 ]; +unsigned int reserved5[(0x140 -0x118 ) /4 -1 ]; +unsigned int io_vsel; +unsigned int io_vret; +unsigned int reserved6[(0x180 -0x144 ) /4 -1 ]; +unsigned int pmupvtm_clkdiv; +unsigned int reserved7[(0x200 -0x180 ) /4 -1 ]; +unsigned int os_reg[12 ]; +unsigned int rstfunc_status; +unsigned int rstfunc_clr; +unsigned int reserved8[(0x380 -0x234 ) /4 -1 ]; +unsigned int sd_detect_con; +unsigned int reserved9[3 ]; +unsigned int sd_detect_status; +unsigned int reserved10[3 ]; +unsigned int sd_detect_clr; +unsigned int reserved11[3 ]; +unsigned int sd_det_count; +}; + +check_member (rv1126_pmugrf, sd_det_count,0x3b0 ); + +#endif
Signature · 1 line
2.25.1
PATCH v4 17/25 ARM: dts: rockchip: Add Rockchip RV1126 pinctrl
In reply to Jagan TekiAdd pinctrl definitions for Rockchip RV1126.
---
Changes for v4:
- pick changes from linux
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
arch/arm/dts/rv1126-pinctrl.dtsi | 211 +++++++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 arch/arm/dts/rv1126-pinctrl.dtsi
arch/arm/dts/rv1126-pinctrl.dtsi new file +211 -0
@@ -0,0 +1,211 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2020 Fuzhou Rockchip Electronics Co., Ltd + */ + +#include <dt-bindings/pinctrl/rockchip.h> +#include "rockchip-pinconf.dtsi" + +/* + * This file is auto generated by pin2dts tool, please keep these code + * by adding changes at end of this file. + */ +&pinctrl { + emmc { + /omit-if-no-ref/ + emmc_rstnout: emmc-rstnout { + rockchip,pins = + /* emmc_rstn */ + <1 RK_PA3 2 &pcfg_pull_none>; + }; + /omit-if-no-ref/ + emmc_bus8: emmc-bus8 { + rockchip,pins = + /* emmc_d0 */ + <0 RK_PC4 2 &pcfg_pull_up_drv_level_2>, + /* emmc_d1 */ + <0 RK_PC5 2 &pcfg_pull_up_drv_level_2>, + /* emmc_d2 */ + <0 RK_PC6 2 &pcfg_pull_up_drv_level_2>, + /* emmc_d3 */ + <0 RK_PC7 2 &pcfg_pull_up_drv_level_2>, + /* emmc_d4 */ + <0 RK_PD0 2 &pcfg_pull_up_drv_level_2>, + /* emmc_d5 */ + <0 RK_PD1 2 &pcfg_pull_up_drv_level_2>, + /* emmc_d6 */ + <0 RK_PD2 2 &pcfg_pull_up_drv_level_2>, + /* emmc_d7 */ + <0 RK_PD3 2 &pcfg_pull_up_drv_level_2>; + }; + /omit-if-no-ref/ + emmc_clk: emmc-clk { + rockchip,pins = + /* emmc_clko */ + <0 RK_PD7 2 &pcfg_pull_up_drv_level_2>; + }; + /omit-if-no-ref/ + emmc_cmd: emmc-cmd { + rockchip,pins = + /* emmc_cmd */ + <0 RK_PD5 2 &pcfg_pull_up_drv_level_2>; + }; + }; + i2c0 { + /omit-if-no-ref/ + i2c0_xfer: i2c0-xfer { + rockchip,pins = + /* i2c0_scl */ + <0 RK_PB4 1 &pcfg_pull_none_drv_level_0_smt>, + /* i2c0_sda */ + <0 RK_PB5 1 &pcfg_pull_none_drv_level_0_smt>; + }; + }; + sdmmc0 { + /omit-if-no-ref/ + sdmmc0_bus4: sdmmc0-bus4 { + rockchip,pins = + /* sdmmc0_d0 */ + <1 RK_PA4 1 &pcfg_pull_up_drv_level_2>, + /* sdmmc0_d1 */ + <1 RK_PA5 1 &pcfg_pull_up_drv_level_2>, + /* sdmmc0_d2 */ + <1 RK_PA6 1 &pcfg_pull_up_drv_level_2>, + /* sdmmc0_d3 */ + <1 RK_PA7 1 &pcfg_pull_up_drv_level_2>; + }; + /omit-if-no-ref/ + sdmmc0_clk: sdmmc0-clk { + rockchip,pins = + /* sdmmc0_clk */ + <1 RK_PB0 1 &pcfg_pull_up_drv_level_2>; + }; + /omit-if-no-ref/ + sdmmc0_cmd: sdmmc0-cmd { + rockchip,pins = + /* sdmmc0_cmd */ + <1 RK_PB1 1 &pcfg_pull_up_drv_level_2>; + }; + /omit-if-no-ref/ + sdmmc0_det: sdmmc0-det { + rockchip,pins = + <0 RK_PA3 1 &pcfg_pull_none>; + }; + /omit-if-no-ref/ + sdmmc0_pwr: sdmmc0-pwr { + rockchip,pins = + <0 RK_PC0 1 &pcfg_pull_none>; + }; + }; + sdmmc1 { + /omit-if-no-ref/ + sdmmc1_bus4: sdmmc1-bus4 { + rockchip,pins = + /* sdmmc1_d0 */ + <1 RK_PB4 1 &pcfg_pull_up_drv_level_2>, + /* sdmmc1_d1 */ + <1 RK_PB5 1 &pcfg_pull_up_drv_level_2>, + /* sdmmc1_d2 */ + <1 RK_PB6 1 &pcfg_pull_up_drv_level_2>, + /* sdmmc1_d3 */ + <1 RK_PB7 1 &pcfg_pull_up_drv_level_2>; + }; + /omit-if-no-ref/ + sdmmc1_clk: sdmmc1-clk { + rockchip,pins = + /* sdmmc1_clk */ + <1 RK_PB2 1 &pcfg_pull_up_drv_level_2>; + }; + /omit-if-no-ref/ + sdmmc1_cmd: sdmmc1-cmd { + rockchip,pins = + /* sdmmc1_cmd */ + <1 RK_PB3 1 &pcfg_pull_up_drv_level_2>; + }; + /omit-if-no-ref/ + sdmmc1_det: sdmmc1-det { + rockchip,pins = + <1 RK_PD0 2 &pcfg_pull_none>; + }; + /omit-if-no-ref/ + sdmmc1_pwr: sdmmc1-pwr { + rockchip,pins = + <1 RK_PD1 2 &pcfg_pull_none>; + }; + }; + uart0 { + /omit-if-no-ref/ + uart0_xfer: uart0-xfer { + rockchip,pins = + /* uart0_rx */ + <1 RK_PC2 1 &pcfg_pull_up>, + /* uart0_tx */ + <1 RK_PC3 1 &pcfg_pull_up>; + }; + /omit-if-no-ref/ + uart0_ctsn: uart0-ctsn { + rockchip,pins = + <1 RK_PC1 1 &pcfg_pull_none>; + }; + /omit-if-no-ref/ + uart0_rtsn: uart0-rtsn { + rockchip,pins = + <1 RK_PC0 1 &pcfg_pull_none>; + }; + /omit-if-no-ref/ + uart0_rtsn_gpio: uart0-rts-pin { + rockchip,pins = + <1 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + uart1 { + /omit-if-no-ref/ + uart1m0_xfer: uart1m0-xfer { + rockchip,pins = + /* uart1_rx_m0 */ + <0 RK_PB7 2 &pcfg_pull_up>, + /* uart1_tx_m0 */ + <0 RK_PB6 2 &pcfg_pull_up>; + }; + }; + uart2 { + /omit-if-no-ref/ + uart2m1_xfer: uart2m1-xfer { + rockchip,pins = + /* uart2_rx_m1 */ + <3 RK_PA3 1 &pcfg_pull_up>, + /* uart2_tx_m1 */ + <3 RK_PA2 1 &pcfg_pull_up>; + }; + }; + uart3 { + /omit-if-no-ref/ + uart3m0_xfer: uart3m0-xfer { + rockchip,pins = + /* uart3_rx_m0 */ + <3 RK_PC7 4 &pcfg_pull_up>, + /* uart3_tx_m0 */ + <3 RK_PC6 4 &pcfg_pull_up>; + }; + }; + uart4 { + /omit-if-no-ref/ + uart4m0_xfer: uart4m0-xfer { + rockchip,pins = + /* uart4_rx_m0 */ + <3 RK_PA5 4 &pcfg_pull_up>, + /* uart4_tx_m0 */ + <3 RK_PA4 4 &pcfg_pull_up>; + }; + }; + uart5 { + /omit-if-no-ref/ + uart5m0_xfer: uart5m0-xfer { + rockchip,pins = + /* uart5_rx_m0 */ + <3 RK_PA7 4 &pcfg_pull_up>, + /* uart5_tx_m0 */ + <3 RK_PA6 4 &pcfg_pull_up>; + }; + }; +};
Signature · 1 line
2.25.1
PATCH v4 18/25 ARM: dts: rockchip: Add Rockchip RV1126 SoC
In reply to Jagan TekiRV1126 is a high-performance vision processor SoC for IPC/CVR, especially for AI related application.
It is based on quad-core ARM Cortex-A7 32-bit core which integrates NEON and FPU. There is a 32KB I-cache and 32KB D-cache for each core and 512KB unified L2 cache. It has build-in NPU supports INT8/INT16 hybrid operation and computing power is up to 2.0TOPs.
This patch add basic core dtsi support.
---
Changes for v4:
- pick changes from linux
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
arch/arm/dts/rv1126.dtsi | 438 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 438 insertions(+) create mode 100644 arch/arm/dts/rv1126.dtsi
arch/arm/dts/rv1126.dtsi new file +438 -0
@@ -0,0 +1,438 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd. + */ + +#include <dt-bindings/clock/rockchip,rv1126-cru.h> +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/pinctrl/rockchip.h> +#include <dt-bindings/power/rockchip,rv1126-power.h> +#include <dt-bindings/soc/rockchip,boot-mode.h> + +/ { + #address-cells = <1>; + #size-cells = <1>; + + compatible = "rockchip,rv1126"; + + interrupt-parent = <&gic>; + + aliases { + i2c0 = &i2c0; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu0: cpu@f00 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf00>; + enable-method = "psci"; + clocks = <&cru ARMCLK>; + }; + + cpu1: cpu@f01 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf01>; + enable-method = "psci"; + clocks = <&cru ARMCLK>; + }; + + cpu2: cpu@f02 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf02>; + enable-method = "psci"; + clocks = <&cru ARMCLK>; + }; + + cpu3: cpu@f03 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf03>; + enable-method = "psci"; + clocks = <&cru ARMCLK>; + }; + }; + + arm-pmu { + compatible = "arm,cortex-a7-pmu"; + interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>; + interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>; + }; + + psci { + compatible = "arm,psci-1.0"; + method = "smc"; + }; + + timer { + compatible = "arm,armv7-timer"; + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; + clock-frequency = <24000000>; + }; + + xin24m: oscillator { + compatible = "fixed-clock"; + clock-frequency = <24000000>; + clock-output-names = "xin24m"; + #clock-cells = <0>; + }; + + grf: syscon@fe000000 { + compatible = "rockchip,rv1126-grf", "syscon", "simple-mfd"; + reg = <0xfe000000 0x20000>; + }; + + pmugrf: syscon@fe020000 { + compatible = "rockchip,rv1126-pmugrf", "syscon", "simple-mfd"; + reg = <0xfe020000 0x1000>; + + pmu_io_domains: io-domains { + compatible = "rockchip,rv1126-pmu-io-voltage-domain"; + status = "disabled"; + }; + }; + + qos_emmc: qos@fe860000 { + compatible = "rockchip,rv1126-qos", "syscon"; + reg = <0xfe860000 0x20>; + }; + + qos_nandc: qos@fe860080 { + compatible = "rockchip,rv1126-qos", "syscon"; + reg = <0xfe860080 0x20>; + }; + + qos_sfc: qos@fe860200 { + compatible = "rockchip,rv1126-qos", "syscon"; + reg = <0xfe860200 0x20>; + }; + + qos_sdio: qos@fe86c000 { + compatible = "rockchip,rv1126-qos", "syscon"; + reg = <0xfe86c000 0x20>; + }; + + gic: interrupt-controller@feff0000 { + compatible = "arm,gic-400"; + interrupt-controller; + #interrupt-cells = <3>; + #address-cells = <0>; + + reg = <0xfeff1000 0x1000>, + <0xfeff2000 0x2000>, + <0xfeff4000 0x2000>, + <0xfeff6000 0x2000>; + interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; + }; + + pmu: power-management@ff3e0000 { + compatible = "rockchip,rv1126-pmu", "syscon", "simple-mfd"; + reg = <0xff3e0000 0x1000>; + + power: power-controller { + compatible = "rockchip,rv1126-power-controller"; + #power-domain-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; + + power-domain@RV1126_PD_NVM { + reg = <RV1126_PD_NVM>; + clocks = <&cru HCLK_EMMC>, + <&cru CLK_EMMC>, + <&cru HCLK_NANDC>, + <&cru CLK_NANDC>, + <&cru HCLK_SFC>, + <&cru HCLK_SFCXIP>, + <&cru SCLK_SFC>; + pm_qos = <&qos_emmc>, + <&qos_nandc>, + <&qos_sfc>; + #power-domain-cells = <0>; + }; + + power-domain@RV1126_PD_SDIO { + reg = <RV1126_PD_SDIO>; + clocks = <&cru HCLK_SDIO>, + <&cru CLK_SDIO>; + pm_qos = <&qos_sdio>; + #power-domain-cells = <0>; + }; + }; + }; + + i2c0: i2c@ff3f0000 { + compatible = "rockchip,rv1126-i2c", "rockchip,rk3399-i2c"; + reg = <0xff3f0000 0x1000>; + interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>; + rockchip,grf = <&pmugrf>; + clocks = <&pmucru CLK_I2C0>, <&pmucru PCLK_I2C0>; + clock-names = "i2c", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_xfer>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + uart1: serial@ff410000 { + compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart"; + reg = <0xff410000 0x100>; + interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <24000000>; + clocks = <&pmucru SCLK_UART1>, <&pmucru PCLK_UART1>; + clock-names = "baudclk", "apb_pclk"; + dmas = <&dmac 7>, <&dmac 6>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&uart1m0_xfer>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + pmucru: clock-controller@ff480000 { + compatible = "rockchip,rv1126-pmucru"; + reg = <0xff480000 0x1000>; + rockchip,grf = <&grf>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + cru: clock-controller@ff490000 { + compatible = "rockchip,rv1126-cru"; + reg = <0xff490000 0x1000>; + clocks = <&xin24m>; + clock-names = "xin24m"; + rockchip,grf = <&grf>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + dmac: dma-controller@ff4e0000 { + compatible = "arm,pl330", "arm,primecell"; + reg = <0xff4e0000 0x4000>; + interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>; + #dma-cells = <1>; + arm,pl330-periph-burst; + clocks = <&cru ACLK_DMAC>; + clock-names = "apb_pclk"; + }; + + uart0: serial@ff560000 { + compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart"; + reg = <0xff560000 0x100>; + interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>; + clock-names = "baudclk", "apb_pclk"; + dmas = <&dmac 5>, <&dmac 4>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&uart0_xfer>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + uart2: serial@ff570000 { + compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart"; + reg = <0xff570000 0x100>; + interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART2>, <&cru PCLK_UART2>; + clock-names = "baudclk", "apb_pclk"; + dmas = <&dmac 9>, <&dmac 8>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&uart2m1_xfer>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + uart3: serial@ff580000 { + compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart"; + reg = <0xff580000 0x100>; + interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART3>, <&cru PCLK_UART3>; + clock-names = "baudclk", "apb_pclk"; + dmas = <&dmac 11>, <&dmac 10>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&uart3m0_xfer>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + uart4: serial@ff590000 { + compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart"; + reg = <0xff590000 0x100>; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART4>, <&cru PCLK_UART4>; + clock-names = "baudclk", "apb_pclk"; + dmas = <&dmac 13>, <&dmac 12>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&uart4m0_xfer>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + uart5: serial@ff5a0000 { + compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart"; + reg = <0xff5a0000 0x100>; + interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART5>, <&cru PCLK_UART5>; + clock-names = "baudclk", "apb_pclk"; + dmas = <&dmac 15>, <&dmac 14>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&uart5m0_xfer>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + saradc: adc@ff5e0000 { + compatible = "rockchip,rv1126-saradc", "rockchip,rk3399-saradc"; + reg = <0xff5e0000 0x100>; + interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>; + #io-channel-cells = <1>; + clocks = <&cru CLK_SARADC>, <&cru PCLK_SARADC>; + clock-names = "saradc", "apb_pclk"; + resets = <&cru SRST_SARADC_P>; + reset-names = "saradc-apb"; + status = "disabled"; + }; + + timer0: timer@ff660000 { + compatible = "rockchip,rv1126-timer", "rockchip,rk3288-timer"; + reg = <0xff660000 0x20>; + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_TIMER>, <&cru CLK_TIMER0>; + clock-names = "pclk", "timer"; + }; + + emmc: mmc@ffc50000 { + compatible = "rockchip,rv1126-dw-mshc", "rockchip,rk3288-dw-mshc"; + reg = <0xffc50000 0x4000>; + interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_EMMC>, <&cru CLK_EMMC>, + <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; + fifo-depth = <0x100>; + max-frequency = <200000000>; + power-domains = <&power RV1126_PD_NVM>; + status = "disabled"; + }; + + sdmmc: mmc@ffc60000 { + compatible = "rockchip,rv1126-dw-mshc", "rockchip,rk3288-dw-mshc"; + reg = <0xffc60000 0x4000>; + interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_SDMMC>, <&cru CLK_SDMMC>, + <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; + fifo-depth = <0x100>; + max-frequency = <200000000>; + status = "disabled"; + }; + + sdio: mmc@ffc70000 { + compatible = "rockchip,rv1126-dw-mshc", "rockchip,rk3288-dw-mshc"; + reg = <0xffc70000 0x4000>; + interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_SDIO>, <&cru CLK_SDIO>, + <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; + fifo-depth = <0x100>; + max-frequency = <200000000>; + power-domains = <&power RV1126_PD_SDIO>; + status = "disabled"; + }; + + pinctrl: pinctrl { + compatible = "rockchip,rv1126-pinctrl"; + rockchip,grf = <&grf>; + rockchip,pmu = <&pmugrf>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + gpio0: gpio@ff460000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff460000 0x100>; + interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&pmucru PCLK_GPIO0>, <&pmucru DBCLK_GPIO0>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio1: gpio@ff620000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff620000 0x100>; + interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO1>, <&cru DBCLK_GPIO1>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio2: gpio@ff630000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff630000 0x100>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO2>, <&cru DBCLK_GPIO2>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio3: gpio@ff640000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff640000 0x100>; + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO3>, <&cru DBCLK_GPIO3>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio4: gpio@ff650000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff650000 0x100>; + interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO4>, <&cru DBCLK_GPIO4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + }; +}; + +#include "rv1126-pinctrl.dtsi"
Signature · 1 line
2.25.1
Re: [PATCH v4 18/25] ARM: dts: rockchip: Add Rockchip RV1126 SoC
Quoted 8 lines · Jagan Teki
RV1126 is a high-performance vision processor SoC for IPC/CVR, especially for AI related application.
It is based on quad-core ARM Cortex-A7 32-bit core which integrates NEON and FPU. There is a 32KB I-cache and 32KB D-cache for each core and 512KB unified L2 cache. It has build-in NPU supports INT8/INT16 hybrid operation and computing power is up to 2.0TOPs.
Quoted 5 lines
This patch add basic core dtsi support.
Signed-off-by Jon Lin <[email protected]>Signed-off-by Sugar Zhang <[email protected]>Signed-off-by Jagan Teki <[email protected]>
Thanks,
- Kever
Quoted 456 lines
---
Changes for v4:
- pick changes from linux
Changes for v3:
- collect Kever r-b
Changes for v2:
- nonearch/arm/dts/rv1126.dtsi | 438 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 438 insertions(+)create mode 100644
arch/arm/dts/rv1126.dtsiarch/arm/dts/rv1126.dtsi new file +438
-0@@ -0,0 +1,438 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd. + */ + +#include <dt-bindings/clock/rockchip,rv1126-cru.h> +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/pinctrl/rockchip.h> +#include <dt-bindings/power/rockchip,rv1126-power.h> +#include <dt-bindings/soc/rockchip,boot-mode.h> + +/ { + #address-cells = <1>; + #size-cells = <1>; + + compatible = "rockchip,rv1126"; + + interrupt-parent = <&gic>; + + aliases { + i2c0 = &i2c0; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu0: cpu@f00 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf00>; + enable-method = "psci"; + clocks = <&cru ARMCLK>; + }; + + cpu1: cpu@f01 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf01>; + enable-method = "psci"; + clocks = <&cru ARMCLK>; + }; + + cpu2: cpu@f02 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf02>; + enable-method = "psci"; + clocks = <&cru ARMCLK>; + }; + + cpu3: cpu@f03 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf03>; + enable-method = "psci"; + clocks = <&cru ARMCLK>; + }; + }; + + arm-pmu { + compatible = "arm,cortex-a7-pmu"; + interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>; + interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>; + }; + + psci { + compatible = "arm,psci-1.0"; + method = "smc"; + }; + + timer { + compatible = "arm,armv7-timer"; + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; + clock-frequency = <24000000>; + }; + + xin24m: oscillator { + compatible = "fixed-clock"; + clock-frequency = <24000000>; + clock-output-names = "xin24m"; + #clock-cells = <0>; + }; + + grf: syscon@fe000000 { + compatible = "rockchip,rv1126-grf", "syscon", "simple-mfd"; + reg = <0xfe000000 0x20000>; + }; + + pmugrf: syscon@fe020000 { + compatible = "rockchip,rv1126-pmugrf", "syscon", "simple-mfd"; + reg = <0xfe020000 0x1000>; + + pmu_io_domains: io-domains { + compatible = "rockchip,rv1126-pmu-io-voltage-domain"; + status = "disabled"; + }; + }; + + qos_emmc: qos@fe860000 { + compatible = "rockchip,rv1126-qos", "syscon"; + reg = <0xfe860000 0x20>; + }; + + qos_nandc: qos@fe860080 { + compatible = "rockchip,rv1126-qos", "syscon"; + reg = <0xfe860080 0x20>; + }; + + qos_sfc: qos@fe860200 { + compatible = "rockchip,rv1126-qos", "syscon"; + reg = <0xfe860200 0x20>; + }; + + qos_sdio: qos@fe86c000 { + compatible = "rockchip,rv1126-qos", "syscon"; + reg = <0xfe86c000 0x20>; + }; + + gic: interrupt-controller@feff0000 { + compatible = "arm,gic-400"; + interrupt-controller; + #interrupt-cells = <3>; + #address-cells = <0>; + + reg = <0xfeff1000 0x1000>, + <0xfeff2000 0x2000>, + <0xfeff4000 0x2000>, + <0xfeff6000 0x2000>; + interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; + }; + + pmu: power-management@ff3e0000 { + compatible = "rockchip,rv1126-pmu", "syscon", "simple-mfd"; + reg = <0xff3e0000 0x1000>; + + power: power-controller { + compatible = "rockchip,rv1126-power-controller"; + #power-domain-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; + + power-domain@RV1126_PD_NVM { + reg = <RV1126_PD_NVM>; + clocks = <&cru HCLK_EMMC>, + <&cru CLK_EMMC>, + <&cru HCLK_NANDC>, + <&cru CLK_NANDC>, + <&cru HCLK_SFC>, + <&cru HCLK_SFCXIP>, + <&cru SCLK_SFC>; + pm_qos = <&qos_emmc>, + <&qos_nandc>, + <&qos_sfc>; + #power-domain-cells = <0>; + }; + + power-domain@RV1126_PD_SDIO { + reg = <RV1126_PD_SDIO>; + clocks = <&cru HCLK_SDIO>, + <&cru CLK_SDIO>; + pm_qos = <&qos_sdio>; + #power-domain-cells = <0>; + }; + }; + }; + + i2c0: i2c@ff3f0000 { + compatible = "rockchip,rv1126-i2c", "rockchip,rk3399-i2c"; + reg = <0xff3f0000 0x1000>; + interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>; + rockchip,grf = <&pmugrf>; + clocks = <&pmucru CLK_I2C0>, <&pmucru PCLK_I2C0>; + clock-names = "i2c", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_xfer>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + uart1: serial@ff410000 { + compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart"; + reg = <0xff410000 0x100>; + interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <24000000>; + clocks = <&pmucru SCLK_UART1>, <&pmucru PCLK_UART1>; + clock-names = "baudclk", "apb_pclk"; + dmas = <&dmac 7>, <&dmac 6>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&uart1m0_xfer>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + pmucru: clock-controller@ff480000 { + compatible = "rockchip,rv1126-pmucru"; + reg = <0xff480000 0x1000>; + rockchip,grf = <&grf>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + cru: clock-controller@ff490000 { + compatible = "rockchip,rv1126-cru"; + reg = <0xff490000 0x1000>; + clocks = <&xin24m>; + clock-names = "xin24m"; + rockchip,grf = <&grf>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + dmac: dma-controller@ff4e0000 { + compatible = "arm,pl330", "arm,primecell"; + reg = <0xff4e0000 0x4000>; + interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>; + #dma-cells = <1>; + arm,pl330-periph-burst; + clocks = <&cru ACLK_DMAC>; + clock-names = "apb_pclk"; + }; + + uart0: serial@ff560000 { + compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart"; + reg = <0xff560000 0x100>; + interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>; + clock-names = "baudclk", "apb_pclk"; + dmas = <&dmac 5>, <&dmac 4>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&uart0_xfer>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + uart2: serial@ff570000 { + compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart"; + reg = <0xff570000 0x100>; + interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART2>, <&cru PCLK_UART2>; + clock-names = "baudclk", "apb_pclk"; + dmas = <&dmac 9>, <&dmac 8>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&uart2m1_xfer>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + uart3: serial@ff580000 { + compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart"; + reg = <0xff580000 0x100>; + interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART3>, <&cru PCLK_UART3>; + clock-names = "baudclk", "apb_pclk"; + dmas = <&dmac 11>, <&dmac 10>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&uart3m0_xfer>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + uart4: serial@ff590000 { + compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart"; + reg = <0xff590000 0x100>; + interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART4>, <&cru PCLK_UART4>; + clock-names = "baudclk", "apb_pclk"; + dmas = <&dmac 13>, <&dmac 12>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&uart4m0_xfer>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + uart5: serial@ff5a0000 { + compatible = "rockchip,rv1126-uart", "snps,dw-apb-uart"; + reg = <0xff5a0000 0x100>; + interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <24000000>; + clocks = <&cru SCLK_UART5>, <&cru PCLK_UART5>; + clock-names = "baudclk", "apb_pclk"; + dmas = <&dmac 15>, <&dmac 14>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&uart5m0_xfer>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + saradc: adc@ff5e0000 { + compatible = "rockchip,rv1126-saradc", "rockchip,rk3399-saradc"; + reg = <0xff5e0000 0x100>; + interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>; + #io-channel-cells = <1>; + clocks = <&cru CLK_SARADC>, <&cru PCLK_SARADC>; + clock-names = "saradc", "apb_pclk"; + resets = <&cru SRST_SARADC_P>; + reset-names = "saradc-apb"; + status = "disabled"; + }; + + timer0: timer@ff660000 { + compatible = "rockchip,rv1126-timer", "rockchip,rk3288-timer"; + reg = <0xff660000 0x20>; + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_TIMER>, <&cru CLK_TIMER0>; + clock-names = "pclk", "timer"; + }; + + emmc: mmc@ffc50000 { + compatible = "rockchip,rv1126-dw-mshc", "rockchip,rk3288-dw-mshc"; + reg = <0xffc50000 0x4000>; + interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_EMMC>, <&cru CLK_EMMC>, + <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; + fifo-depth = <0x100>; + max-frequency = <200000000>; + power-domains = <&power RV1126_PD_NVM>; + status = "disabled"; + }; + + sdmmc: mmc@ffc60000 { + compatible = "rockchip,rv1126-dw-mshc", "rockchip,rk3288-dw-mshc"; + reg = <0xffc60000 0x4000>; + interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_SDMMC>, <&cru CLK_SDMMC>, + <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; + fifo-depth = <0x100>; + max-frequency = <200000000>; + status = "disabled"; + }; + + sdio: mmc@ffc70000 { + compatible = "rockchip,rv1126-dw-mshc", "rockchip,rk3288-dw-mshc"; + reg = <0xffc70000 0x4000>; + interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_SDIO>, <&cru CLK_SDIO>, + <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; + fifo-depth = <0x100>; + max-frequency = <200000000>; + power-domains = <&power RV1126_PD_SDIO>; + status = "disabled"; + }; + + pinctrl: pinctrl { + compatible = "rockchip,rv1126-pinctrl"; + rockchip,grf = <&grf>; + rockchip,pmu = <&pmugrf>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + gpio0: gpio@ff460000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff460000 0x100>; + interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&pmucru PCLK_GPIO0>, <&pmucru DBCLK_GPIO0>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio1: gpio@ff620000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff620000 0x100>; + interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO1>, <&cru DBCLK_GPIO1>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio2: gpio@ff630000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff630000 0x100>; + interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO2>, <&cru DBCLK_GPIO2>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio3: gpio@ff640000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff640000 0x100>; + interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO3>, <&cru DBCLK_GPIO3>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gpio4: gpio@ff650000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff650000 0x100>; + interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO4>, <&cru DBCLK_GPIO4>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + }; +}; + +#include "rv1126-pinctrl.dtsi"
PATCH v4 19/25 arm: rockchip: Add RV1126 arch core support
In reply to Jagan TekiRockchip RV1126 is a high-performance vision processor SoC for IPC/CVR, especially for AI related application.
Add arch core support for it.
---
Changes for v4:
- drop MONITOR_LEN config
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
arch/arm/include/asm/arch-rv1126/boot0.h | 11 ++++ arch/arm/include/asm/arch-rv1126/gpio.h | 11 ++++ arch/arm/mach-rockchip/Kconfig | 46 ++++++++++++++ arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/rv1126/Kconfig | 43 +++++++++++++ arch/arm/mach-rockchip/rv1126/Makefile | 13 ++++ arch/arm/mach-rockchip/rv1126/clk_rv1126.c | 33 ++++++++++ arch/arm/mach-rockchip/rv1126/rv1126.c | 63 +++++++++++++++++++ arch/arm/mach-rockchip/rv1126/syscon_rv1126.c | 47 ++++++++++++++ common/spl/Kconfig.tpl | 2 +- include/configs/rv1126_common.h | 40 ++++++++++++ 11 files changed, 309 insertions(+), 1 deletion(-) create mode 100644 arch/arm/include/asm/arch-rv1126/boot0.h create mode 100644 arch/arm/include/asm/arch-rv1126/gpio.h create mode 100644 arch/arm/mach-rockchip/rv1126/Kconfig create mode 100644 arch/arm/mach-rockchip/rv1126/Makefile create mode 100644 arch/arm/mach-rockchip/rv1126/clk_rv1126.c create mode 100644 arch/arm/mach-rockchip/rv1126/rv1126.c create mode 100644 arch/arm/mach-rockchip/rv1126/syscon_rv1126.c create mode 100644 include/configs/rv1126_common.h
arch/arm/include/asm/arch-rv1126/boot0.h new file +11 -0
@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2019 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-rv1126/gpio.h new file +11 -0
@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2019 Rockchip Electronics Co., Ltd +*/ + +#ifndef __ASM_ARCH_GPIO_H__ +#define __ASM_ARCH_GPIO_H__ + +#include <asm/arch-rockchip/gpio.h> + +#endif
arch/arm/mach-rockchip/Kconfig +46 -0
56 lines not on this page · raw message
arch/arm/mach-rockchip/Makefile +1 -0
@@ -45,6 +45,7 @@ obj-$(CONFIG_ROCKCHIP_RK3368) += rk3368/ obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399/ obj-$(CONFIG_ROCKCHIP_RK3568) += rk3568/ obj-$(CONFIG_ROCKCHIP_RV1108) += rv1108/ +obj-$(CONFIG_ROCKCHIP_RV1126) += rv1126/ # Clear out SPL objects, in case this is a TPL build obj-spl-$(CONFIG_TPL_BUILD) =
arch/arm/mach-rockchip/rv1126/Kconfig new file +43 -0
43 lines not on this page · raw message
arch/arm/mach-rockchip/rv1126/Makefile new file +13 -0
@@ -0,0 +1,13 @@ +# +# (C) Copyright 2019 Rockchip Electronics Co., Ltd +# Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += rv1126.o + +ifndef CONFIG_TPL_BUILD +obj-y += clk_rv1126.o +obj-y += syscon_rv1126.o +endif
arch/arm/mach-rockchip/rv1126/clk_rv1126.c new file +33 -0
@@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd +* Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. +*/ + +#include <common.h> +#include <dm.h> +#include <syscon.h> +#include <asm/arch-rockchip/clock.h> +#include <asm/arch-rockchip/cru_rv1126.h> +#include <linux/err.h> + +int rockchip_get_clk (struct udevice **devp) +{ +return uclass_get_device_by_driver (UCLASS_CLK , +DM_DRIVER_GET (rockchip_rv1126_cru), devp); +} + +void *rockchip_get_cru (void ) +{ +struct rv1126_clk_priv *priv; +struct udevice *dev; +int ret; + + ret =rockchip_get_clk (&dev); +if (ret) +return ERR_PTR (ret); + + priv =dev_get_priv (dev); + +return priv->cru; +}
arch/arm/mach-rockchip/rv1126/rv1126.c new file +63 -0
63 lines not on this page · raw message
arch/arm/mach-rockchip/rv1126/syscon_rv1126.c new file +47 -0
47 lines not on this page · raw message
common/spl/Kconfig.tpl +1 -1
@@ -132,7 +132,7 @@ config TPL_TEXT_BASE config TPL_MAX_SIZE hex "Maximum size (in bytes) for the TPL stage" default 0x2e000 if ROCKCHIP_RK3399 - default 0x8000 if ROCKCHIP_RK3288 + default 0x8000 if ROCKCHIP_RK3288 || ROCKCHIP_RV1126 default 0x7000 if ROCKCHIP_RK322X || ROCKCHIP_RK3328 || ROCKCHIP_RK3368 default 0x2800 if ROCKCHIP_PX30 default 0x0
include/configs/rv1126_common.h new file +40 -0
@@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* (C) Copyright 2019 Rockchip Electronics Co., Ltd +* Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. +*/ + +#ifndef __CONFIG_RV1126_COMMON_H +#define __CONFIG_RV1126_COMMON_H + +#include "rockchip-common.h" + +#define CONFIG_SYS_HZ_CLOCK 24000000 + +#define CONFIG_IRAM_BASE 0xff700000 + +#define GICD_BASE 0xfeff1000 +#define GICC_BASE 0xfeff2000 + +#define CONFIG_SYS_SDRAM_BASE 0 +#define SDRAM_MAX_SIZE 0xfd000000 + +/* memory size > 128MB */ +#define ENV_MEM_LAYOUT_SETTINGS \ + "scriptaddr=0x00000000\0" \ + "pxefile_addr_r=0x00100000\0" \ + "fdt_addr_r=0x08300000\0" \ + "kernel_addr_r=0x02008000\0" \ + "ramdisk_addr_r=0x0a200000\0" + +#include <config_distro_bootcmd.h> +#define CONFIG_EXTRA_ENV_SETTINGS \ + "fdt_high=0x0fffffff\0" \ + "initrd_high=0x0fffffff\0" \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ + "partitions=" PARTS_DEFAULT \ + ENV_MEM_LAYOUT_SETTINGS \ + ROCKCHIP_DEVICE_SETTINGS \ + BOOTENV + +#endif /* __CONFIG_RV1126_COMMON_H */
Signature · 1 line
2.25.1
PATCH v4 20/25 arm: rockchip: rv1126: Set dram area unsecure for SPL
In reply to Jagan TekiUnsecure the dram area so that MMC, USB, and SFC controllers can able to read data from dram.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
arch/arm/mach-rockchip/rv1126/rv1126.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm/mach-rockchip/rv1126/rv1126.c +12 -0
@@ -10,6 +10,8 @@#include <asm/arch-rockchip/hardware.h> #include <asm/arch-rockchip/grf_rv1126.h> +#define FIREWALL_APB_BASE 0xffa60000 +#define FW_DDR_CON_REG 0x80#define GRF_BASE 0xFE000000const char *const boot_devices[BROM_LAST_BOOTSOURCE +1 ] = {
@@ -58,6 +60,16 @@ void board_debug_uart_init(void)#ifndef CONFIG_TPL_BUILD int arch_cpu_init (void ) { +/** +* Set dram area unsecure in spl +* +* usb & mmc & sfc controllers can read data to dram +* since they are unsecure. +* (Note: only secure-world can access this register) +*/ +if (IS_ENABLED (CONFIG_SPL_BUILD )) +writel (0 ,FIREWALL_APB_BASE +FW_DDR_CON_REG ); +return 0 ; }#endif
Signature · 1 line
2.25.1
PATCH v4 21/25 rockchip: mkimage: Add rv1126 support
In reply to Jagan TekiAdd support for rv1126 package header in mkimage tool.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
tools/rkcommon.c | 1 + 1 file changed, 1 insertion(+)
tools/rkcommon.c +1 -0
@@ -133,6 +133,7 @@ static struct spl_info spl_infos[] = { { "rk3368", "RK33", 0x8000 - 0x1000, false, RK_HEADER_V1 }, { "rk3399", "RK33", 0x30000 - 0x2000, false, RK_HEADER_V1 }, { "rv1108", "RK11", 0x1800, false, RK_HEADER_V1 }, + { "rv1126", "110B", 0x10000 - 0x1000, false, RK_HEADER_V1 }, { "rk3568", "RK35", 0x14000 - 0x1000, false, RK_HEADER_V2 }, };
Signature · 1 line
2.25.1
PATCH v4 22/25 ARM: dts: rockchip: rv1126: Add Edgeble Neural Compute Module 2(Neu2)
In reply to Jagan TekiNeural Compute Module 2(Neu2) is a 96boards SoM-CB compute module based on Rockchip RV1126 from Edgeble AI.
General features:
- Rockchip RV1126
- 2/4GB LPDDR4
- 8/16/32GB eMMC
- 2x MIPI CSI2 FPC connector
- Fn-link 8223A-SR WiFi/BT
Industrial grade (-40 °C to +85 °C) version of the same class of module called Neu2k powered with Rockchip RV1126K.
Neu2 needs to mount on top of Edgeble IO boards for creating complete platform solutions.
Add support for it.
---
Changes for v4:
- pick changes from linux
Changes for v3:
- rebase on linux
Changes for v2:
- none
arch/arm/dts/rv1126-edgeble-neu2.dtsi | 338 ++++++++++++++++++++++++++ 1 file changed, 338 insertions(+) create mode 100644 arch/arm/dts/rv1126-edgeble-neu2.dtsi
arch/arm/dts/rv1126-edgeble-neu2.dtsi new file +338 -0
@@ -0,0 +1,338 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2020 Rockchip Electronics Co., Ltd. + * Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. + */ + +/ { + compatible = "edgeble,neural-compute-module-2", "rockchip,rv1126"; + + aliases { + mmc0 = &emmc; + }; + + vcc5v0_sys: vcc5v0-sys-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + + vccio_flash: vccio-flash-regulator { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&flash_vol_sel>; + regulator-name = "vccio_flash"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&vcc_3v3>; + }; + + sdio_pwrseq: pwrseq-sdio { + compatible = "mmc-pwrseq-simple"; + clocks = <&rk809 1>; + clock-names = "ext_clock"; + pinctrl-names = "default"; + pinctrl-0 = <&wifi_enable_h>; + reset-gpios = <&gpio1 RK_PD0 GPIO_ACTIVE_LOW>; + }; +}; + +&cpu0 { + cpu-supply = <&vdd_arm>; +}; + +&emmc { + bus-width = <8>; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&emmc_bus8 &emmc_cmd &emmc_clk &emmc_rstnout>; + rockchip,default-sample-phase = <90>; + vmmc-supply = <&vcc_3v3>; + vqmmc-supply = <&vccio_flash>; + status = "okay"; +}; + +&i2c0 { + clock-frequency = <400000>; + status = "okay"; + + rk809: pmic@20 { + compatible = "rockchip,rk809"; + reg = <0x20>; + interrupt-parent = <&gpio0>; + interrupts = <RK_PB1 IRQ_TYPE_LEVEL_LOW>; + #clock-cells = <1>; + clock-output-names = "rk808-clkout1", "rk808-clkout2"; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>; + rockchip,system-power-controller; + wakeup-source; + + vcc1-supply = <&vcc5v0_sys>; + vcc2-supply = <&vcc5v0_sys>; + vcc3-supply = <&vcc5v0_sys>; + vcc4-supply = <&vcc5v0_sys>; + vcc5-supply = <&vcc_buck5>; + vcc6-supply = <&vcc_buck5>; + vcc7-supply = <&vcc5v0_sys>; + vcc8-supply = <&vcc3v3_sys>; + vcc9-supply = <&vcc5v0_sys>; + + regulators { + vdd_npu_vepu: DCDC_REG1 { + regulator-name = "vdd_npu_vepu"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <650000>; + regulator-max-microvolt = <950000>; + regulator-ramp-delay = <6001>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_arm: DCDC_REG2 { + regulator-name = "vdd_arm"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <725000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name = "vcc_ddr"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + vcc3v3_sys: DCDC_REG4 { + regulator-name = "vcc3v3_sys"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcc_buck5: DCDC_REG5 { + regulator-name = "vcc_buck5"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <2200000>; + regulator-max-microvolt = <2200000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <2200000>; + }; + }; + + vcc_0v8: LDO_REG1 { + regulator-name = "vcc_0v8"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <800000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc1v8_pmu: LDO_REG2 { + regulator-name = "vcc1v8_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vdd0v8_pmu: LDO_REG3 { + regulator-name = "vcc0v8_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <800000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <800000>; + }; + }; + + vcc_1v8: LDO_REG4 { + regulator-name = "vcc_1v8"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcc_dovdd: LDO_REG5 { + regulator-name = "vcc_dovdd"; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_dvdd: LDO_REG6 { + regulator-name = "vcc_dvdd"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_avdd: LDO_REG7 { + regulator-name = "vcc_avdd"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vccio_sd: LDO_REG8 { + regulator-name = "vccio_sd"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v3_sd: LDO_REG9 { + regulator-name = "vcc3v3_sd"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_5v0: SWITCH_REG1 { + regulator-name = "vcc_5v0"; + }; + + vcc_3v3: SWITCH_REG2 { + regulator-name = "vcc_3v3"; + regulator-always-on; + regulator-boot-on; + }; + }; + }; +}; + +&pinctrl { + bt { + bt_enable: bt-enable { + rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + flash { + flash_vol_sel: flash-vol-sel { + rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + pmic { + pmic_int_l: pmic-int-l { + rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + wifi { + wifi_enable_h: wifi-enable-h { + rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; + +&pmu_io_domains { + pmuio0-supply = <&vcc1v8_pmu>; + pmuio1-supply = <&vcc3v3_sys>; + vccio1-supply = <&vccio_flash>; + vccio2-supply = <&vccio_sd>; + vccio3-supply = <&vcc_1v8>; + vccio4-supply = <&vcc_dovdd>; + vccio5-supply = <&vcc_1v8>; + vccio6-supply = <&vcc_1v8>; + vccio7-supply = <&vcc_dovdd>; + status = "okay"; +}; + +&saradc { + vref-supply = <&vcc_1v8>; + status = "okay"; +}; + +&sdio { + bus-width = <4>; + cap-sd-highspeed; + cap-sdio-irq; + keep-power-in-suspend; + max-frequency = <100000000>; + mmc-pwrseq = <&sdio_pwrseq>; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc1_clk &sdmmc1_cmd &sdmmc1_bus4>; + rockchip,default-sample-phase = <90>; + sd-uhs-sdr104; + vmmc-supply = <&vcc3v3_sys>; + vqmmc-supply = <&vcc_1v8>; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_xfer &uart0_ctsn &uart0_rtsn>; + status = "okay"; + + bluetooth { + compatible = "qcom,qca9377-bt"; + clocks = <&rk809 1>; + enable-gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; /* BT_RST */ + max-speed = <2000000>; + pinctrl-names = "default"; + pinctrl-0 = <&bt_enable>; + vddxo-supply = <&vcc3v3_sys>; + vddio-supply = <&vcc_1v8>; + }; +};
Signature · 1 line
2.25.1
Re: [PATCH v4 22/25] ARM: dts: rockchip: rv1126: Add Edgeble Neural Compute Module 2(Neu2)
Quoted 13 lines · Jagan Teki
Neural Compute Module 2(Neu2) is a 96boards SoM-CB compute module based on Rockchip RV1126 from Edgeble AI.
General features:
- Rockchip RV1126
- 2/4GB LPDDR4
- 8/16/32GB eMMC
- 2x MIPI CSI2 FPC connector
- Fn-link 8223A-SR WiFi/BTIndustrial grade (-40 °C to +85 °C) version of the same class of module called Neu2k powered with Rockchip RV1126K.
Quoted 6 lines
Neu2 needs to mount on top of Edgeble IO boards for creating complete platform solutions.
Add support for it.
Signed-off-by Jagan Teki <[email protected]>
Thanks,
- Kever
Quoted 356 lines
---
Changes for v4:
- pick changes from linux
Changes for v3:
- rebase on linux
Changes for v2:
- nonearch/arm/dts/rv1126-edgeble-neu2.dtsi | 338 ++++++++++++++++++++++++++ 1 file changed, 338 insertions(+)create mode 100644
arch/arm/dts/rv1126-edgeble-neu2.dtsiarch/arm/dts/rv1126-edgeble-neu2.dtsi new file +338
-0@@ -0,0 +1,338 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2020 Rockchip Electronics Co., Ltd. + * Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. + */ + +/ { + compatible = "edgeble,neural-compute-module-2", "rockchip,rv1126"; + + aliases { + mmc0 = &emmc; + }; + + vcc5v0_sys: vcc5v0-sys-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + + vccio_flash: vccio-flash-regulator { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&flash_vol_sel>; + regulator-name = "vccio_flash"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&vcc_3v3>; + }; + + sdio_pwrseq: pwrseq-sdio { + compatible = "mmc-pwrseq-simple"; + clocks = <&rk809 1>; + clock-names = "ext_clock"; + pinctrl-names = "default"; + pinctrl-0 = <&wifi_enable_h>; + reset-gpios = <&gpio1 RK_PD0 GPIO_ACTIVE_LOW>; + }; +}; + +&cpu0 { + cpu-supply = <&vdd_arm>; +}; + +&emmc { + bus-width = <8>; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&emmc_bus8 &emmc_cmd &emmc_clk &emmc_rstnout>; + rockchip,default-sample-phase = <90>; + vmmc-supply = <&vcc_3v3>; + vqmmc-supply = <&vccio_flash>; + status = "okay"; +}; + +&i2c0 { + clock-frequency = <400000>; + status = "okay"; + + rk809: pmic@20 { + compatible = "rockchip,rk809"; + reg = <0x20>; + interrupt-parent = <&gpio0>; + interrupts = <RK_PB1 IRQ_TYPE_LEVEL_LOW>; + #clock-cells = <1>; + clock-output-names = "rk808-clkout1", "rk808-clkout2"; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>; + rockchip,system-power-controller; + wakeup-source; + + vcc1-supply = <&vcc5v0_sys>; + vcc2-supply = <&vcc5v0_sys>; + vcc3-supply = <&vcc5v0_sys>; + vcc4-supply = <&vcc5v0_sys>; + vcc5-supply = <&vcc_buck5>; + vcc6-supply = <&vcc_buck5>; + vcc7-supply = <&vcc5v0_sys>; + vcc8-supply = <&vcc3v3_sys>; + vcc9-supply = <&vcc5v0_sys>; + + regulators { + vdd_npu_vepu: DCDC_REG1 { + regulator-name = "vdd_npu_vepu"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <650000>; + regulator-max-microvolt = <950000>; + regulator-ramp-delay = <6001>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_arm: DCDC_REG2 { + regulator-name = "vdd_arm"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <725000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name = "vcc_ddr"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + vcc3v3_sys: DCDC_REG4 { + regulator-name = "vcc3v3_sys"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcc_buck5: DCDC_REG5 { + regulator-name = "vcc_buck5"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <2200000>; + regulator-max-microvolt = <2200000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <2200000>; + }; + }; + + vcc_0v8: LDO_REG1 { + regulator-name = "vcc_0v8"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <800000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc1v8_pmu: LDO_REG2 { + regulator-name = "vcc1v8_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vdd0v8_pmu: LDO_REG3 { + regulator-name = "vcc0v8_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <800000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <800000>; + }; + }; + + vcc_1v8: LDO_REG4 { + regulator-name = "vcc_1v8"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcc_dovdd: LDO_REG5 { + regulator-name = "vcc_dovdd"; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_dvdd: LDO_REG6 { + regulator-name = "vcc_dvdd"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_avdd: LDO_REG7 { + regulator-name = "vcc_avdd"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vccio_sd: LDO_REG8 { + regulator-name = "vccio_sd"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v3_sd: LDO_REG9 { + regulator-name = "vcc3v3_sd"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_5v0: SWITCH_REG1 { + regulator-name = "vcc_5v0"; + }; + + vcc_3v3: SWITCH_REG2 { + regulator-name = "vcc_3v3"; + regulator-always-on; + regulator-boot-on; + }; + }; + }; +}; + +&pinctrl { + bt { + bt_enable: bt-enable { + rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + flash { + flash_vol_sel: flash-vol-sel { + rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + pmic { + pmic_int_l: pmic-int-l { + rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + wifi { + wifi_enable_h: wifi-enable-h { + rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; + +&pmu_io_domains { + pmuio0-supply = <&vcc1v8_pmu>; + pmuio1-supply = <&vcc3v3_sys>; + vccio1-supply = <&vccio_flash>; + vccio2-supply = <&vccio_sd>; + vccio3-supply = <&vcc_1v8>; + vccio4-supply = <&vcc_dovdd>; + vccio5-supply = <&vcc_1v8>; + vccio6-supply = <&vcc_1v8>; + vccio7-supply = <&vcc_dovdd>; + status = "okay"; +}; + +&saradc { + vref-supply = <&vcc_1v8>; + status = "okay"; +}; + +&sdio { + bus-width = <4>; + cap-sd-highspeed; + cap-sdio-irq; + keep-power-in-suspend; + max-frequency = <100000000>; + mmc-pwrseq = <&sdio_pwrseq>; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc1_clk &sdmmc1_cmd &sdmmc1_bus4>; + rockchip,default-sample-phase = <90>; + sd-uhs-sdr104; + vmmc-supply = <&vcc3v3_sys>; + vqmmc-supply = <&vcc_1v8>; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_xfer &uart0_ctsn &uart0_rtsn>; + status = "okay"; + + bluetooth { + compatible = "qcom,qca9377-bt"; + clocks = <&rk809 1>; + enable-gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; /* BT_RST */ + max-speed = <2000000>; + pinctrl-names = "default"; + pinctrl-0 = <&bt_enable>; + vddxo-supply = <&vcc3v3_sys>; + vddio-supply = <&vcc_1v8>; + }; +};
PATCH v4 23/25 ARM: dts: rockchip: rv1126: Add Edgeble Neural Compute Module 2(Neu2) IO
In reply to Jagan TekiNeural Compute Module 2(Neu2) IO board is an industrial form factor evaluation board from Edgeble AI.
General features:
- microSD slot
- MIPI DSI connector
- 2x USB Host
- 1x USB OTG
- Ethernet
- mini PCIe
- Onboard PoE
- RS485, RS232, CAN
- Micro Phone array
- Speaker
- RTC battery slot
- 40-pin expansion
Neu2 needs to mount on top of this IO board in order to create complete Edgeble Neural Compute Module 2(Neu2) IO platform.
Add support for it.
---
Changes for v4:
- pick changes from linux
Changes for v3:
- rebase on linux
Changes for v2:
- none
arch/arm/dts/Makefile | 3 ++ arch/arm/dts/rv1126-edgeble-neu2-io.dts | 42 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 arch/arm/dts/rv1126-edgeble-neu2-io.dts
arch/arm/dts/Makefile +3 -0
@@ -170,6 +170,9 @@ dtb-$(CONFIG_ROCKCHIP_RV1108) += \ rv1108-elgin-r1.dtb \ rv1108-evb.dtb +dtb-$(CONFIG_ROCKCHIP_RV1126) += \ + rv1126-edgeble-neu2-io.dtb + dtb-$(CONFIG_ARCH_S5P4418) += \ s5p4418-nanopi2.dtb
arch/arm/dts/rv1126-edgeble-neu2-io.dts new file +42 -0
42 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH v4 23/25] ARM: dts: rockchip: rv1126: Add Edgeble Neural Compute Module 2(Neu2) IO
Quoted 17 lines · Jagan Teki
Neural Compute Module 2(Neu2) IO board is an industrial form factor evaluation board from Edgeble AI.
General features:
- microSD slot
- MIPI DSI connector
- 2x USB Host
- 1x USB OTG
- Ethernet
- mini PCIe
- Onboard PoE
- RS485, RS232, CAN
- Micro Phone array
- Speaker
- RTC battery slot
- 40-pin expansion
Quoted 6 lines
Neu2 needs to mount on top of this IO board in order to create complete Edgeble Neural Compute Module 2(Neu2) IO platform.
Add support for it.
Signed-off-by Jagan Teki <[email protected]>
Thanks,
- Kever
Quoted 75 lines
---
Changes for v4:
- pick changes from linux
Changes for v3:
- rebase on linux
Changes for v2:
- nonearch/arm/dts/Makefile | 3 ++ arch/arm/dts/rv1126-edgeble-neu2-io.dts | 42 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+)create mode 100644
arch/arm/dts/rv1126-edgeble-neu2-io.dtsarch/arm/dts/Makefile +3
-0@@ -170,6 +170,9 @@ dtb-$(CONFIG_ROCKCHIP_RV1108) += \ rv1108-elgin-r1.dtb \ rv1108-evb.dtb +dtb-$(CONFIG_ROCKCHIP_RV1126) += \ + rv1126-edgeble-neu2-io.dtb + dtb-$(CONFIG_ARCH_S5P4418) += \ s5p4418-nanopi2.dtbarch/arm/dts/rv1126-edgeble-neu2-io.dts new file +42
-0@@ -0,0 +1,42 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2020 Rockchip Electronics Co., Ltd. + * Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. + */ + +/dts-v1/; +#include "rv1126.dtsi" +#include "rv1126-edgeble-neu2.dtsi" + +/ { + model = "Edgeble Neu2 IO Board"; + compatible = "edgeble,neural-compute-module-2-io", + "edgeble,neural-compute-module-2", "rockchip,rv1126"; + + aliases { + serial2 = &uart2; + }; + + chosen { + stdout-path = "serial2:1500000n8"; + }; +}; + +&sdmmc { + bus-width = <4>; + cap-mmc-highspeed; + cap-sd-highspeed; + card-detect-delay = <200>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_bus4 &sdmmc0_det>; + rockchip,default-sample-phase = <90>; + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr104; + vqmmc-supply = <&vccio_sd>; + status = "okay"; +}; + +&uart2 { + status = "okay"; +};
PATCH v4 24/25 ARM: dts: rockchip: Add rv1126-u-boot.dtsi
In reply to Jagan TekiAdd u-boot,dm-spl and u-boot,dm-pre-reloc related properties for Rockchip RV1126 SoC.
Both eMMC and SD boot are tested in Edgeble Neu2 SoM.
---
Changes for v4:
- none
Changes for v3:
- collect Kever r-b
Changes for v2:
- none
arch/arm/dts/rv1126-u-boot.dtsi | 62 +++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 arch/arm/dts/rv1126-u-boot.dtsi
arch/arm/dts/rv1126-u-boot.dtsi new file +62 -0
@@ -0,0 +1,62 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. + */ + +#include "rockchip-u-boot.dtsi" + +/ { + chosen { + u-boot,spl-boot-order = \ + "same-as-spl", &emmc, &sdmmc; + }; + + dmc { + compatible = "rockchip,rv1126-dmc"; + u-boot,dm-pre-reloc; + }; +}; + +&gpio0 { + u-boot,dm-spl; +}; + +&gpio1 { + u-boot,dm-spl; +}; + +&grf { + u-boot,dm-spl; +}; + +&pmu { + u-boot,dm-spl; +}; + +&pmugrf { + u-boot,dm-spl; +}; + +&xin24m { + u-boot,dm-spl; +}; + +&cru { + u-boot,dm-spl; +}; + +&pmucru { + u-boot,dm-spl; +}; + +&sdmmc { + u-boot,dm-spl; +}; + +&emmc { + u-boot,dm-spl; +}; + +&uart2 { + u-boot,dm-spl; +};
Signature · 1 line
2.25.1
PATCH v4 25/25 board: rockchip: Add Edgeble Neu2 IO Board
In reply to Jagan TekiNeural Compute Module 2(Neu2) IO board is an industrial form factor IO board from Edgeble AI.
General features:
- microSD slot
- MIPI DSI connector
- 2x USB Host
- 1x USB OTG
- Ethernet
- mini PCIe
- Onboard PoE
- RS485, RS232, CAN
- Micro Phone array
- Speaker
- RTC battery slot
- 40-pin expansion
Neu2 needs to mount on top of this IO board in order to create complete Edgeble Neural Compute Module 2(Neu2) IO platform.
Add support for it.
---
Changes for v4:
- add MONITOR_LEN config
Changes for v3:
- updated the board names
Changes for v2:
- none
.../dts/rv1126-edgeble-neu2-io-u-boot.dtsi | 10 ++++ arch/arm/mach-rockchip/rv1126/Kconfig | 16 ++++++ board/edgeble/neural-compute-module-2/Kconfig | 16 ++++++ .../neural-compute-module-2/MAINTAINERS | 6 ++ .../edgeble/neural-compute-module-2/Makefile | 7 +++ board/edgeble/neural-compute-module-2/neu2.c | 4 ++ configs/neu2-io-rv1126_defconfig | 57 +++++++++++++++++++ doc/board/rockchip/rockchip.rst | 3 + include/configs/neural-compute-module-2.h | 21 +++++++ 9 files changed, 140 insertions(+) create mode 100644 arch/arm/dts/rv1126-edgeble-neu2-io-u-boot.dtsi create mode 100644 board/edgeble/neural-compute-module-2/Kconfig create mode 100644 board/edgeble/neural-compute-module-2/MAINTAINERS create mode 100644 board/edgeble/neural-compute-module-2/Makefile create mode 100644 board/edgeble/neural-compute-module-2/neu2.c create mode 100644 configs/neu2-io-rv1126_defconfig create mode 100644 include/configs/neural-compute-module-2.h
arch/arm/dts/rv1126-edgeble-neu2-io-u-boot.dtsi new file +10 -0
@@ -0,0 +1,10 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. + */ + +#include "rv1126-u-boot.dtsi" + +&sdio { + status = "disabled"; +};
arch/arm/mach-rockchip/rv1126/Kconfig +16 -0
@@ -1,5 +1,19 @@ if ROCKCHIP_RV1126 +config TARGET_RV1126_NEU2 + bool "Edgeble Neural Compute Module 2(Neu2) SoM" + help + Neu2: + Neural Compute Module 2(Neu2) is a 96boards SoM-CB compute module + based on Rockchip RV1126 from Edgeble AI. + Neu2 powered with Consumer grade (0 to +80 °C) RV1126 SoC. + Neu2k powered with Industrial grade (-40 °C to +85 °C) RV1126K SoC. + + Neu2-IO: + Neural Compute Module 2(Neu2) IO board is an industrial form factor + IO board and Neu2 needs to mount on top of this IO board in order to + create complete Edgeble Neural Compute Module 2(Neu2) IO platform. + config SOC_SPECIFIC_OPTIONS # dummy def_bool y select HAS_CUSTOM_SYS_INIT_SP_ADDR
@@ -40,4 +54,6 @@ config SYS_MALLOC_F_LEN config TEXT_BASE default 0x600000 +source board/edgeble/neural-compute-module-2/Kconfig + endif
board/edgeble/neural-compute-module-2/Kconfig new file +16 -0
@@ -0,0 +1,16 @@ +if TARGET_RV1126_NEU2 + +config SYS_BOARD + default "neural-compute-module-2" + +config SYS_VENDOR + default "edgeble" + +config SYS_CONFIG_NAME + default "neural-compute-module-2" + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + select RAM_ROCKCHIP_LPDDR4 + +endif
board/edgeble/neural-compute-module-2/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +RV1126-ECM0 +M: Jagan Teki <[email protected]> +S: Maintained +F: board/edgeble/neural-compute-module-2 +F: include/configs/neural-compute-module-2.h +F: configs/neu2-io-rv1126_defconfig
board/edgeble/neural-compute-module-2/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += neu2.o
board/edgeble/neural-compute-module-2/neu2.c new file +4 -0
@@ -0,0 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. +*/
configs/neu2-io-rv1126_defconfig new file +57 -0
57 lines not on this page · raw message
doc/board/rockchip/rockchip.rst +3 -0
@@ -89,6 +89,9 @@ List of mainline supported Rockchip boards: - Rockchip Evb-rv1108 (evb-rv1108) - Elgin-R1 (elgin-rv1108) +* rv1126 + - Edgeble Neural Compute Module 2 SoM - Neu2/Neu2k (neu2-io-r1126) + Building --------
include/configs/neural-compute-module-2.h new file +21 -0
@@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. +*/ + +#ifndef __NEURAL_COMPUTE_MODULE_2_H +#define __NEURAL_COMPUTE_MODULE_2_H + +#define ROCKCHIP_DEVICE_SETTINGS \ + "stdout=serial,vidconsole\0" \ + "stderr=serial,vidconsole\0" + +#include <configs/rv1126_common.h> + +#undef BOOT_TARGET_DEVICES + +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) + +#endif /* __NEURAL_COMPUTE_MODULE_2_H */
Signature · 1 line
2.25.1
Re: [PATCH v4 25/25] board: rockchip: Add Edgeble Neu2 IO Board
Quoted 17 lines · Jagan Teki
Neural Compute Module 2(Neu2) IO board is an industrial form factor IO board from Edgeble AI.
General features:
- microSD slot
- MIPI DSI connector
- 2x USB Host
- 1x USB OTG
- Ethernet
- mini PCIe
- Onboard PoE
- RS485, RS232, CAN
- Micro Phone array
- Speaker
- RTC battery slot
- 40-pin expansion
Quoted 6 lines
Neu2 needs to mount on top of this IO board in order to create complete Edgeble Neural Compute Module 2(Neu2) IO platform.
Add support for it.
Signed-off-by Jagan Teki <[email protected]>
I have seen Heiko apply the dts into linux 6.3, so I will apply this patch set for U-Boot.
Thanks,
- Kever
Quoted 234 lines
---
Changes for v4:
- addMONITOR_LENconfig
Changes for v3:
- updated the board names
Changes for v2:
- none.../dts/rv1126-edgeble-neu2-io-u-boot.dtsi | 10 ++++ arch/arm/mach-rockchip/rv1126/Kconfig | 16 ++++++ board/edgeble/neural-compute-module-2/Kconfig | 16 ++++++ .../neural-compute-module-2/MAINTAINERS | 6 ++ .../edgeble/neural-compute-module-2/Makefile | 7 +++ board/edgeble/neural-compute-module-2/neu2.c | 4 ++ configs/neu2-io-rv1126_defconfig | 57 +++++++++++++++++++ doc/board/rockchip/rockchip.rst | 3 + include/configs/neural-compute-module-2.h | 21 +++++++ 9 files changed, 140 insertions(+)create mode 100644
arch/arm/dts/rv1126-edgeble-neu2-io-u-boot.dtsicreate mode 100644 board/edgeble/neural-compute-module-2/Kconfig create mode 100644 board/edgeble/neural-compute-module-2/MAINTAINERS create mode 100644 board/edgeble/neural-compute-module-2/Makefile create mode 100644board/edgeble/neural-compute-module-2/neu2.ccreate mode 100644 configs/neu2-io-rv1126_defconfig create mode 100644include/configs/neural-compute-module-2.harch/arm/dts/rv1126-edgeble-neu2-io-u-boot.dtsi new file +10
-0@@ -0,0 +1,10 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. + */ + +#include "rv1126-u-boot.dtsi" + +&sdio { + status = "disabled"; +};arch/arm/mach-rockchip/rv1126/Kconfig +16
-0@@ -1,5 +1,19 @@ if ROCKCHIP_RV1126 +config TARGET_RV1126_NEU2 + bool "Edgeble Neural Compute Module 2(Neu2) SoM" + help + Neu2: + Neural Compute Module 2(Neu2) is a 96boards SoM-CB compute module + based on Rockchip RV1126 from Edgeble AI. + Neu2 powered with Consumer grade (0 to +80 °C) RV1126 SoC. + Neu2k powered with Industrial grade (-40 °C to +85 °C) RV1126K SoC. + + Neu2-IO: + Neural Compute Module 2(Neu2) IO board is an industrial form factor + IO board and Neu2 needs to mount on top of this IO board in order to + create complete Edgeble Neural Compute Module 2(Neu2) IO platform. + config SOC_SPECIFIC_OPTIONS # dummy def_bool y select HAS_CUSTOM_SYS_INIT_SP_ADDR@@ -40,4 +54,6 @@ config SYS_MALLOC_F_LEN config TEXT_BASE default 0x600000 +source board/edgeble/neural-compute-module-2/Kconfig + endifboard/edgeble/neural-compute-module-2/Kconfig new file +16
-0@@ -0,0 +1,16 @@ +if TARGET_RV1126_NEU2 + +config SYS_BOARD + default "neural-compute-module-2" + +config SYS_VENDOR + default "edgeble" + +config SYS_CONFIG_NAME + default "neural-compute-module-2" + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + select RAM_ROCKCHIP_LPDDR4 + +endifboard/edgeble/neural-compute-module-2/MAINTAINERS new file +6
-0@@ -0,0 +1,6 @@ +RV1126-ECM0 +M: Jagan Teki <[email protected]> +S: Maintained +F: board/edgeble/neural-compute-module-2 +F: include/configs/neural-compute-module-2.h +F: configs/neu2-io-rv1126_defconfigboard/edgeble/neural-compute-module-2/Makefile new file +7
-0@@ -0,0 +1,7 @@ +# +# Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += neu2.oboard/edgeble/neural-compute-module-2/neu2.c new file +4
-0@@ -0,0 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. +*/ configs/neu2-io-rv1126_defconfig new file +57
-0@@ -0,0 +1,57 @@ +CONFIG_ARM=y +CONFIG_SPL_SKIP_LOWLEVEL_INIT_ONLY=y +CONFIG_TPL_SKIP_LOWLEVEL_INIT_ONLY=y +CONFIG_COUNTER_FREQUENCY=24000000 +CONFIG_SYS_ARCH_TIMER=y +CONFIG_ARCH_ROCKCHIP=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_DEFAULT_DEVICE_TREE="rv1126-edgeble-neu2-io" +CONFIG_ROCKCHIP_RV1126=y +CONFIG_TARGET_RV1126_NEU2=y +CONFIG_DEBUG_UART_BASE=0xff570000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_SYS_LOAD_ADDR=0xe00800 +CONFIG_DEBUG_UART=y +CONFIG_SYS_MONITOR_LEN=614400 +CONFIG_FIT_VERBOSE=y +CONFIG_DEFAULT_FDT_FILE="rv1126-edgeble-neu2-io.dtb" +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_MISC_INIT_R=y +CONFIG_SPL_PAD_TO=0x7f8000 +CONFIG_SPL_NO_BSS_LIMIT=y +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set +# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set +# CONFIG_CMD_BOOTD is not set +CONFIG_SYS_BOOTM_LEN=0x4000000 +# CONFIG_CMD_ELF is not set +# CONFIG_CMD_IMI is not set +# CONFIG_CMD_XIMG is not set +CONFIG_CMD_GPT=y +# CONFIG_CMD_LOADB is not set +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +# CONFIG_CMD_ITEST is not set +# CONFIG_CMD_SETEXPR is not set +# CONFIG_SPL_DOS_PARTITION is not set +# CONFIG_ISO_PARTITION is not set +CONFIG_EFI_PARTITION_ENTRIES_NUMBERS=64 +CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +CONFIG_ENV_IS_IN_MMC=y +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ROCKCHIP_GPIO=y +CONFIG_SYS_I2C_ROCKCHIP=y +CONFIG_MISC=y +CONFIG_MMC_DW=y +CONFIG_MMC_DW_ROCKCHIP=y +CONFIG_REGULATOR_PWM=y +CONFIG_PWM_ROCKCHIP=y +# CONFIG_RAM_ROCKCHIP_DEBUG is not set +CONFIG_BAUDRATE=1500000 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_SYSRESET=y +# CONFIG_TPL_SYSRESET is not set +CONFIG_DM_THERMAL=y +CONFIG_SPL_TINY_MEMSET=y +CONFIG_LZO=y +CONFIG_ERRNO_STR=ydoc/board/rockchip/rockchip.rst +3
-0@@ -89,6 +89,9 @@ List of mainline supported Rockchip boards: - Rockchip Evb-rv1108 (evb-rv1108) - Elgin-R1 (elgin-rv1108) +* rv1126 + - Edgeble Neural Compute Module 2 SoM - Neu2/Neu2k (neu2-io-r1126) + Building --------include/configs/neural-compute-module-2.h new file +21
-0@@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd. +*/ + +#ifndef __NEURAL_COMPUTE_MODULE_2_H +#define __NEURAL_COMPUTE_MODULE_2_H + +#define ROCKCHIP_DEVICE_SETTINGS \ + "stdout=serial,vidconsole\0" \ + "stderr=serial,vidconsole\0" + +#include <configs/rv1126_common.h> + +#undef BOOT_TARGET_DEVICES + +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) + +#endif /* __NEURAL_COMPUTE_MODULE_2_H */
Re: [PATCH v4 25/25] board: rockchip: Add Edgeble Neu2 IO Board
Hi Kever,
Quoted 23 lines · Kever Yang
Quoted 20 lines · Jagan Teki
Neural Compute Module 2(Neu2) IO board is an industrial form factor IO board from Edgeble AI.
General features:
- microSD slot
- MIPI DSI connector
- 2x USB Host
- 1x USB OTG
- Ethernet
- mini PCIe
- Onboard PoE
- RS485, RS232, CAN
- Micro Phone array
- Speaker
- RTC battery slot
- 40-pin expansionNeu2 needs to mount on top of this IO board in order to create complete Edgeble Neural Compute Module 2(Neu2) IO platform.
Quoted 7 lines
Quoted 3 lines
Add support for it.
Signed-off-by Jagan Teki <[email protected]>I have seen Heiko apply the dts into linux 6.3, so I will apply this patch set for U-Boot.
Can this go to -rc4 so it can be available for the next release? Since this patch set was sent 2 MW before.
Thanks,
Jagan.