1// SPDX-License-Identifier: (GPL-2.0+ OR X11) 2/* 3 * at91-sama5d2_ptc_ek.dts - Device Tree file for SAMA5D2 PTC EK board 4 * 5 * Copyright (C) 2017 Microchip/Atmel, 6 * 2017 Wenyou Yang <wenyou.yang@microchip.com> 7 * 2017 Ludovic Desroches <ludovic.desroches@microchip.com> 8 */ 9/dts-v1/; 10#include "sama5d2.dtsi" 11#include "sama5d2-pinfunc.h" 12#include <dt-bindings/mfd/atmel-flexcom.h> 13#include <dt-bindings/gpio/gpio.h> 14#include <dt-bindings/input/input.h> 15#include <dt-bindings/pinctrl/at91.h> 16 17/ { 18 model = "Atmel SAMA5D2 PTC EK"; 19 compatible = "atmel,sama5d2-ptc_ek", "atmel,sama5d2", "atmel,sama5"; 20 21 aliases { 22 serial0 = &uart0; /* DBGU */ 23 i2c0 = &i2c0; /* mikroBUS 1 */ 24 i2c1 = &i2c1; /* XPRO EXT1 */ 25 i2c2 = &i2c2; 26 }; 27 28 chosen { 29 stdout-path = "serial0:115200n8"; 30 }; 31 32 clocks { 33 slow_xtal { 34 clock-frequency = <32768>; 35 }; 36 37 main_xtal { 38 clock-frequency = <24000000>; 39 }; 40 }; 41 42 ahb { 43 usb0: gadget@300000 { 44 atmel,vbus-gpio = <&pioA PIN_PB11 GPIO_ACTIVE_HIGH>; 45 pinctrl-names = "default"; 46 pinctrl-0 = <&pinctrl_usba_vbus>; 47 status = "okay"; 48 }; 49 50 usb1: ohci@400000 { 51 num-ports = <3>; 52 atmel,vbus-gpio = <0 53 &pioA PIN_PB12 GPIO_ACTIVE_HIGH 54 0 55 >; 56 pinctrl-names = "default"; 57 pinctrl-0 = <&pinctrl_usb_default>; 58 status = "okay"; 59 }; 60 61 usb2: ehci@500000 { 62 status = "okay"; 63 }; 64 65 ebi: ebi@10000000 { 66 pinctrl-names = "default"; 67 pinctrl-0 = <&pinctrl_nand_default>; 68 status = "okay"; /* conflicts with sdmmc1 and qspi0 */ 69 70 nand_controller: nand-controller { 71 status = "okay"; 72 73 nand@3 { 74 reg = <0x3 0x0 0x2>; 75 atmel,rb = <0>; 76 nand-bus-width = <8>; 77 nand-ecc-mode = "hw"; 78 nand-on-flash-bbt; 79 label = "atmel_nand"; 80 81 partitions { 82 compatible = "fixed-partitions"; 83 #address-cells = <1>; 84 #size-cells = <1>; 85 86 at91bootstrap@0 { 87 label = "bootstrap"; 88 reg = <0x0 0x40000>; 89 }; 90 91 bootloader@40000 { 92 label = "bootloader"; 93 reg = <0x40000 0xc0000>; 94 }; 95 96 bootloaderenvred@0x100000 { 97 label = "bootloader env redundant"; 98 reg = <0x100000 0x40000>; 99 }; 100 101 bootloaderenv@0x140000 { 102 label = "bootloader env"; 103 reg = <0x140000 0x40000>; 104 }; 105 106 dtb@180000 { 107 label = "device tree"; 108 reg = <0x180000 0x80000>; 109 }; 110 111 kernel@200000 { 112 label = "kernel"; 113 reg = <0x200000 0x600000>; 114 }; 115 116 rootfs@800000 { 117 label = "rootfs"; 118 reg = <0x800000 0x1f800000>; 119 }; 120 }; 121 }; 122 }; 123 }; 124 125 sdmmc0: sdio-host@a0000000 { 126 bus-width = <8>; 127 pinctrl-names = "default"; 128 pinctrl-0 = <&pinctrl_sdmmc0_default>; 129 status = "okay"; 130 }; 131 132 apb { 133 spi0: spi@f8000000 { 134 pinctrl-names = "default"; 135 pinctrl-0 = <&pinctrl_spi0_default>; 136 status = "okay"; 137 }; 138 139 macb0: ethernet@f8008000 { 140 pinctrl-names = "default"; 141 pinctrl-0 = <&pinctrl_macb0_default &pinctrl_macb0_phy_irq>; 142 phy-mode = "rmii"; 143 status = "okay"; 144 145 ethernet-phy@1 { 146 reg = <0x1>; 147 interrupt-parent = <&pioA>; 148 interrupts = <56 IRQ_TYPE_LEVEL_LOW>; 149 }; 150 }; 151 152 tcb0: timer@f800c000 { 153 timer0: timer@0 { 154 compatible = "atmel,tcb-timer"; 155 reg = <0>; 156 }; 157 158 timer1: timer@1 { 159 compatible = "atmel,tcb-timer"; 160 reg = <1>; 161 }; 162 }; 163 164 uart0: serial@f801c000 { 165 pinctrl-names = "default"; 166 pinctrl-0 = <&pinctrl_uart0_default>; 167 atmel,use-dma-rx; 168 atmel,use-dma-tx; 169 status = "okay"; 170 }; 171 172 uart2: serial@f8024000 { 173 pinctrl-names = "default"; 174 pinctrl-0 = <&pinctrl_uart2_default>; 175 atmel,use-dma-rx; 176 atmel,use-dma-tx; 177 status = "okay"; 178 }; 179 180 i2c0: i2c@f8028000 { 181 dmas = <0>, <0>; 182 pinctrl-names = "default", "gpio"; 183 pinctrl-0 = <&pinctrl_i2c0_default>; 184 pinctrl-1 = <&pinctrl_i2c0_gpio>; 185 sda-gpios = <&pioA PIN_PD21 GPIO_ACTIVE_HIGH>; 186 scl-gpios = <&pioA PIN_PD22 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 187 status = "okay"; 188 }; 189 190 flx0: flexcom@f8034000 { 191 atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>; 192 status = "okay"; 193 194 i2c2: i2c@600 { 195 dmas = <0>, <0>; 196 pinctrl-names = "default", "gpio"; 197 pinctrl-0 = <&pinctrl_flx0_default>; 198 pinctrl-1 = <&pinctrl_flx0_gpio>; 199 sda-gpios = <&pioA PIN_PB28 GPIO_ACTIVE_HIGH>; 200 scl-gpios = <&pioA PIN_PB29 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 201 status = "okay"; 202 }; 203 }; 204 205 shdwc@f8048010 { 206 debounce-delay-us = <976>; 207 208 input@0 { 209 reg = <0>; 210 atmel,wakeup-type = "low"; 211 }; 212 }; 213 214 watchdog@f8048040 { 215 status = "okay"; 216 }; 217 218 spi1: spi@fc000000 { 219 pinctrl-names = "default"; 220 pinctrl-0 = <&pinctrl_spi1_default>; 221 status = "okay"; 222 }; 223 224 i2c1: i2c@fc028000 { 225 dmas = <0>, <0>; 226 pinctrl-names = "default", "gpio"; 227 pinctrl-0 = <&pinctrl_i2c1_default>; 228 pinctrl-1 = <&pinctrl_i2c1_gpio>; 229 sda-gpios = <&pioA PIN_PC6 GPIO_ACTIVE_HIGH>; 230 scl-gpios = <&pioA PIN_PC7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 231 status = "okay"; 232 233 at24@50 { 234 compatible = "atmel,24c02"; 235 reg = <0x50>; 236 pagesize = <8>; 237 }; 238 }; 239 240 pinctrl@fc038000 { 241 pinctrl_flx0_default: flx0_default { 242 pinmux = <PIN_PB28__FLEXCOM0_IO0>, 243 <PIN_PB29__FLEXCOM0_IO1>; 244 bias-disable; 245 }; 246 247 pinctrl_flx0_gpio: flx0_gpio { 248 pinmux = <PIN_PB28__GPIO>, 249 <PIN_PB29__GPIO>; 250 bias-disable; 251 }; 252 253 pinctrl_i2c0_default: i2c0_default { 254 pinmux = <PIN_PD21__TWD0>, 255 <PIN_PD22__TWCK0>; 256 bias-disable; 257 }; 258 259 pinctrl_i2c0_gpio: i2c0_gpio { 260 pinmux = <PIN_PD21__GPIO>, 261 <PIN_PD22__GPIO>; 262 bias-disable; 263 }; 264 265 pinctrl_i2c1_default: i2c1_default { 266 pinmux = <PIN_PC6__TWD1>, 267 <PIN_PC7__TWCK1>; 268 bias-disable; 269 }; 270 271 pinctrl_i2c1_gpio: i2c1_gpio { 272 pinmux = <PIN_PC6__GPIO>, 273 <PIN_PC7__GPIO>; 274 bias-disable; 275 }; 276 277 pinctrl_key_gpio_default: key_gpio_default { 278 pinmux = <PIN_PA10__GPIO>; 279 bias-pull-up; 280 }; 281 282 pinctrl_led_gpio_default: led_gpio_default { 283 pinmux = <PIN_PB6__GPIO>, 284 <PIN_PB8__GPIO>, 285 <PIN_PB10__GPIO>; 286 bias-pull-up; 287 }; 288 289 pinctrl_macb0_default: macb0_default { 290 pinmux = <PIN_PB14__GTXCK>, 291 <PIN_PB15__GTXEN>, 292 <PIN_PB16__GRXDV>, 293 <PIN_PB17__GRXER>, 294 <PIN_PB18__GRX0>, 295 <PIN_PB19__GRX1>, 296 <PIN_PB20__GTX0>, 297 <PIN_PB21__GTX1>, 298 <PIN_PB22__GMDC>, 299 <PIN_PB23__GMDIO>; 300 bias-disable; 301 }; 302 303 pinctrl_macb0_phy_irq: macb0_phy_irq { 304 pinmux = <PIN_PB24__GPIO>; 305 bias-disable; 306 }; 307 308 pinctrl_nand_default: nand_default { 309 re_we_data { 310 pinmux = <PIN_PA22__D0>, 311 <PIN_PA23__D1>, 312 <PIN_PA24__D2>, 313 <PIN_PA25__D3>, 314 <PIN_PA26__D4>, 315 <PIN_PA27__D5>, 316 <PIN_PA28__D6>, 317 <PIN_PA29__D7>, 318 <PIN_PA30__NWE_NANDWE>, 319 <PIN_PB2__NRD_NANDOE>; 320 bias-pull-up; 321 atmel,drive-strength = <ATMEL_PIO_DRVSTR_ME>; 322 }; 323 324 ale_cle_rdy_cs { 325 pinmux = <PIN_PB0__A21_NANDALE>, 326 <PIN_PB1__A22_NANDCLE>, 327 <PIN_PC8__NANDRDY>, 328 <PIN_PA31__NCS3>; 329 bias-pull-up; 330 }; 331 }; 332 333 pinctrl_sdmmc0_default: sdmmc0_default { 334 cmd_data { 335 pinmux = <PIN_PA1__SDMMC0_CMD>, 336 <PIN_PA2__SDMMC0_DAT0>, 337 <PIN_PA3__SDMMC0_DAT1>, 338 <PIN_PA4__SDMMC0_DAT2>, 339 <PIN_PA5__SDMMC0_DAT3>, 340 <PIN_PA6__SDMMC0_DAT4>, 341 <PIN_PA7__SDMMC0_DAT5>, 342 <PIN_PA8__SDMMC0_DAT6>, 343 <PIN_PA9__SDMMC0_DAT7>; 344 bias-pull-up; 345 }; 346 347 ck_cd_vddsel { 348 pinmux = <PIN_PA0__SDMMC0_CK>, 349 <PIN_PA11__SDMMC0_VDDSEL>, 350 <PIN_PA13__SDMMC0_CD>; 351 bias-disable; 352 }; 353 }; 354 355 pinctrl_spi0_default: spi0_default { 356 pinmux = <PIN_PA14__SPI0_SPCK>, 357 <PIN_PA15__SPI0_MOSI>, 358 <PIN_PA16__SPI0_MISO>, 359 <PIN_PA17__SPI0_NPCS0>; 360 bias-disable; 361 }; 362 363 pinctrl_spi1_default: spi1_default { 364 pinmux = <PIN_PC1__SPI1_SPCK>, 365 <PIN_PC2__SPI1_MOSI>, 366 <PIN_PC3__SPI1_MISO>, 367 <PIN_PC4__SPI1_NPCS0>; 368 bias-disable; 369 }; 370 371 pinctrl_uart0_default: uart0_default { 372 pinmux = <PIN_PB26__URXD0>, 373 <PIN_PB27__UTXD0>; 374 bias-disable; 375 }; 376 377 pinctrl_uart2_default: uart2_default { 378 pinmux = <PIN_PD23__URXD2>, 379 <PIN_PD24__UTXD2>; 380 bias-disable; 381 }; 382 383 pinctrl_usb_default: usb_default { 384 pinmux = <PIN_PB12__GPIO>; 385 bias-disable; 386 }; 387 388 pinctrl_usba_vbus: usba_vbus { 389 pinmux = <PIN_PB11__GPIO>; 390 bias-disable; 391 }; 392 393 }; 394 395 }; 396 }; 397 398 gpio_keys { 399 compatible = "gpio-keys"; 400 401 pinctrl-names = "default"; 402 pinctrl-0 = <&pinctrl_key_gpio_default>; 403 404 bp1 { 405 label = "PB_USER"; 406 gpios = <&pioA PIN_PA10 GPIO_ACTIVE_LOW>; 407 linux,code = <KEY_PROG1>; 408 wakeup-source; 409 }; 410 }; 411 412 leds { 413 compatible = "gpio-leds"; 414 pinctrl-names = "default"; 415 pinctrl-0 = <&pinctrl_led_gpio_default>; 416 status = "okay"; 417 418 red { 419 label = "red"; 420 gpios = <&pioA PIN_PB10 GPIO_ACTIVE_HIGH>; 421 }; 422 423 green { 424 label = "green"; 425 gpios = <&pioA PIN_PB8 GPIO_ACTIVE_HIGH>; 426 }; 427 428 blue { 429 label = "blue"; 430 gpios = <&pioA PIN_PB6 GPIO_ACTIVE_HIGH>; 431 linux,default-trigger = "heartbeat"; 432 }; 433 }; 434}; 435