diff --git a/STM32MP157/doc_pic/09_UART/04_a_先修改STM32MP157的设备树以使用UART8.md b/STM32MP157/doc_pic/09_UART/04_a_先修改STM32MP157的设备树以使用UART8.md new file mode 100644 index 0000000..f9dde2e --- /dev/null +++ b/STM32MP157/doc_pic/09_UART/04_a_先修改STM32MP157的设备树以使用UART8.md @@ -0,0 +1,63 @@ +## 先修改STM32MP157的设备树以使用UART8 + + + +### 1. 只关注APP开发的话 + +把GIT仓库中这个dtb文件复制到开发板上去就可以: + +```shell +doc_and_source_for_drivers\STM32MP157\source\A7\09_UART\00_stm32mp157_devicetree_for_uart8\dtb + stm32mp157c-100ask-512d-lcd-v1.dtb +``` + + + +操作方法: + + * Ubuntu上:复制dtb文件到NFS目录: + + ```shell + $ cp stm32mp157c-100ask-512d-lcd-v1.dtb ~/nfs_rootfs/ + ``` + + * 开发板上挂载NFS文件系统 + + * vmware使用NAT(假设windowsIP为192.168.1.100) + + ```shell + [root@100ask:~]# mount -t nfs -o nolock,vers=3,port=2049,mountport=9999 + 192.168.1.100:/home/book/nfs_rootfs /mnt + ``` + + * vmware使用桥接,或者不使用vmware而是直接使用服务器:假设Ubuntu IP为192.168.1.137 + + ```shell + [root@100ask:~]# mount -t nfs -o nolock,vers=3 192.168.1.137:/home/book/nfs_rootfs /mnt + ``` + +* 更新设备树 + + ```shell + [root@100ask:~]# mount /dev/mmcblk2p2 /boot + [root@100ask:~]# cp /mnt/stm32mp157c-100ask-512d-lcd-v1.dtb /boot + [root@100ask:~]# sync + ``` + +* 重启开发板 + +* 在串口可以看到以下设备节点 + + ```shell + ls /dev/ttySTM* + /dev/ttySTM0 + /dev/ttySTM1 + /dev/ttySTM3 + ``` + + + + + +### 2. 从头修改设备树文件 + diff --git a/STM32MP157/source/A7/09_UART/00_stm32mp157_devicetree_for_uart8/dtb/stm32mp157c-100ask-512d-lcd-v1.dtb b/STM32MP157/source/A7/09_UART/00_stm32mp157_devicetree_for_uart8/dtb/stm32mp157c-100ask-512d-lcd-v1.dtb new file mode 100644 index 0000000..e3fb555 Binary files /dev/null and b/STM32MP157/source/A7/09_UART/00_stm32mp157_devicetree_for_uart8/dtb/stm32mp157c-100ask-512d-lcd-v1.dtb differ diff --git a/STM32MP157/source/A7/09_UART/00_stm32mp157_devicetree_for_uart8/dts/stm32mp157c-100ask-512d-v1.dts b/STM32MP157/source/A7/09_UART/00_stm32mp157_devicetree_for_uart8/dts/stm32mp157c-100ask-512d-v1.dts new file mode 100644 index 0000000..cdb7f86 --- /dev/null +++ b/STM32MP157/source/A7/09_UART/00_stm32mp157_devicetree_for_uart8/dts/stm32mp157c-100ask-512d-v1.dts @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* +* Copyright (C) 100ASK 2020 - All Rights Reserved +* Author: 100ask +* support: weidongshan@qq.com +*/ + +/dts-v1/; + +#include "stm32mp157.dtsi" +#include "stm32mp15xa.dtsi" +#include "stm32mp157-100ask-pinctrl.dtsi" +#include "stm32mp15xxac-pinctrl.dtsi" +#include "stm32mp15xx-100ask.dtsi" + +/ { + model = "100ASK YA157C v2 www.100ask.com"; + compatible = "st,stm32mp157c-100ask-512d-v1", "st,stm32mp157"; + + aliases { + ethernet0 = ðernet0; + serial0 = &uart4; //debug + serial1 = &usart6; //rs485 + serial2 = &usart1; //bluetooth + serial3 = &uart8; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + reserved-memory { + gpu_reserved: gpu@da000000 { + reg = <0xda000000 0x4000000>; + no-map; + }; + + optee_memory: optee@0xde000000 { + reg = <0xde000000 0x02000000>; + no-map; + }; + }; + +}; + +&optee { + status = "okay"; +}; diff --git a/STM32MP157/source/A7/09_UART/00_stm32mp157_devicetree_for_uart8/dts/stm32mp15xx-100ask.dtsi b/STM32MP157/source/A7/09_UART/00_stm32mp157_devicetree_for_uart8/dts/stm32mp15xx-100ask.dtsi new file mode 100644 index 0000000..9a0cbbe --- /dev/null +++ b/STM32MP157/source/A7/09_UART/00_stm32mp157_devicetree_for_uart8/dts/stm32mp15xx-100ask.dtsi @@ -0,0 +1,960 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright (C) STMicroelectronics 2019 - All Rights Reserved + * Author: Alexandre Torgue for STMicroelectronics. + */ + +#include "stm32mp157-m4-srm.dtsi" +#include "stm32mp157-m4-srm-pinctrl.dtsi" +#include +#include +#include +#include + +/ { + memory@c0000000 { + device_type = "memory"; + reg = <0xc0000000 0x20000000>; + }; + + 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; + }; + + mcuram: mcuram@30000000 { + compatible = "shared-dma-pool"; + reg = <0x30000000 0x40000>; + no-map; + }; + + retram: retram@38000000 { + compatible = "shared-dma-pool"; + reg = <0x38000000 0x10000>; + no-map; + }; + }; + phy_pwrseq: phy-pwrseq { + compatible = "myir,ar8035"; + phy-gpios = <&gpiog 0 GPIO_ACTIVE_LOW>; + }; + + vmmcsd_fixed: fixedregulator@0 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + }; +#if 0 + fusb302_regulator: fusb302_reg { + compatible = "regulator-fixed"; + regulator-name = "vbus_otg"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpiof 12 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-active-discharge; + }; +#endif + wifi_fixed: fixedregulator@1 { + pinctrl-names = "default"; + pinctrl-0 = <&wifi_fixed_pins_a>; + compatible = "regulator-fixed"; + regulator-name = "wifi_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + startup-delay-us = <70000>; + regulator-boot-on; + regulator-pull-down; + + }; + vmmc: fixedregulator@2 { + compatible = "regulator-fixed"; + regulator-name = "vmmc"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + startup-delay-us = <70000>; + enable-active-high; + }; + + + vdd_usb: fixedregulator@3 { + compatible = "regulator-fixed"; + regulator-name = "vdd_usb"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + startup-delay-us = <70000>; + regulator-boot-on; + regulator-pull-down; + }; + + + joystick { + status = "disabled"; + compatible = "gpio-keys"; + #size-cells = <0>; + button-0 { + label = "usr_button0"; + linux,code = ; + interrupt-parent = <&gpiog>; + interrupts = <3 IRQ_TYPE_EDGE_RISING>; + }; + button-1 { + label = "usr_button1"; + linux,code = ; + interrupt-parent = <&gpiog>; + interrupts = <2 IRQ_TYPE_EDGE_RISING>; + }; + + }; + + led { + compatible = "gpio-leds"; + blue { + label = "heartbeat"; + gpios = <&gpioa 10 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + default-state = "off"; + }; + red { + label = "red"; + gpios = <&gpiog 8 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "none"; + status = "okay"; + }; + + }; + + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&gpioi 3 GPIO_ACTIVE_LOW>; + }; + + panel_backlight: panel-backlight { + compatible = "gpio-backlight"; + gpios = <&gpioe 11 GPIO_ACTIVE_HIGH>; + default-on; + status = "okay"; + }; + + usb_phy_tuning: usb-phy-tuning { + st,hs-dc-level = <2>; + st,fs-rftime-tuning; + st,hs-rftime-reduction; + st,hs-current-trim = <15>; + st,hs-impedance-trim = <1>; + st,squelch-level = <3>; + st,hs-rx-offset = <2>; + st,no-lsfs-sc; + }; + + vin: vin { + compatible = "regulator-fixed"; + regulator-name = "vin"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + }; + + regulators { + compatible = "regulator-gpio"; + buck1-supply = <&vin>; + buck2-supply = <&vin>; + buck3-supply = <&vin>; + buck4-supply = <&vin>; + ldo1-supply = <&v3v3>; + ldo2-supply = <&vin>; + ldo3-supply = <&vdd_ddr>; + ldo4-supply = <&vin>; + ldo5-supply = <&vin>; + ldo6-supply = <&v3v3>; + vref_ddr-supply = <&vin>; + boost-supply = <&vin>; + pwr_sw1-supply = <&bst_out>; + pwr_sw2-supply = <&bst_out>; + + vddcore: buck1 { + regulator-name = "vddcore"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1350000>; + regulator-always-on; + regulator-initial-mode = <0>; + regulator-over-current-protection; + }; + + vdd_ddr: buck2 { + regulator-name = "vdd_ddr"; + regulator-min-microvolt = <1350000>; + regulator-max-microvolt = <1350000>; + regulator-always-on; + regulator-initial-mode = <0>; + regulator-over-current-protection; + }; + + vdd: buck3 { + regulator-name = "vdd"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + st,mask-reset; + regulator-initial-mode = <0>; + regulator-over-current-protection; + }; + + v3v3: buck4 { + regulator-name = "v3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-over-current-protection; + regulator-initial-mode = <0>; + }; + + v1v8_audio: ldo1 { + regulator-name = "v1v8_audio"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + //interrupts = ; + }; + + v3v3_hdmi: ldo2 { + regulator-name = "v3v3_hdmi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + //interrupts = ; + }; + + vtt_ddr: ldo3 { + regulator-name = "vtt_ddr"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <750000>; + regulator-always-on; + regulator-over-current-protection; + }; + vdda: ldo5 { + regulator-name = "vdda"; + regulator-min-microvolt = <2900000>; + regulator-max-microvolt = <2900000>; + //interrupts = ; + regulator-boot-on; + }; + + v1v2_hdmi: ldo6 { + regulator-name = "v1v2_hdmi"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-always-on; + //interrupts = ; + }; + + vref_ddr: vref_ddr { + regulator-name = "vref_ddr"; + regulator-always-on; + regulator-over-current-protection; + }; + + bst_out: boost { + regulator-name = "bst_out"; + //interrupts = ; + }; + + vbus_otg: pwr_sw1 { + regulator-name = "vbus_otg"; + //interrupts = ; + }; + + vbus_sw: pwr_sw2 { + regulator-name = "vbus_sw"; + //interrupts = ; + regulator-active-discharge = <1>; + }; + }; + + + + + sound { + compatible = "audio-graph-card"; + label = "WM8960-100ASK"; + mclk-fs = <256>; + dai-format = "i2s"; + dais = <&sai1a_port &sai1b_port>; + //dais = <&sai1b_port>; + routing = "LINPUT1", "MICB", "RINPUT1", "MICB", "RINPUT2", "MICB"; + status = "okay"; + }; + +}; + +/*myir pin header + *ANA0 ANA1 + *PF13(ADC2_INP2) PF11(ADC1_INP2) + *PF14(ADC2_INP6 or ADC2_INN2) + *PF12(ADC1_INP6 or ADC1_INN2) + * + */ +&adc { + pinctrl-names = "default"; + pinctrl-0 = <&adc1_in6_pins_a>; + vdd-supply = <&vdd>; + vdda-supply = <&vdda>; + vref-supply = <&vdda>; + status = "okay"; + adc1: adc@0 { + /* + * Type-C USB_PWR_CC1 & USB_PWR_CC2 on in18 & in19. + * Use at least 5 * RC time, e.g. 5 * (Rp + Rd) * C: + * 5 * (56 + 47kOhms) * 5pF => 2.5us. + * Use arbitrary margin here (e.g. 5µs). + */ + st,min-sample-time-nsecs = <5000>; + /* ANA0, ANA1, USB Type-C CC1 & CC2 */ + st,adc-channels = <0 1 18 19>; + status = "okay"; + }; + adc2: adc@100 { + /* ANA0, ANA1, temp sensor, USB Type-C CC1 & CC2 */ + st,adc-channels = <0 1 12 18 19>; + /* temperature sensor min sample time */ + st,min-sample-time-nsecs = <10000>; + status = "okay"; + }; + adc_temp: temp { + status = "okay"; + }; + +}; + +&cec { + pinctrl-names = "default", "sleep"; +// pinctrl-0 = <&cec_pins_a>; +// pinctrl-1 = <&cec_pins_sleep_a>; + status = "okay"; +}; + +&cpu0{ + cpu-supply = <&vddcore>; +}; + +&cpu1{ + cpu-supply = <&vddcore>; +}; + +&crc1 { + status = "okay"; +}; + +&dma1 { + sram = <&dma_pool>; +}; + +&dma2 { + sram = <&dma_pool>; +}; + +&dts { + status = "okay"; +}; + +ðernet0 { + status = "okay"; + pinctrl-0 = <ðernet0_rgmii_pins_a>; + pinctrl-1 = <ðernet0_rgmii_pins_sleep_a>; + pinctrl-names = "default", "sleep"; + phy-mode = "rgmii"; + max-speed = <1000>; + phy-handle = <&phy0>; + + mdio0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + phy0: ethernet-phy@6 { + reg = <6>; + }; + }; +}; + +&gpu { + contiguous-area = <&gpu_reserved>; + status = "okay"; +}; + +&hash1 { + status = "okay"; +}; + +&sai1 { + clocks = <&rcc SAI1>, <&rcc PLL3_Q>, <&rcc PLL3_R>; + clock-names = "pclk", "x8k", "x11k"; + + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&sai1a_pins_mx &sai1b_pins_mx>; + pinctrl-1 = <&sai1a_sleep_pins_mx &sai1b_sleep_pins_mx>; + status = "okay"; +}; + +&sai1a { + clocks = <&rcc SAI1_K>, <&sai1b>; + clock-names = "sai_ck", "MCLK"; + + status = "okay"; + dma-names = "tx"; + st,sync = <&sai1b 1>; + sai1a_port: port { + sai1a_endpoint: endpoint { + remote-endpoint = <&wm8960_tx_endpoint>; + format = "i2s"; + mclk-fs = <256>; + dai-tdm-slot-num = <2>; + dai-tdm-slot-width = <16>; + }; + }; +}; + +&sai1b { + status = "okay"; + dma-names = "rx"; + #clock-cells = <0>; + sai1b_port: port { + sai1b_endpoint: endpoint { + remote-endpoint = <&wm8960_rx_endpoint>; + format = "i2s"; + mclk-fs = <256>; + dai-tdm-slot-num = <2>; + dai-tdm-slot-width = <16>; + }; + }; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins_a>; + i2c-scl-rising-time-ns = <185>; + i2c-scl-falling-time-ns = <20>; + status = "okay"; + /delete-property/dmas; + /delete-property/dma-names; +#if 0 + typec: fusb302@22 { + compatible = "fcs,fusb302", "fairchild,fusb302"; + reg = <0x22>; + pinctrl-names = "default"; + pinctrl-0 = <&fusb302_pins_a>; + + vbus-supply = <&fusb302_regulator>; + int-n-gpios = <&gpiof 10 GPIO_ACTIVE_HIGH>; + vbus-5v-gpios = <&gpiof 12 GPIO_ACTIVE_HIGH>; + interrupt-parent = <&gpiof>; + interrupts = <10 IRQ_TYPE_EDGE_FALLING>; + status = "okay"; + }; +#endif +#if 1 + typec: fusb302@22 { + compatible = "fcs,fusb302", "fairchild,fusb302"; + reg = <0x22>; + pinctrl-names = "default"; + pinctrl-0 = <&fusb302_pins_a>; + + //vbus-supply = <&fusb302_regulator>; + int-n-gpios = <&gpiof 10 GPIO_ACTIVE_HIGH>; + vbus-5v-gpios = <&gpiof 12 GPIO_ACTIVE_HIGH>; + status = "okay"; + + //interrupt-parent = <&gpiof>; + //interrupts = <10 IRQ_TYPE_EDGE_FALLING>; +#if 1 + connector { + compatible = "usb-c-connector"; + label = "USB-C"; + power-role = "dual"; + power-opmode = "default"; + + try-power-role = "sink"; + source-pdos = ; + sink-pdos = ; + op-sink-microwatt = <10000000>; + + port { + con_usbotg_hs_ep: endpoint { + remote-endpoint = <&usbotg_hs_ep>; + }; + }; + }; +#endif + }; +#endif + codec: wm8960@1a { + compatible = "wlf,wm8960"; + reg = <0x1a>; + #sound-dai-cells = <0x0>; + status = "okay"; + hp-det = <3 0>; + //reset-gpios = <&gpiog 9 GPIO_ACTIVE_LOW>; + clocks = <&sai1b>; + //clocks = <&rcc SAI1_K>; + clock-names = "mclk"; + wlf,shared-lrclk; + wlf,double-dai; + + port { + #address-cells = <0x1>; + #size-cells = <0x0>; + + wm8960_tx_endpoint: endpoint@0 { + reg = <0x0>; + remote-endpoint = <&sai1a_endpoint>; + frame-master; + bitclock-master; + }; + + wm8960_rx_endpoint: endpoint@1 { + reg = <0x1>; + remote-endpoint = <&sai1b_endpoint>; + frame-master; + bitclock-master; + }; + }; + }; +}; + + +&i2c2 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&i2c2_pins_z_mx>; + pinctrl-1 = <&i2c2_sleep_pins_z_mx>; + i2c-scl-rising-time-ns = <100>; + i2c-scl-falling-time-ns = <7>; + status = "okay"; + /delete-property/dmas; + /delete-property/dma-names; + //clock-frequency = <100000>; + + + +}; + +&i2c4 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&i2c4_pins_a>; + pinctrl-1 = <&i2c4_pins_sleep_a>; + i2c-scl-rising-time-ns = <185>; + i2c-scl-falling-time-ns = <20>; + clock-frequency = <400000>; + status = "okay"; + /* spare dmas for other usage */ + /delete-property/dmas; + /delete-property/dma-names; + + gt911@5d { + compatible = "goodix,gt928"; + reg = <0x5d>; + interrupt-parent = <&gpioe>; + interrupts = <4 IRQ_TYPE_EDGE_FALLING>; + reset-gpios = <&gpioe 12 GPIO_ACTIVE_LOW>; + irq-gpios = <&gpioe 4 IRQ_TYPE_EDGE_FALLING>; + irq-flags = <2>; /*1:rising 2: falling*/ + touchscreen-max-id = <5>; + touchscreen-size-x = <1024>; + touchscreen-size-y = <600>; + }; + + + + +}; + + +&ipcc { + status = "okay"; +}; + +&iwdg2 { + timeout-sec = <32>; + status = "okay"; +}; + + +&m4_rproc { + memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>, + <&vdev0vring1>, <&vdev0buffer>; + mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>; + mbox-names = "vq0", "vq1", "shutdown"; + interrupt-parent = <&exti>; + interrupts = <68 1>; + wakeup-source; + status = "okay"; +}; + +/* +&pwr { + pwr-supply = <&vdd>; +}; +*/ + +#if 0 +&pwr_regulators { + vdd-supply = <&vdd>; + vdd_3v3_usbfs-supply = <&vdd_usb>; + + reg11: reg11 { + regulator-name = "reg11"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + }; + + reg18: reg18 { + regulator-name = "reg18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + usb33: usb33 { + regulator-name = "usb33"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; +}; +#endif + +&rng1 { + status = "okay"; +}; + +/* Wifi */ +&sdmmc3 { + arm,primecell-periphid = <0x10153180>; + pinctrl-names = "default", "opendrain", "sleep"; + pinctrl-0 = <&sdmmc3_b4_pins_a>; + pinctrl-1 = <&sdmmc3_b4_od_pins_a>; + pinctrl-2 = <&sdmmc3_b4_sleep_pins_a>; + non-removable; + st,neg-edge; + bus-width = <4>; + vmmc-supply = <&wifi_fixed>; + mmc-pwrseq = <&wifi_pwrseq>; + #address-cells = <1>; + #size-cells = <0>; + keep-power-in-suspend; + 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,dirpol; + st,negedge; + bus-width = <8>; + vmmc-supply = <&vmmc>; + vqmmc-supply = <&vmmc>; + status = "okay"; +}; + +/*SD card*/ +&sdmmc1 { + pinctrl-names = "default", "opendrain", "sleep"; + pinctrl-0 = <&sdmmc1_b4_pins_a>; + pinctrl-1 = <&sdmmc1_b4_od_pins_a>; + pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>; + broken-cd; + st,neg-edge; + bus-width = <4>; + vmmc-supply = <&vmmcsd_fixed>; + status = "okay"; +}; + + + +&usart1{ + pinctrl-names = "default", "sleep","idle"; + pinctrl-0 = <&usart1_pins_z_mx>; + pinctrl-1 = <&usart1_sleep_pins_z_mx>; + pinctrl-2 = <&usart1_idle_pins_z_mx>; + uart-has-rtscts; + status = "okay"; + + bluetooth { + //pinctrl-names = "default"; + //pinctrl-0 = <&btreg_s>; + shutdown-gpios = <&gpioa 14 GPIO_ACTIVE_HIGH>; + compatible = "brcm,bcm43438-bt"; + max-speed = <3000000>; + }; +}; + + +/*DEBUG*/ +&uart4 { + pinctrl-names = "default", "sleep", "idle"; + pinctrl-0 = <&uart4_pins_a>; + pinctrl-1 = <&uart4_sleep_pins_a>; + pinctrl-2 = <&uart4_idle_pins_a>; + pinctrl-3 = <&uart4_pins_a>; + /delete-property/dmas; + /delete-property/dma-names; + status = "okay"; +}; + + +&uart8 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&uart8_pins_mx>; + pinctrl-1 = <&uart8_sleep_pins_mx>; + status = "okay"; +}; + +/*pwm for backlight no usr*/ +&timers15 { + /delete-property/dmas; + /delete-property/dma-names; + pwm { + pinctrl-0 = <&pwm15_pins_a>; + pinctrl-1 = <&pwm15_sleep_pins_a>; + pinctrl-names = "default", "sleep"; + status = "okay"; + }; + timer@14 { + status = "okay"; + }; +}; + +/*SPI for A7 core*/ +/* +&spi1 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&spi1_pins_a>; + pinctrl-1 = <&spi1_sleep_pins_a>; + cs-gpios = <&gpioz 3 0>; + status = "okay"; + spidev@0 { + compatible = "spidev"; + spi-max-frequency = <20000000>; + reg = <0>; + }; + +}; +*/ + +/*SPI1 for M4 core*/ +&m4_spi1 { + pinctrl-names = "rproc_default"; + pinctrl-0 = <&m4_spi1_pins_z_mx>; + status = "okay"; + +}; + +&sram { + dma_pool: dma_pool@0 { + reg = <0x50000 0x10000>; + pool; + }; +}; + +&timers1 { + /* spare dmas for other usage */ + /delete-property/dmas; + /delete-property/dma-names; + status = "disabled"; + pwm { + pinctrl-0 = <&pwm1_pins_a>; + pinctrl-1 = <&pwm1_sleep_pins_a>; + pinctrl-names = "default", "sleep"; + status = "okay"; + }; + timer@0 { + status = "okay"; + }; +}; + +&timers3 { + /delete-property/dmas; + /delete-property/dma-names; + status = "disabled"; + pwm { + pinctrl-0 = <&pwm3_pins_a>; + pinctrl-1 = <&pwm3_sleep_pins_a>; + pinctrl-names = "default", "sleep"; + status = "okay"; + }; + timer@2 { + status = "okay"; + }; +}; + +&timers4 { + /delete-property/dmas; + /delete-property/dma-names; + status = "disabled"; + pwm { + pinctrl-0 = <&pwm4_pins_a &pwm4_pins_b>; + pinctrl-1 = <&pwm4_sleep_pins_a &pwm4_sleep_pins_b>; + pinctrl-names = "default", "sleep"; + status = "okay"; + }; + timer@3 { + status = "okay"; + }; +}; + +&timers5 { + /delete-property/dmas; + /delete-property/dma-names; + status = "disabled"; + pwm { + pinctrl-0 = <&pwm5_pins_a>; + pinctrl-1 = <&pwm5_sleep_pins_a>; + pinctrl-names = "default", "sleep"; + status = "okay"; + }; + timer@4 { + status = "okay"; + }; +}; + +&timers6 { + /delete-property/dmas; + /delete-property/dma-names; + status = "disabled"; + timer@5 { + status = "okay"; + }; +}; + +&timers12 { + /delete-property/dmas; + /delete-property/dma-names; + status = "disabled"; + pwm { + pinctrl-0 = <&pwm12_pins_a>; + pinctrl-1 = <&pwm12_sleep_pins_a>; + pinctrl-names = "default", "sleep"; + status = "okay"; + }; + timer@11 { + status = "okay"; + }; +}; + +&usbh_ohci { + phys = <&usbphyc_port0>; + status = "okay"; +}; + +&usbh_ehci { + phys = <&usbphyc_port0>; + status = "okay"; +}; + + +&usbotg_hs { + /*USB_ID but no use*/ +// pinctrl-names = "default"; +// pinctrl-0 = <&usbotg_hs_pins_a>; +// dr_mode = "peripheral"; +// force-b-session-valid; + + extcon = <&typec>; + phys = <&usbphyc_port1 0>; + phy-names = "usb2-phy"; + usb-role-switch; + status = "okay"; +#if 1 + port { + usbotg_hs_ep: endpoint { + remote-endpoint = <&con_usbotg_hs_ep>; + }; + }; +#endif +}; + + +&usbphyc { + status = "okay"; +}; + +&usbphyc_port0 { + phy-supply = <&vdd_usb>; + st,phy-tuning = <&usb_phy_tuning>; +}; + +&usbphyc_port1 { + phy-supply = <&vdd_usb>; + st,phy-tuning = <&usb_phy_tuning>; +}; + + +&rtc { + st,lsco = ; + pinctrl-0 = <&rtc_out2_rmp_pins_a>; + pinctrl-names = "default"; +}; + +&rtc { + status = "okay"; +}; + + +&vrefbuf { + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + vdda-supply = <&vdd>; + status = "okay"; +}; + +/*rs485*/ +&usart6 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&uart6_pins_a>; + status = "okay"; +}; + +/*can*/ +&m_can2 { + pinctrl-names = "default"; + pinctrl-0 = <&m_can2_pins_a_100ask>; + status = "okay"; + + can-transceiver { + max-bitrate = <5000000>; + }; + +};