1 // SPDX-License-Identifier: GPL-2.0 1 // SPDX-License-Identifier: GPL-2.0 2 /* 2 /* 3 * Device Tree Source for Sunplus SP7021 3 * Device Tree Source for Sunplus SP7021 4 * 4 * 5 * Copyright (C) 2021 Sunplus Technology Co. 5 * Copyright (C) 2021 Sunplus Technology Co. 6 */ 6 */ 7 7 8 #include <dt-bindings/clock/sunplus,sp7021-clk 8 #include <dt-bindings/clock/sunplus,sp7021-clkc.h> 9 #include <dt-bindings/interrupt-controller/irq 9 #include <dt-bindings/interrupt-controller/irq.h> 10 #include <dt-bindings/reset/sunplus,sp7021-res 10 #include <dt-bindings/reset/sunplus,sp7021-reset.h> 11 #include <dt-bindings/pinctrl/sppctl-sp7021.h> 11 #include <dt-bindings/pinctrl/sppctl-sp7021.h> 12 #include <dt-bindings/gpio/gpio.h> 12 #include <dt-bindings/gpio/gpio.h> 13 13 14 #define XTAL 27000000 14 #define XTAL 27000000 15 15 16 / { 16 / { 17 compatible = "sunplus,sp7021"; 17 compatible = "sunplus,sp7021"; 18 model = "Sunplus SP7021"; 18 model = "Sunplus SP7021"; 19 19 20 clocks { 20 clocks { 21 extclk: osc0 { 21 extclk: osc0 { 22 compatible = "fixed-cl 22 compatible = "fixed-clock"; 23 #clock-cells = <0>; 23 #clock-cells = <0>; 24 clock-frequency = <XTA 24 clock-frequency = <XTAL>; 25 clock-output-names = " 25 clock-output-names = "extclk"; 26 }; 26 }; 27 }; 27 }; 28 28 29 soc@9c000000 { 29 soc@9c000000 { 30 compatible = "simple-bus"; 30 compatible = "simple-bus"; 31 #address-cells = <1>; 31 #address-cells = <1>; 32 #size-cells = <1>; 32 #size-cells = <1>; 33 ranges = <0 0x9c000000 0x40000 33 ranges = <0 0x9c000000 0x400000>; 34 interrupt-parent = <&intc>; 34 interrupt-parent = <&intc>; 35 35 36 clkc: clock-controller@4 { 36 clkc: clock-controller@4 { 37 compatible = "sunplus, 37 compatible = "sunplus,sp7021-clkc"; 38 reg = <0x4 0x28>, 38 reg = <0x4 0x28>, 39 <0x200 0x44>, 39 <0x200 0x44>, 40 <0x268 0x04>; 40 <0x268 0x04>; 41 clocks = <&extclk>; 41 clocks = <&extclk>; 42 #clock-cells = <1>; 42 #clock-cells = <1>; 43 }; 43 }; 44 44 45 intc: interrupt-controller@780 45 intc: interrupt-controller@780 { 46 compatible = "sunplus, 46 compatible = "sunplus,sp7021-intc"; 47 reg = <0x780 0x80>, <0 47 reg = <0x780 0x80>, <0xa80 0x80>; 48 interrupt-controller; 48 interrupt-controller; 49 #interrupt-cells = <2> 49 #interrupt-cells = <2>; 50 }; 50 }; 51 51 52 otp: otp@af00 { 52 otp: otp@af00 { 53 compatible = "sunplus, 53 compatible = "sunplus,sp7021-ocotp"; 54 reg = <0xaf00 0x34>, < 54 reg = <0xaf00 0x34>, <0xaf80 0x58>; 55 reg-names = "hb_gpio", 55 reg-names = "hb_gpio", "otprx"; 56 clocks = <&clkc CLK_OT 56 clocks = <&clkc CLK_OTPRX>; 57 resets = <&rstc RST_OT 57 resets = <&rstc RST_OTPRX>; 58 #address-cells = <1>; 58 #address-cells = <1>; 59 #size-cells = <1>; 59 #size-cells = <1>; 60 60 61 therm_calib: thermal-c 61 therm_calib: thermal-calibration@14 { 62 reg = <0x14 0x 62 reg = <0x14 0x3>; 63 }; 63 }; 64 disc_vol: disconnect-v 64 disc_vol: disconnect-voltage@18 { 65 reg = <0x18 0x 65 reg = <0x18 0x2>; 66 }; 66 }; 67 mac_addr0: mac-address 67 mac_addr0: mac-address0@34 { 68 reg = <0x34 0x 68 reg = <0x34 0x6>; 69 }; 69 }; 70 mac_addr1: mac-address 70 mac_addr1: mac-address1@3a { 71 reg = <0x3a 0x 71 reg = <0x3a 0x6>; 72 }; 72 }; 73 }; 73 }; 74 74 75 pctl: pinctrl@100 { 75 pctl: pinctrl@100 { 76 compatible = "sunplus, 76 compatible = "sunplus,sp7021-pctl"; 77 reg = <0x100 0x100>, 77 reg = <0x100 0x100>, 78 <0x300 0x100>, 78 <0x300 0x100>, 79 <0x32e4 0x1C>, 79 <0x32e4 0x1C>, 80 <0x80 0x20>; 80 <0x80 0x20>; 81 reg-names = "moon2", " 81 reg-names = "moon2", "gpioxt", "first", "moon1"; 82 gpio-controller; 82 gpio-controller; 83 #gpio-cells = <2>; 83 #gpio-cells = <2>; 84 clocks = <&clkc CLK_GP 84 clocks = <&clkc CLK_GPIO>; 85 resets = <&rstc RST_GP 85 resets = <&rstc RST_GPIO>; 86 86 87 emac_pins: pinmux-emac 87 emac_pins: pinmux-emac-pins { 88 sunplus,pins = 88 sunplus,pins = < 89 SPPCTL 89 SPPCTL_IOPAD(49,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_CLK_OUT,0) 90 SPPCTL 90 SPPCTL_IOPAD(44,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_MAC_SMI_MDC,0) 91 SPPCTL 91 SPPCTL_IOPAD(43,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_MAC_SMI_MDIO,0) 92 SPPCTL 92 SPPCTL_IOPAD(52,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_TXEN,0) 93 SPPCTL 93 SPPCTL_IOPAD(50,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_TXD0,0) 94 SPPCTL 94 SPPCTL_IOPAD(51,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_TXD1,0) 95 SPPCTL 95 SPPCTL_IOPAD(46,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_CRSDV,0) 96 SPPCTL 96 SPPCTL_IOPAD(47,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_RXD0,0) 97 SPPCTL 97 SPPCTL_IOPAD(48,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_RXD1,0) 98 SPPCTL 98 SPPCTL_IOPAD(45,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_RXER,0) 99 SPPCTL 99 SPPCTL_IOPAD(59,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_TXEN,0) 100 SPPCTL 100 SPPCTL_IOPAD(57,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_TXD0,0) 101 SPPCTL 101 SPPCTL_IOPAD(58,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_TXD1,0) 102 SPPCTL 102 SPPCTL_IOPAD(54,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_CRSDV,0) 103 SPPCTL 103 SPPCTL_IOPAD(55,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_RXD0,0) 104 SPPCTL 104 SPPCTL_IOPAD(56,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_RXD1,0) 105 SPPCTL 105 SPPCTL_IOPAD(53,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_RXER,0) 106 >; 106 >; 107 sunplus,zerofu 107 sunplus,zerofunc = < 108 MUXF_L 108 MUXF_L2SW_LED_FLASH0 109 MUXF_L 109 MUXF_L2SW_LED_FLASH1 110 MUXF_L 110 MUXF_L2SW_LED_ON0 111 MUXF_L 111 MUXF_L2SW_LED_ON1 112 MUXF_D 112 MUXF_DAISY_MODE 113 >; 113 >; 114 }; 114 }; 115 115 116 emmc_pins: pinmux-emmc 116 emmc_pins: pinmux-emmc-pins { 117 function = "CA 117 function = "CARD0_EMMC"; 118 groups = "CARD 118 groups = "CARD0_EMMC"; 119 }; 119 }; 120 120 121 leds_pins: pinmux-leds 121 leds_pins: pinmux-leds-pins { 122 sunplus,pins = 122 sunplus,pins = < SPPCTL_IOPAD(0,SPPCTL_PCTL_G_GPIO,0,SPPCTL_PCTL_L_OUT) >; 123 }; 123 }; 124 124 125 sdcard_pins: pinmux-sd 125 sdcard_pins: pinmux-sdcard-pins { 126 function = "SD 126 function = "SD_CARD"; 127 groups = "SD_C 127 groups = "SD_CARD"; 128 sunplus,pins = 128 sunplus,pins = < SPPCTL_IOPAD(91, SPPCTL_PCTL_G_GPIO, 0, 0) >; 129 }; 129 }; 130 130 131 spi0_pins: pinmux-spi0 131 spi0_pins: pinmux-spi0-pins { 132 sunplus,pins = 132 sunplus,pins = < 133 SPPCTL 133 SPPCTL_IOPAD(26,SPPCTL_PCTL_G_GPIO,0,0) 134 SPPCTL 134 SPPCTL_IOPAD(28,SPPCTL_PCTL_G_GPIO,0,0) 135 SPPCTL 135 SPPCTL_IOPAD(23,SPPCTL_PCTL_G_PMUX,MUXF_SPI0S_DO,0) 136 SPPCTL 136 SPPCTL_IOPAD(25,SPPCTL_PCTL_G_PMUX,MUXF_SPI0S_DI,0) 137 SPPCTL 137 SPPCTL_IOPAD(27,SPPCTL_PCTL_G_PMUX,MUXF_SPI0S_CLK,0) 138 >; 138 >; 139 }; 139 }; 140 140 141 uart0_pins: pinmux-uar 141 uart0_pins: pinmux-uart0-pins { 142 function = "UA 142 function = "UA0"; 143 groups = "UA0" 143 groups = "UA0"; 144 }; 144 }; 145 145 146 uart1_pins: pinmux-uar 146 uart1_pins: pinmux-uart1-pins { 147 sunplus,pins = 147 sunplus,pins = < 148 SPPCTL 148 SPPCTL_IOPAD(14,SPPCTL_PCTL_G_PMUX,MUXF_UA4_TX,0) 149 SPPCTL 149 SPPCTL_IOPAD(16,SPPCTL_PCTL_G_PMUX,MUXF_UA4_RX,0) 150 >; 150 >; 151 }; 151 }; 152 152 153 uart2_pins: pinmux-uar 153 uart2_pins: pinmux-uart2-pins { 154 sunplus,pins = 154 sunplus,pins = < 155 SPPCTL 155 SPPCTL_IOPAD(16,SPPCTL_PCTL_G_PMUX,MUXF_UA2_TX,0) 156 SPPCTL 156 SPPCTL_IOPAD(17,SPPCTL_PCTL_G_PMUX,MUXF_UA2_RX,0) 157 SPPCTL 157 SPPCTL_IOPAD(18,SPPCTL_PCTL_G_PMUX,MUXF_UA2_RTS,0) 158 SPPCTL 158 SPPCTL_IOPAD(19,SPPCTL_PCTL_G_PMUX,MUXF_UA2_CTS,0) 159 >; 159 >; 160 }; 160 }; 161 161 162 uart4_pins: pinmux-uar 162 uart4_pins: pinmux-uart4-pins { 163 sunplus,pins = 163 sunplus,pins = < 164 SPPCTL 164 SPPCTL_IOPAD(22,SPPCTL_PCTL_G_PMUX,MUXF_UA4_TX,0) 165 SPPCTL 165 SPPCTL_IOPAD(20,SPPCTL_PCTL_G_PMUX,MUXF_UA4_RX,0) 166 SPPCTL 166 SPPCTL_IOPAD(23,SPPCTL_PCTL_G_PMUX,MUXF_UA4_RTS,0) 167 SPPCTL 167 SPPCTL_IOPAD(21,SPPCTL_PCTL_G_PMUX,MUXF_UA4_CTS,0) 168 >; 168 >; 169 }; 169 }; 170 }; 170 }; 171 171 172 rstc: reset@54 { 172 rstc: reset@54 { 173 compatible = "sunplus, 173 compatible = "sunplus,sp7021-reset"; 174 reg = <0x54 0x28>; 174 reg = <0x54 0x28>; 175 #reset-cells = <1>; 175 #reset-cells = <1>; 176 }; 176 }; 177 177 178 rtc: rtc@3a00 { 178 rtc: rtc@3a00 { 179 compatible = "sunplus, 179 compatible = "sunplus,sp7021-rtc"; 180 reg = <0x3a00 0x80>; 180 reg = <0x3a00 0x80>; 181 reg-names = "rtc"; 181 reg-names = "rtc"; 182 clocks = <&clkc CLK_RT 182 clocks = <&clkc CLK_RTC>; 183 resets = <&rstc RST_RT 183 resets = <&rstc RST_RTC>; 184 interrupts = <163 IRQ_ 184 interrupts = <163 IRQ_TYPE_EDGE_RISING>; 185 }; 185 }; 186 186 187 spi_controller0: spi@2d80 { 187 spi_controller0: spi@2d80 { 188 compatible = "sunplus, 188 compatible = "sunplus,sp7021-spi"; 189 reg = <0x2d80 0x80>, < 189 reg = <0x2d80 0x80>, <0x2e00 0x80>; 190 reg-names = "master", 190 reg-names = "master", "slave"; 191 interrupts = <144 IRQ_ 191 interrupts = <144 IRQ_TYPE_LEVEL_HIGH>, 192 <146 IRQ_ 192 <146 IRQ_TYPE_LEVEL_HIGH>, 193 <145 IRQ_ 193 <145 IRQ_TYPE_LEVEL_HIGH>; 194 interrupt-names = "dma 194 interrupt-names = "dma_w", "master_risc", "slave_risc"; 195 clocks = <&clkc CLK_SP 195 clocks = <&clkc CLK_SPI_COMBO_0>; 196 resets = <&rstc RST_SP 196 resets = <&rstc RST_SPI_COMBO_0>; 197 197 198 pinctrl-names = "defau 198 pinctrl-names = "default"; 199 pinctrl-0 = <&spi0_pin 199 pinctrl-0 = <&spi0_pins>; 200 cs-gpios = <&pctl 26 G 200 cs-gpios = <&pctl 26 GPIO_ACTIVE_LOW>, 201 <&pctl 28 G 201 <&pctl 28 GPIO_ACTIVE_LOW>; 202 }; 202 }; 203 203 204 spi_controller1: spi@f480 { 204 spi_controller1: spi@f480 { 205 compatible = "sunplus, 205 compatible = "sunplus,sp7021-spi"; 206 reg = <0xf480 0x80>, < 206 reg = <0xf480 0x80>, <0xf500 0x80>; 207 reg-names = "master", 207 reg-names = "master", "slave"; 208 interrupts = <67 IRQ_T 208 interrupts = <67 IRQ_TYPE_LEVEL_HIGH>, 209 <69 IRQ_T 209 <69 IRQ_TYPE_LEVEL_HIGH>, 210 <68 IRQ_T 210 <68 IRQ_TYPE_LEVEL_HIGH>; 211 interrupt-names = "dma 211 interrupt-names = "dma_w", "master_risc", "slave_risc"; 212 clocks = <&clkc CLK_SP 212 clocks = <&clkc CLK_SPI_COMBO_1>; 213 resets = <&rstc RST_SP 213 resets = <&rstc RST_SPI_COMBO_1>; 214 status = "disabled"; 214 status = "disabled"; 215 }; 215 }; 216 216 217 spi_controller2: spi@f600 { 217 spi_controller2: spi@f600 { 218 compatible = "sunplus, 218 compatible = "sunplus,sp7021-spi"; 219 reg = <0xf600 0x80>, < 219 reg = <0xf600 0x80>, <0xf680 0x80>; 220 reg-names = "master", 220 reg-names = "master", "slave"; 221 interrupts = <70 IRQ_T 221 interrupts = <70 IRQ_TYPE_LEVEL_HIGH>, 222 <72 IRQ_T 222 <72 IRQ_TYPE_LEVEL_HIGH>, 223 <71 IRQ_T 223 <71 IRQ_TYPE_LEVEL_HIGH>; 224 interrupt-names = "dma 224 interrupt-names = "dma_w", "master_risc", "slave_risc"; 225 clocks = <&clkc CLK_SP 225 clocks = <&clkc CLK_SPI_COMBO_2>; 226 resets = <&rstc RST_SP 226 resets = <&rstc RST_SPI_COMBO_2>; 227 status = "disabled"; 227 status = "disabled"; 228 }; 228 }; 229 229 230 spi_controller3: spi@f780 { 230 spi_controller3: spi@f780 { 231 compatible = "sunplus, 231 compatible = "sunplus,sp7021-spi"; 232 reg = <0xf780 0x80>, < 232 reg = <0xf780 0x80>, <0xf800 0x80>; 233 reg-names = "master", 233 reg-names = "master", "slave"; 234 interrupts = <73 IRQ_T 234 interrupts = <73 IRQ_TYPE_LEVEL_HIGH>, 235 <75 IRQ_T 235 <75 IRQ_TYPE_LEVEL_HIGH>, 236 <74 IRQ_T 236 <74 IRQ_TYPE_LEVEL_HIGH>; 237 interrupt-names = "dma 237 interrupt-names = "dma_w", "master_risc", "slave_risc"; 238 clocks = <&clkc CLK_SP 238 clocks = <&clkc CLK_SPI_COMBO_3>; 239 resets = <&rstc RST_SP 239 resets = <&rstc RST_SPI_COMBO_3>; 240 status = "disabled"; 240 status = "disabled"; 241 }; 241 }; 242 242 243 uart0: serial@900 { 243 uart0: serial@900 { 244 compatible = "sunplus, 244 compatible = "sunplus,sp7021-uart"; 245 reg = <0x900 0x80>; 245 reg = <0x900 0x80>; 246 interrupts = <53 IRQ_T 246 interrupts = <53 IRQ_TYPE_LEVEL_HIGH>; 247 clocks = <&clkc CLK_UA 247 clocks = <&clkc CLK_UA0>; 248 resets = <&rstc RST_UA 248 resets = <&rstc RST_UA0>; 249 pinctrl-names = "defau 249 pinctrl-names = "default"; 250 pinctrl-0 = <&uart0_pi 250 pinctrl-0 = <&uart0_pins>; 251 }; 251 }; 252 252 253 uart1: serial@980 { 253 uart1: serial@980 { 254 compatible = "sunplus, 254 compatible = "sunplus,sp7021-uart"; 255 reg = <0x980 0x80>; 255 reg = <0x980 0x80>; 256 interrupts = <54 IRQ_T 256 interrupts = <54 IRQ_TYPE_LEVEL_HIGH>; 257 clocks = <&clkc CLK_UA 257 clocks = <&clkc CLK_UA1>; 258 resets = <&rstc RST_UA 258 resets = <&rstc RST_UA1>; 259 pinctrl-names = "defau 259 pinctrl-names = "default"; 260 pinctrl-0 = <&uart1_pi 260 pinctrl-0 = <&uart1_pins>; 261 status = "disabled"; 261 status = "disabled"; 262 }; 262 }; 263 263 264 uart2: serial@800 { 264 uart2: serial@800 { 265 compatible = "sunplus, 265 compatible = "sunplus,sp7021-uart"; 266 reg = <0x800 0x80>; 266 reg = <0x800 0x80>; 267 interrupts = <55 IRQ_T 267 interrupts = <55 IRQ_TYPE_LEVEL_HIGH>; 268 clocks = <&clkc CLK_UA 268 clocks = <&clkc CLK_UA2>; 269 resets = <&rstc RST_UA 269 resets = <&rstc RST_UA2>; 270 pinctrl-names = "defau 270 pinctrl-names = "default"; 271 pinctrl-0 = <&uart2_pi 271 pinctrl-0 = <&uart2_pins>; 272 status = "disabled"; 272 status = "disabled"; 273 }; 273 }; 274 274 275 uart3: serial@880 { 275 uart3: serial@880 { 276 compatible = "sunplus, 276 compatible = "sunplus,sp7021-uart"; 277 reg = <0x880 0x80>; 277 reg = <0x880 0x80>; 278 interrupts = <56 IRQ_T 278 interrupts = <56 IRQ_TYPE_LEVEL_HIGH>; 279 clocks = <&clkc CLK_UA 279 clocks = <&clkc CLK_UA3>; 280 resets = <&rstc RST_UA 280 resets = <&rstc RST_UA3>; 281 status = "disabled"; 281 status = "disabled"; 282 }; 282 }; 283 283 284 uart4: serial@8780 { 284 uart4: serial@8780 { 285 compatible = "sunplus, 285 compatible = "sunplus,sp7021-uart"; 286 reg = <0x8780 0x80>; 286 reg = <0x8780 0x80>; 287 interrupts = <134 IRQ_ 287 interrupts = <134 IRQ_TYPE_LEVEL_HIGH>; 288 clocks = <&clkc CLK_UA 288 clocks = <&clkc CLK_UA4>; 289 resets = <&rstc RST_UA 289 resets = <&rstc RST_UA4>; 290 pinctrl-names = "defau 290 pinctrl-names = "default"; 291 pinctrl-0 = <&uart4_pi 291 pinctrl-0 = <&uart4_pins>; 292 status = "disabled"; 292 status = "disabled"; 293 }; 293 }; 294 }; 294 }; 295 295 296 leds { 296 leds { 297 compatible = "gpio-leds"; 297 compatible = "gpio-leds"; 298 pinctrl-names = "default"; 298 pinctrl-names = "default"; 299 pinctrl-0 = <&leds_pins>; 299 pinctrl-0 = <&leds_pins>; 300 system-led { 300 system-led { 301 label = "system-led"; 301 label = "system-led"; 302 gpios = <&pctl 0 GPIO_ 302 gpios = <&pctl 0 GPIO_ACTIVE_HIGH>; 303 default-state = "off"; 303 default-state = "off"; 304 linux,default-trigger 304 linux,default-trigger = "heartbeat"; 305 }; 305 }; 306 }; 306 }; 307 }; 307 };
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.