Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Philipp Tomsich | 9ac1d83 | 2017-07-25 17:01:06 +0200 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2016 Rockchip Electronics Co., Ltd |
| 4 | * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH |
Andy Yan | 717733f | 2017-05-15 17:50:35 +0800 | [diff] [blame] | 5 | */ |
| 6 | #ifndef _ASM_ARCH_GRF_RK3368_H |
| 7 | #define _ASM_ARCH_GRF_RK3368_H |
| 8 | |
Simon Glass | 4dcacfc | 2020-05-10 11:40:13 -0600 | [diff] [blame] | 9 | #ifndef __ASSEMBLY__ |
| 10 | #include <linux/bitops.h> |
| 11 | #endif |
| 12 | |
Andy Yan | 717733f | 2017-05-15 17:50:35 +0800 | [diff] [blame] | 13 | struct rk3368_grf { |
| 14 | u32 gpio1a_iomux; |
| 15 | u32 gpio1b_iomux; |
| 16 | u32 gpio1c_iomux; |
| 17 | u32 gpio1d_iomux; |
| 18 | u32 gpio2a_iomux; |
| 19 | u32 gpio2b_iomux; |
| 20 | u32 gpio2c_iomux; |
| 21 | u32 gpio2d_iomux; |
| 22 | u32 gpio3a_iomux; |
| 23 | u32 gpio3b_iomux; |
| 24 | u32 gpio3c_iomux; |
| 25 | u32 gpio3d_iomux; |
| 26 | u32 reserved[0x34]; |
| 27 | u32 gpio1a_pull; |
| 28 | u32 gpio1b_pull; |
| 29 | u32 gpio1c_pull; |
| 30 | u32 gpio1d_pull; |
| 31 | u32 gpio2a_pull; |
| 32 | u32 gpio2b_pull; |
| 33 | u32 gpio2c_pull; |
| 34 | u32 gpio2d_pull; |
| 35 | u32 gpio3a_pull; |
| 36 | u32 gpio3b_pull; |
| 37 | u32 gpio3c_pull; |
| 38 | u32 gpio3d_pull; |
| 39 | u32 reserved1[0x34]; |
| 40 | u32 gpio1a_drv; |
| 41 | u32 gpio1b_drv; |
| 42 | u32 gpio1c_drv; |
| 43 | u32 gpio1d_drv; |
| 44 | u32 gpio2a_drv; |
| 45 | u32 gpio2b_drv; |
| 46 | u32 gpio2c_drv; |
| 47 | u32 gpio2d_drv; |
| 48 | u32 gpio3a_drv; |
| 49 | u32 gpio3b_drv; |
| 50 | u32 gpio3c_drv; |
| 51 | u32 gpio3d_drv; |
| 52 | u32 reserved2[0x34]; |
| 53 | u32 gpio1l_sr; |
| 54 | u32 gpio1h_sr; |
| 55 | u32 gpio2l_sr; |
| 56 | u32 gpio2h_sr; |
| 57 | u32 gpio3l_sr; |
| 58 | u32 gpio3h_sr; |
| 59 | u32 reserved3[0x1a]; |
| 60 | u32 gpio_smt; |
| 61 | u32 reserved4[0x1f]; |
| 62 | u32 soc_con0; |
| 63 | u32 soc_con1; |
| 64 | u32 soc_con2; |
| 65 | u32 soc_con3; |
| 66 | u32 soc_con4; |
| 67 | u32 soc_con5; |
| 68 | u32 soc_con6; |
| 69 | u32 soc_con7; |
| 70 | u32 soc_con8; |
| 71 | u32 soc_con9; |
| 72 | u32 soc_con10; |
| 73 | u32 soc_con11; |
| 74 | u32 soc_con12; |
| 75 | u32 soc_con13; |
| 76 | u32 soc_con14; |
| 77 | u32 soc_con15; |
| 78 | u32 soc_con16; |
| 79 | u32 soc_con17; |
Philipp Tomsich | d21a4d8 | 2017-06-23 00:12:05 +0200 | [diff] [blame] | 80 | u32 reserved5[0x6e]; |
| 81 | u32 ddrc0_con0; |
Andy Yan | 717733f | 2017-05-15 17:50:35 +0800 | [diff] [blame] | 82 | }; |
| 83 | check_member(rk3368_grf, soc_con17, 0x444); |
Philipp Tomsich | d21a4d8 | 2017-06-23 00:12:05 +0200 | [diff] [blame] | 84 | check_member(rk3368_grf, ddrc0_con0, 0x600); |
Andy Yan | 717733f | 2017-05-15 17:50:35 +0800 | [diff] [blame] | 85 | |
| 86 | struct rk3368_pmu_grf { |
| 87 | u32 gpio0a_iomux; |
| 88 | u32 gpio0b_iomux; |
| 89 | u32 gpio0c_iomux; |
| 90 | u32 gpio0d_iomux; |
| 91 | u32 gpio0a_pull; |
| 92 | u32 gpio0b_pull; |
| 93 | u32 gpio0c_pull; |
| 94 | u32 gpio0d_pull; |
| 95 | u32 gpio0a_drv; |
| 96 | u32 gpio0b_drv; |
| 97 | u32 gpio0c_drv; |
| 98 | u32 gpio0d_drv; |
| 99 | u32 gpio0l_sr; |
| 100 | u32 gpio0h_sr; |
Philipp Tomsich | 01c5bd2 | 2017-07-11 13:42:55 +0200 | [diff] [blame] | 101 | u32 reserved[0x72]; |
Kever Yang | 7a0ab30 | 2017-06-23 16:11:08 +0800 | [diff] [blame] | 102 | u32 os_reg[4]; |
Andy Yan | 717733f | 2017-05-15 17:50:35 +0800 | [diff] [blame] | 103 | }; |
Philipp Tomsich | 01c5bd2 | 2017-07-11 13:42:55 +0200 | [diff] [blame] | 104 | check_member(rk3368_pmu_grf, gpio0h_sr, 0x34); |
| 105 | check_member(rk3368_pmu_grf, os_reg[0], 0x200); |
Andy Yan | 717733f | 2017-05-15 17:50:35 +0800 | [diff] [blame] | 106 | |
Andy Yan | 717733f | 2017-05-15 17:50:35 +0800 | [diff] [blame] | 107 | /*GRF_SOC_CON11/12/13*/ |
| 108 | enum { |
| 109 | MCU_SRAM_BASE_BIT27_BIT12_SHIFT = 0, |
| 110 | MCU_SRAM_BASE_BIT27_BIT12_MASK = GENMASK(15, 0), |
| 111 | }; |
| 112 | |
| 113 | /*GRF_SOC_CON12*/ |
| 114 | enum { |
| 115 | MCU_EXSRAM_BASE_BIT27_BIT12_SHIFT = 0, |
| 116 | MCU_EXSRAM_BASE_BIT27_BIT12_MASK = GENMASK(15, 0), |
| 117 | }; |
| 118 | |
| 119 | /*GRF_SOC_CON13*/ |
| 120 | enum { |
| 121 | MCU_EXPERI_BASE_BIT27_BIT12_SHIFT = 0, |
| 122 | MCU_EXPERI_BASE_BIT27_BIT12_MASK = GENMASK(15, 0), |
| 123 | }; |
| 124 | |
| 125 | /*GRF_SOC_CON14*/ |
| 126 | enum { |
| 127 | MCU_EXPERI_BASE_BIT31_BIT28_SHIFT = 12, |
| 128 | MCU_EXPERI_BASE_BIT31_BIT28_MASK = GENMASK(15, 12), |
| 129 | MCU_EXSRAM_BASE_BIT31_BIT28_SHIFT = 8, |
| 130 | MCU_EXSRAM_BASE_BIT31_BIT28_MASK = GENMASK(11, 8), |
| 131 | MCU_SRAM_BASE_BIT31_BIT28_SHIFT = 4, |
| 132 | MCU_SRAM_BASE_BIT31_BIT28_MASK = GENMASK(7, 4), |
| 133 | MCU_CODE_BASE_BIT31_BIT28_SHIFT = 0, |
| 134 | MCU_CODE_BASE_BIT31_BIT28_MASK = GENMASK(3, 0), |
| 135 | }; |
Philipp Tomsich | 821c4c4 | 2017-07-25 17:02:51 +0200 | [diff] [blame] | 136 | |
Andy Yan | 717733f | 2017-05-15 17:50:35 +0800 | [diff] [blame] | 137 | #endif |