From 99a3f83e06f85fb3c6fe3c7c6febad44d2e1b8f1 Mon Sep 17 00:00:00 2001 From: DCM Developer Date: Mon, 29 Apr 2025 10:00:00 +0200 Subject: [PATCH] ARM: dts: stm32: add support for stm32mp157c-dcm This patch adds device tree support for the STM32MP157C-DCM custom board. Signed-off-by: DCM Developer --- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/stm32mp157c-dcm.dts | 492 ++++++++++++++++++++++ 2 files changed, 493 insertions(+) create mode 100644 arch/arm/boot/dts/stm32mp157c-dcm.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index a1234567..89012345 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -984,6 +984,7 @@ dtb-$(CONFIG_ARCH_STM32) += \ stm32mp157a-dk1.dtb \ stm32mp157c-dk2.dtb \ stm32mp157c-ed1.dtb \ + stm32mp157c-dcm.dtb \ stm32mp157c-ev1.dtb dtb-$(CONFIG_ARCH_STRATIX10) += \ diff --git a/arch/arm/boot/dts/stm32mp157c-dcm.dts b/arch/arm/boot/dts/stm32mp157c-dcm.dts new file mode 100644 index 0000000..12345678 --- /dev/null +++ b/arch/arm/boot/dts/stm32mp157c-dcm.dts @@ -0,0 +1,492 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) +/* + * Copyright (C) 2025, STMicroelectronics - All Rights Reserved + * Author: STM32CubeMX code generation for STMicroelectronics. + */ + +/* For more information on Device Tree configuration, please refer to + * https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration + */ + +/dts-v1/; + +#include +#include "stm32mp157.dtsi" +#include "stm32mp15xc.dtsi" +#include "stm32mp15xxac-pinctrl.dtsi" +#include "stm32mp15-m4-srm.dtsi" + +/* USER CODE BEGIN includes */ +#include +#include +#include +#include +#include +#include + +#include "stm32mp15-pinctrl.dtsi" +/* USER CODE END includes */ + +/ { + model = "STM32MP157C-DCM Board"; + compatible = "st,stm32mp157c-dcm", "st,stm32mp157"; + + memory@c0000000 { + device_type = "memory"; + reg = <0xc0000000 0x20000000>; /* 512 MB */ + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + mcuram2:mcuram2@10000000 { + compatible = "shared-dma-pool"; + reg = <0x10000000 0x40000>; + no-map; + }; + + vdev0vring0:vdev0vring0@10040000 { + compatible = "shared-dma-pool"; + reg = <0x10040000 0x1000>; + no-map; + }; + + vdev0vring1:vdev0vring1@10041000 { + compatible = "shared-dma-pool"; + reg = <0x10041000 0x1000>; + no-map; + }; + + vdev0buffer:vdev0buffer@10042000 { + compatible = "shared-dma-pool"; + reg = <0x10042000 0x4000>; + no-map; + }; + + mcu_rsc_table:mcu-rsc-table@10048000 { + compatible = "shared-dma-pool"; + reg = <0x10048000 0x8000>; + no-map; + }; + + mcuram:mcuram@30000000 { + compatible = "shared-dma-pool"; + reg = <0x30000000 0x40000>; + no-map; + }; + + retram:retram@38000000 { + compatible = "shared-dma-pool"; + reg = <0x38000000 0x10000>; + no-map; + }; + + gpu_reserved:gpu@d4000000 { + reg = <0xd4000000 0x4000000>; + no-map; + }; + + linux,cma { + compatible = "shared-dma-pool"; + reusable; + size = <0x8000000>; + alignment = <0x2000>; + linux,cma-default; + }; + }; + + aliases { + mmc0 = &sdmmc1; + mmc1 = &sdmmc2; + rtc0 = &i2c4_rtc; + rtc1 = &rtc; + ethernet0 = ðernet0; + serial0 = &uart4; + serial1 = &usart2; + serial2 = &usart3; + }; + + /* DVI Transmitter Definition */ + dvi_transmitter: tfp410 { + compatible = "ti,tfp410"; + pinctrl-names = "default"; + pinctrl-0 = <&tfp410_pins>; + powerdown-gpios = <&gpioa 6 GPIO_ACTIVE_LOW>; + reset-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>; /* HDMI_NRST auf PA4 (aktiv niedrig) */ + + /* Neuer Eintrag für den Interrupt-Pin PA3 */ + interrupt-parent = <&gpioa>; + interrupts = <3 IRQ_TYPE_EDGE_FALLING>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + tfp410_in: endpoint { + remote-endpoint = <<dc_out0>; + }; + }; + + port@1 { + reg = <1>; + tfp410_out: endpoint { + remote-endpoint = <&dvi_connector_in>; + }; + }; + }; + }; + + /* DVI Connector Definition */ + dvi: connector { + compatible = "dvi-connector"; + label = "dvi"; + ddc-i2c-bus = <&i2c2>; + + port { + dvi_connector_in: endpoint { + remote-endpoint = <&tfp410_out>; + }; + }; + }; + + led { + compatible = "gpio-leds"; + + led-a { + label = "heartbeat"; + gpios = <&gpiof 12 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + default-state = "off"; + }; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "STM32MP1-DCM-Audio"; + simple-audio-card,format = "i2s"; + simple-audio-card,widgets = + "Microphone", "Mic Jack", + "Line", "Line In", + "Line", "Line Out", + "Headphone", "Headphone Jack"; + + simple-audio-card,routing = + "Line Out", "LOUT", + "Line Out", "ROUT", + "Headphone Jack", "LHPOUT", + "Headphone Jack", "RHPOUT", + "LLINEIN", "Line In", + "RLINEIN", "Line In", + "MICIN", "Mic Jack"; + + simple-audio-card,cpu { + sound-dai = <&sai2>; /* Anpassen an den verwendeten SAI-Port */ + }; + + simple-audio-card,codec { + sound-dai = <&tlv320ahc>; + system-clock-frequency = <12288000>; /* Typischer Takt, anpassen falls nötig */ + }; + }; + + vin: vin { + compatible = "regulator-fixed"; + regulator-name = "vin"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + }; + + chosen { + #address-cells = <1>; + #size-cells = <1>; + ranges; + stdout-path = "serial0:115200n8"; + + framebuffer { + compatible = "simple-framebuffer"; + clocks = <&rcc LTDC_PX>; + status = "disabled"; + }; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + /* reset-gpios = <&gpioh 4 GPIO_ACTIVE_LOW>; */ + }; + + /* DC power supply */ + v3v3_reg: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "v3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + /* Ethernet PHY power supply */ + eth_phy_vdd: regulator-eth-phy { + compatible = "regulator-fixed"; + regulator-name = "eth_phy_vdd"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpiog 5 GPIO_ACTIVE_HIGH>; + startup-delay-us = <100000>; + enable-active-high; + }; +}; + +<dc { + status = "okay"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <<dc_pins_mx>; + pinctrl-1 = <<dc_sleep_pins_mx>; + + port { + #address-cells = <1>; + #size-cells = <0>; + + ltdc_out0: endpoint { + remote-endpoint = <&tfp410_in>; + }; + }; +}; + +ðernet0 { + status = "okay"; + pinctrl-0 = <ð1_pins_mx>; + pinctrl-1 = <ð1_sleep_pins_mx>; + pinctrl-names = "default", "sleep"; + phy-mode = "rgmii-id"; + max-speed = <1000>; + phy-handle = <&phy0>; + phy-supply = <ð_phy_vdd>; + + mdio0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + phy0: ethernet-phy@1 { + reg = <1>; + compatible = "ethernet-phy-ieee802.3-c22"; + interrupt-parent = <&gpiog>; + interrupts = <12 IRQ_TYPE_EDGE_FALLING>; + ti,rx-internal-delay = ; + ti,tx-internal-delay = ; + ti,fifo-depth = ; + ti,min-output-impedance; + enet-phy-lane-no-swap; + ti,clk-output-sel = ; + }; + }; +}; + +&i2c1 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&i2c1_pins_mx>; + pinctrl-1 = <&i2c1_sleep_pins_mx>; + status = "okay"; + i2c-scl-rising-time-ns = <100>; + i2c-scl-falling-time-ns = <7>; + + /* TLV320AHC Audio Codec */ + tlv320ahc: tlv320ahc@18 { + compatible = "ti,tlv320aic23"; + reg = <0x18>; + #sound-dai-cells = <0>; + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + tlv320ahc_tx_endpoint: endpoint { + remote-endpoint = <&sai2a_endpoint>; + }; + }; + + port@1 { + reg = <1>; + tlv320ahc_rx_endpoint: endpoint { + remote-endpoint = <&sai2b_endpoint>; + }; + }; + }; + }; +}; + +&i2c2 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&i2c2_pins_mx>; + pinctrl-1 = <&i2c2_sleep_pins_mx>; + status = "okay"; + i2c-scl-rising-time-ns = <100>; + i2c-scl-falling-time-ns = <100>; + clock-frequency = <100000>; +}; + +&i2c4 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&i2c4_pins_z_mx>; + pinctrl-1 = <&i2c4_sleep_pins_z_mx>; + status = "okay"; + i2c-scl-rising-time-ns = <185>; + i2c-scl-falling-time-ns = <20>; + clock-frequency = <400000>; + + i2c4_eeprom: eeprom@50 { + compatible = "atmel,24c32"; + reg = <0x50>; + status = "okay"; + }; + + i2c4_rtc: rtc@52 { + compatible = "microcrystal,rv3028"; + reg = <0x52>; + status = "okay"; + }; +}; + +&qspi { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&quadspi_pins_mx>; + pinctrl-1 = <&quadspi_sleep_pins_mx>; + status = "okay"; + reg = <0x58003000 0x1000>, <0x70000000 0x4000000>; + + flash0: flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-rx-bus-width = <4>; + spi-max-frequency = <108000000>; + #address-cells = <1>; + #size-cells = <1>; + }; +}; + +&uart4 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&uart4_pins_a>; + pinctrl-1 = <&uart4_sleep_pins_a>; + status = "okay"; +}; + +&sdmmc1 { + pinctrl-names = "default", "opendrain", "sleep"; + pinctrl-0 = <&sdmmc1_pins_mx &sdmmc1_cd_pins>; + pinctrl-1 = <&sdmmc1_opendrain_pins_mx>; + pinctrl-2 = <&sdmmc1_sleep_pins_mx>; + cd-gpios = <&gpiof 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + disable-wp; + st,neg-edge; + bus-width = <4>; + vmmc-supply = <&v3v3_reg>; + status = "okay"; +}; + +&sdmmc2 { + pinctrl-names = "default", "opendrain", "sleep"; + pinctrl-0 = <&sdmmc2_pins_mx>; + pinctrl-1 = <&sdmmc2_opendrain_pins_mx>; + pinctrl-2 = <&sdmmc2_sleep_pins_mx>; + non-removable; + no-sd; + no-sdio; + st,neg-edge; + bus-width = <8>; + vmmc-supply = <&v3v3_reg>; + vqmmc-supply = <&v3v3_reg>; + mmc-ddr-3_3v; + status = "okay"; +}; + +&usart1 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&usart1_pins_mx>; + pinctrl-1 = <&usart1_sleep_pins_mx>; + status = "okay"; + /* RS-485 configuration */ + rs485-rts-delay = <0 0>; + linux,rs485-enabled-at-boot-time; + rs485-rts-active-high; + uart-has-rtscts; +}; + +&usart2 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&usart2_pins_mx>; + pinctrl-1 = <&usart2_sleep_pins_mx>; + status = "okay"; +}; + +&iwdg2 { + timeout-sec = <32>; + status = "okay"; +}; + +&sai2 { + st,iec60958; + status = "okay"; + + sai2a: audio-controller@4400b004 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&sai2a_pins_mx>; + pinctrl-1 = <&sai2a_sleep_pins_mx>; + status = "okay"; + sai2a_port: port { + sai2a_endpoint: endpoint { + remote-endpoint = <&tlv320ahc_tx_endpoint>; + dai-format = "i2s"; + mclk-fs = <256>; + dai-tdm-slot-num = <2>; + dai-tdm-slot-width = <32>; + }; + }; + }; + + sai2b: audio-controller@4400b024 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&sai2b_pins_mx>; + pinctrl-1 = <&sai2b_sleep_pins_mx>; + status = "okay"; + sai2b_port: port { + sai2b_endpoint: endpoint { + remote-endpoint = <&tlv320ahc_rx_endpoint>; + dai-format = "i2s"; + mclk-fs = <256>; + dai-tdm-slot-num = <2>; + dai-tdm-slot-width = <32>; + }; + }; + }; +}; -- 2.42.0 _dir_pins_a>; + pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_a>; + broken-cd; + disable-wp; + st,neg-edge; + bus-width = <4>; + vmmc-supply = <&v3v3_reg>; + status = "okay"; +}; + +/* eMMC */ +&sdmmc2 { + pinctrl-names = "default", "opendrain", "sleep"; + pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_a>; + pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_a>; + pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_a>; + non-removable; + no-sd; + no-sdio; + st,neg-edge; + bus-width = <8>; + vmmc-supply = <&v3v3_reg>; + vqmmc-supply = <&v3v3_reg>; + mmc-ddr-3_3v; + status = "okay"; +}; + +/* I2C bus */ +&i2c1 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&i2c1_pins_a>; + pinctrl-1 = <&i2c1_sleep_pins_a>; + i2c-scl-rising-time-ns = <100>; + i2c-scl-falling-time-ns = <7>; + status = "okay"; + clock-frequency = <400000>; +}; + +/* USB OTG HS */ +&usbotg_hs { + dr_mode = "otg"; + pinctrl-0 = <&usbotg_hs_pins_a>; + pinctrl-names = "default"; + status = "okay"; +}; + +/* USB Host */ +&usbh_ehci { + status = "okay"; +}; + +&usbh_ohci { + status = "okay"; +}; + +/* RTC */ +&rtc { + status = "okay"; +}; + +/* Watchdog */ +&iwdg2 { + timeout-sec = <32>; + status = "okay"; +}; + +/* CAN bus */ +&m_can1 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&m_can1_pins_a>; + pinctrl-1 = <&m_can1_sleep_pins_a>; + status = "okay"; +}; + +/* SPI Flash */ +&qspi { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>; + pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>; + status = "okay"; + reg = <0x58003000 0x1000>, <0x70000000 0x4000000>; + + flash0: flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-rx-bus-width = <4>; + spi-max-frequency = <108000000>; + #address-cells = <1>; + #size-cells = <1>; + }; +}; + +/* ADC */ +&adc { + pinctrl-names = "default"; + pinctrl-0 = <&adc1_pins_a>; + vdd-supply = <&v3v3_reg>; + vdda-supply = <&v3v3_reg>; + vref-supply = <&v3v3_reg>; + status = "okay"; + adc1: adc@0 { + st,adc-channels = <0 1 2>; + st,min-sample-time-nsecs = <5000>; + status = "okay"; + }; +}; + +/* PWM */ +&timers1 { + status = "okay"; + pwm { + pinctrl-0 = <&pwm1_pins_a>; + pinctrl-names = "default"; + status = "okay"; + }; + timer@0 { + status = "okay"; + }; +}; + +/* Misc */ +&pwr_regulators { + vdd-supply = <&v3v3_reg>; + vdd_3v3_usbfs-supply = <&v3v3_reg>; +}; +-- +2.42.0