Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0 or MIT)
0002 //
0003 // Copyright (c) 2021 emtrion GmbH
0004 // Author: Reinhold Müller <reinhold.mueller@emtrion.de>.
0005 //
0006 
0007 #include "stm32mp157.dtsi"
0008 #include "stm32mp15xc.dtsi"
0009 #include "stm32mp15-pinctrl.dtsi"
0010 #include "stm32mp15xxac-pinctrl.dtsi"
0011 #include <dt-bindings/gpio/gpio.h>
0012 #include <dt-bindings/mfd/st,stpmic1.h>
0013 
0014 / {
0015         aliases {
0016                 ethernet0 = &ethernet0;
0017                 serial0 = &uart4;
0018                 serial1 = &usart2;
0019                 serial2 = &usart3;
0020         };
0021 
0022         chosen {
0023                 stdout-path = "serial0:115200n8";
0024         };
0025 
0026         memory@c0000000 {
0027                 device_type = "memory";
0028                 reg = <0xc0000000 0x20000000>;
0029         };
0030 
0031         reserved-memory {
0032                 #address-cells = <1>;
0033                 #size-cells = <1>;
0034                 ranges;
0035 
0036                 mcuram2: mcuram2@10000000 {
0037                         compatible = "shared-dma-pool";
0038                         reg = <0x10000000 0x40000>;
0039                         no-map;
0040                 };
0041 
0042                 vdev0vring0: vdev0vring0@10040000 {
0043                         compatible = "shared-dma-pool";
0044                         reg = <0x10040000 0x2000>;
0045                         no-map;
0046                 };
0047 
0048                 vdev0vring1: vdev0vring1@10042000 {
0049                         compatible = "shared-dma-pool";
0050                         reg = <0x10042000 0x2000>;
0051                         no-map;
0052                 };
0053 
0054                 vdev0buffer: vdev0buffer@10044000 {
0055                         compatible = "shared-dma-pool";
0056                         reg = <0x10044000 0x4000>;
0057                         no-map;
0058                 };
0059 
0060                 mcuram: mcuram@30000000 {
0061                         compatible = "shared-dma-pool";
0062                         reg = <0x30000000 0x40000>;
0063                         no-map;
0064                 };
0065 
0066                 retram: retram@38000000 {
0067                         compatible = "shared-dma-pool";
0068                         reg = <0x38000000 0x10000>;
0069                         no-map;
0070                 };
0071 
0072                 gpu_reserved: gpu@dc000000 {
0073                         reg = <0xdc000000 0x4000000>;
0074                         no-map;
0075                 };
0076         };
0077 
0078         led: gpio_leds {
0079                 compatible = "gpio-leds";
0080                 led-0 {
0081                         label = "panic";
0082                         gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
0083                         linux,default-trigger = "none";
0084                         default-state = "off";
0085                         panic-indicator;
0086                 };
0087                 led-1 {
0088                         label = "heartbeat";
0089                         gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
0090                         linux,default-trigger = "heartbeat";
0091                         default-state = "on";
0092                 };
0093         };
0094 };
0095 
0096 &adc {
0097         vdd-supply = <&vdd>;
0098         vdda-supply = <&vdd>;
0099         vref-supply = <&vrefbuf>;
0100         status = "okay";
0101 
0102         adc1: adc@0 {
0103                 pinctrl-names = "default";
0104                 pinctrl-0 = <&adc1_in6_pins_a>;
0105                 st,min-sample-time-nsecs = <5000>;
0106                 st,adc-channels = <6>;
0107                 status = "disabled";
0108         };
0109 
0110         adc2: adc@100 {
0111                 #address-cells = <1>;
0112                 #size-cells = <0>;
0113                 status = "okay";
0114                 channel@12 {
0115                         reg = <12>;
0116                         label = "sense_temp";
0117                         st,min-sample-time-ns = <9000>;
0118                 };
0119                 channel@15 {
0120                         reg = <15>;
0121                         label = "vbat";
0122                         st,min-sample-time-ns = <9000>;
0123                 };
0124                 channel@16 {
0125                         reg = <16>;
0126                         label = "dac_out1";
0127                         st,min-sample-time-ns = <9000>;
0128                 };
0129                 channel@17 {
0130                         reg = <17>;
0131                         label = "dac_out1";
0132                         st,min-sample-time-ns = <9000>;
0133                 };
0134         };
0135 };
0136 
0137 &crc1 {
0138         status = "okay";
0139 };
0140 
0141 &cryp1 {
0142         status = "okay";
0143 };
0144 
0145 &dac {
0146         pinctrl-names = "default";
0147         pinctrl-0 = <&dac_ch1_pins_a &dac_ch2_pins_a>;
0148         vref-supply = <&vdda>;
0149         status = "disabled";
0150 
0151         dac1: dac@1 {
0152                 status = "okay";
0153         };
0154         dac2: dac@2 {
0155                 status = "okay";
0156         };
0157 };
0158 
0159 &dts {
0160         status = "okay";
0161 };
0162 
0163 &ethernet0 {
0164         status = "okay";
0165         snps,reset-gpio = <&gpioa 1 GPIO_ACTIVE_LOW>;
0166         snps,reset-active-low;
0167         snps,reset-delays-us = <0 30000 50000>;
0168         pinctrl-0 = <&ethernet0_rmii_pins_b>;
0169         pinctrl-1 = <&ethernet0_rmii_sleep_pins_b>;
0170         pinctrl-names = "default", "sleep";
0171         phy-mode = "rmii";
0172         max-speed = <100>;
0173         phy-handle = <&phy0>;
0174         st,eth-ref-clk-sel;
0175 
0176         mdio0 {
0177                 #address-cells = <1>;
0178                 #size-cells = <0>;
0179                 compatible = "snps,dwmac-mdio";
0180                 phy0: ethernet-phy@0 {
0181                         reg = <0>;
0182                 };
0183         };
0184 };
0185 
0186 &gpu {
0187         contiguous-area = <&gpu_reserved>;
0188 };
0189 
0190 &hash1 {
0191         status = "okay";
0192 };
0193 
0194 &i2c1 {
0195         pinctrl-names = "default", "sleep";
0196         pinctrl-0 = <&i2c1_pins_a>;
0197         pinctrl-1 = <&i2c1_sleep_pins_a>;
0198         i2c-scl-rising-time-ns = <100>;
0199         i2c-scl-falling-time-ns = <7>;
0200         status = "disabled";
0201         /delete-property/dmas;
0202         /delete-property/dma-names;
0203 };
0204 
0205 &i2c4 {
0206         pinctrl-names = "default", "sleep";
0207         pinctrl-0 = <&i2c4_pins_a>;
0208         pinctrl-1 = <&i2c4_sleep_pins_a>;
0209         i2c-scl-rising-time-ns = <185>;
0210         i2c-scl-falling-time-ns = <20>;
0211         status = "okay";
0212         /delete-property/dmas;
0213         /delete-property/dma-names;
0214 
0215         pmic: stpmic@33 {
0216                 compatible = "st,stpmic1";
0217                 reg = <0x33>;
0218                 interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;
0219                 interrupt-controller;
0220                 #interrupt-cells = <2>;
0221                 status = "okay";
0222 
0223                 regulators {
0224                         compatible = "st,stpmic1-regulators";
0225 
0226                         ldo1-supply = <&v3v3>;
0227                         ldo3-supply = <&vdd_ddr>;
0228                         ldo6-supply = <&v3v3>;
0229                         pwr_sw1-supply = <&bst_out>;
0230                         pwr_sw2-supply = <&bst_out>;
0231 
0232                         vddcore: buck1 {
0233                                 regulator-name = "vddcore";
0234                                 regulator-min-microvolt = <1200000>;
0235                                 regulator-max-microvolt = <1350000>;
0236                                 regulator-always-on;
0237                                 regulator-initial-mode = <0>;
0238                                 regulator-over-current-protection;
0239                         };
0240 
0241                         vdd_ddr: buck2 {
0242                                 regulator-name = "vdd_ddr";
0243                                 regulator-min-microvolt = <1350000>;
0244                                 regulator-max-microvolt = <1350000>;
0245                                 regulator-always-on;
0246                                 regulator-initial-mode = <0>;
0247                                 regulator-over-current-protection;
0248                         };
0249 
0250                         vdd: buck3 {
0251                                 regulator-name = "vdd";
0252                                 regulator-min-microvolt = <3300000>;
0253                                 regulator-max-microvolt = <3300000>;
0254                                 regulator-always-on;
0255                                 st,mask-reset;
0256                                 regulator-initial-mode = <0>;
0257                                 regulator-over-current-protection;
0258                         };
0259 
0260                         v3v3: buck4 {
0261                                 regulator-name = "v3v3";
0262                                 regulator-min-microvolt = <3300000>;
0263                                 regulator-max-microvolt = <3300000>;
0264                                 regulator-always-on;
0265                                 regulator-over-current-protection;
0266                                 regulator-initial-mode = <0>;
0267                         };
0268 
0269                         v1v8_audio: ldo1 {
0270                                 regulator-name = "v1v8_audio";
0271                                 regulator-min-microvolt = <1800000>;
0272                                 regulator-max-microvolt = <1800000>;
0273                                 regulator-always-on;
0274                                 interrupts = <IT_CURLIM_LDO1 0>;
0275                         };
0276 
0277                         v3v3_hdmi: ldo2 {
0278                                 regulator-name = "v3v3_hdmi";
0279                                 regulator-min-microvolt = <3300000>;
0280                                 regulator-max-microvolt = <3300000>;
0281                                 regulator-always-on;
0282                                 interrupts = <IT_CURLIM_LDO2 0>;
0283                         };
0284 
0285                         vtt_ddr: ldo3 {
0286                                 regulator-name = "vtt_ddr";
0287                                 regulator-min-microvolt = <500000>;
0288                                 regulator-max-microvolt = <750000>;
0289                                 regulator-always-on;
0290                                 regulator-over-current-protection;
0291                         };
0292 
0293                         vdd_usb: ldo4 {
0294                                 regulator-name = "vdd_usb";
0295                                 regulator-min-microvolt = <3300000>;
0296                                 regulator-max-microvolt = <3300000>;
0297                                 interrupts = <IT_CURLIM_LDO4 0>;
0298                         };
0299 
0300                         vdd_sd: ldo5 {
0301                                 regulator-name = "vdd_sd";
0302                                 regulator-min-microvolt = <3300000>;
0303                                 regulator-max-microvolt = <3300000>;
0304                                 interrupts = <IT_CURLIM_LDO5 0>;
0305                                 regulator-always-on;
0306                         };
0307 
0308                         vdda: ldo6 {
0309                                 regulator-name = "vdda";
0310                                 regulator-min-microvolt = <2900000>;
0311                                 regulator-max-microvolt = <2900000>;
0312                                 regulator-always-on;
0313                                 interrupts = <IT_CURLIM_LDO6 0>;
0314                                 regulator-boot-on;
0315                         };
0316 
0317                         vref_ddr: vref_ddr {
0318                                 regulator-name = "vref_ddr";
0319                                 regulator-always-on;
0320                                 regulator-over-current-protection;
0321                         };
0322 
0323                         bst_out: boost {
0324                                 regulator-name = "bst_out";
0325                                 interrupts = <IT_OCP_BOOST 0>;
0326                         };
0327 
0328                         vbus_otg: pwr_sw1 {
0329                                 regulator-name = "vbus_otg";
0330                                 interrupts = <IT_OCP_OTG 0>;
0331                                 regulator-active-discharge;
0332                         };
0333 
0334                         vbus_usbh: pwr_sw2 {
0335                                 regulator-name = "usbh_vbus";
0336                                 interrupts = <IT_OCP_SWOUT 0>;
0337                                 regulator-always-on;
0338                                 regulator-boot-on;
0339                         };
0340                 };
0341 
0342                 onkey {
0343                         compatible = "st,stpmic1-onkey";
0344                         interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 1>;
0345                         interrupt-names = "onkey-falling", "onkey-rising";
0346                         status = "okay";
0347                 };
0348 
0349                 watchdog {
0350                         compatible = "st,stpmic1-wdt";
0351                         status = "disabled";
0352                 };
0353         };
0354 };
0355 
0356 &i2c5 {
0357         pinctrl-names = "default", "sleep";
0358         pinctrl-0 = <&i2c5_pins_a>;
0359         pinctrl-1 = <&i2c5_sleep_pins_a>;
0360         i2c-scl-rising-time-ns = <185>;
0361         i2c-scl-falling-time-ns = <20>;
0362         /delete-property/dmas;
0363         /delete-property/dma-names;
0364 };
0365 
0366 &ipcc {
0367         status = "okay";
0368 };
0369 
0370 &iwdg2 {
0371         timeout-sec = <32>;
0372         status = "okay";
0373 };
0374 
0375 &m4_rproc {
0376         memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>,
0377                         <&vdev0vring1>, <&vdev0buffer>;
0378         mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
0379         mbox-names = "vq0", "vq1", "shutdown";
0380         interrupt-parent = <&exti>;
0381         interrupts = <68 1>;
0382         interrupt-names = "wdg";
0383         recovery;
0384         status = "okay";
0385 };
0386 
0387 &pwr_regulators {
0388         vdd-supply = <&vdd>;
0389         vdd_3v3_usbfs-supply = <&vdd_usb>;
0390 };
0391 
0392 &qspi {
0393         pinctrl-names = "default", "sleep";
0394         pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>;
0395         pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>;
0396         reg = <0x58003000 0x1000>, <0x70000000 0x4000000>;
0397         #address-cells = <1>;
0398         #size-cells = <0>;
0399         status = "okay";
0400 
0401         flash0: flash@0 {
0402                 compatible = "jedec,spi-nor";
0403                 reg = <0>;
0404                 spi-max-frequency = <133000000>;
0405                 spi-rx-bus-width = <1>;
0406                 spi-tx-bus-width = <1>;
0407                 #address-cells = <1>;
0408                 #size-cells = <1>;
0409         };
0410 };
0411 
0412 &rng1 {
0413         status = "okay";
0414 };
0415 
0416 &rtc {
0417         status = "okay";
0418 };
0419 
0420 &sdmmc2 {
0421         arm,primecell-periphid = <0x10153180>;
0422         pinctrl-names = "default", "opendrain", "sleep";
0423         pinctrl-0 = <&sdmmc2_b4_pins_b>;
0424         pinctrl-1 = <&sdmmc2_b4_od_pins_b>;
0425         pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
0426         non-removable;
0427         st,neg-edge;
0428         bus-width = <4>;
0429         vmmc-supply = <&v3v3>;
0430         status = "okay";
0431 };
0432 
0433 &spi1 {
0434         pinctrl-names = "default";
0435         pinctrl-0 = <&spi1_pins_a>;
0436         cs-gpios = <&gpioz 3 0>;
0437         status = "disabled";
0438 
0439         spidev@0  {
0440                 compatible = "spidev";
0441                 reg = <0>;
0442                 spi-max-frequency = <100000>;
0443         };
0444 };
0445 
0446 &timers1 {
0447         /* spare dmas for other usage */
0448         /delete-property/dmas;
0449         /delete-property/dma-names;
0450         pwm {
0451                 pinctrl-0 = <&pwm1_pins_b>;
0452                 pinctrl-1 = <&pwm1_sleep_pins_b>;
0453                 pinctrl-names = "default", "sleep";
0454                 status = "okay";
0455         };
0456         timer@0 {
0457                 status = "okay";
0458         };
0459 };
0460 
0461 &timers4 {
0462         /delete-property/dmas;
0463         /delete-property/dma-names;
0464         pwm {
0465                 pinctrl-0 = <&pwm4_pins_b>;
0466                 pinctrl-1 = <&pwm4_sleep_pins_b>;
0467                 pinctrl-names = "default", "sleep";
0468                 status = "okay";
0469         };
0470         timer@3 {
0471                 status = "okay";
0472         };
0473 };
0474 
0475 &timers5 {
0476         /delete-property/dmas;
0477         /delete-property/dma-names;
0478         pwm {
0479                 pinctrl-0 = <&pwm5_pins_a>;
0480                 pinctrl-1 = <&pwm5_sleep_pins_a>;
0481                 pinctrl-names = "default", "sleep";
0482                 status = "okay";
0483         };
0484         timer@4 {
0485                 status = "okay";
0486         };
0487 };
0488 
0489 &uart4 {
0490         pinctrl-names = "default", "sleep", "idle";
0491         pinctrl-0 = <&uart4_pins_a>;
0492         pinctrl-1 = <&uart4_sleep_pins_a>;
0493         pinctrl-2 = <&uart4_idle_pins_a>;
0494         status = "okay";
0495 };
0496 
0497 &usart2 {
0498         pinctrl-names = "default", "sleep";
0499         pinctrl-0 = <&usart2_pins_a>;
0500         pinctrl-1 = <&usart2_sleep_pins_a>;
0501         status = "okay";
0502 };
0503 
0504 &usart3 {
0505         pinctrl-names = "default", "sleep", "idle";
0506         pinctrl-0 = <&usart3_pins_d>;
0507         pinctrl-1 = <&usart3_sleep_pins_d>;
0508         pinctrl-2 = <&usart3_idle_pins_d>;
0509         status = "okay";
0510 };
0511 
0512 &usbh_ehci {
0513         phys = <&usbphyc_port0>;
0514         phy-names = "usb";
0515         status = "okay";
0516 };
0517 
0518 &usbh_ohci {
0519         phys = <&usbphyc_port0>;
0520         phy-names = "usb";
0521         status = "okay";
0522 };
0523 
0524 &usbotg_hs {
0525         dr_mode = "peripheral";
0526         pinctrl-names = "default";
0527         pinctrl-0 = <&usbotg_hs_pins_a>;
0528         phy-names = "usb2-phy";
0529         phys = <&usbphyc_port1 0>;
0530         vbus-supply = <&vbus_otg>;
0531         status = "okay";
0532 };
0533 
0534 &usbphyc {
0535         status = "okay";
0536 };
0537 
0538 &usbphyc_port0 {
0539         phy-supply = <&vdd_usb>;
0540 };
0541 
0542 &usbphyc_port1 {
0543         phy-supply = <&vdd_usb>;
0544 };
0545 
0546 &vrefbuf {
0547         regulator-min-microvolt = <2500000>;
0548         regulator-max-microvolt = <2500000>;
0549         vdda-supply = <&vdd>;
0550         status = "okay";
0551 };
0552