Compare commits
229 Commits
v2022.10-s
...
v2020.01-s
| Author | SHA1 | Date | |
|---|---|---|---|
| 764fc8b259 | |||
| 33f5ad695a | |||
| 1c3ae11c6d | |||
| a653f3cbf4 | |||
| 03259259d0 | |||
| 1d3e514fa5 | |||
| 4810f8cf42 | |||
| f5ed12df6d | |||
| 8cb874795e | |||
| 7a78063948 | |||
| 66f69dddf2 | |||
| c43410bbd7 | |||
| 8924da734b | |||
| ebc7928c6b | |||
| c84075de88 | |||
| 1b4672e47e | |||
| 854e792f63 | |||
| 390ed5cd15 | |||
| f67aa06fd4 | |||
| 252d8f6c75 | |||
| ba3de73c19 | |||
| 8c47b4ed66 | |||
| af9d9d9148 | |||
| a8e1f42a2d | |||
| e6d439ae8e | |||
| b74ccba2e5 | |||
| 93fcf1f81c | |||
| f9458d8d84 | |||
| 98fbdb4a05 | |||
| 504cdaab25 | |||
| 092c0e60b9 | |||
| e8394312ad | |||
| d720dfb7b9 | |||
| 1bdd5e02f8 | |||
| 02d3e54c61 | |||
| 1616aa290b | |||
| 0ea946e6b6 | |||
| 0461ba3bf6 | |||
| 2996713e0c | |||
| 39c0fee01f | |||
| 0eb1094322 | |||
| e624ead041 | |||
| 613d93330f | |||
| 7ecd24f37f | |||
| 556638d9a3 | |||
| e1567e3a9e | |||
| 68eaf1647f | |||
| ed7648c80c | |||
| ebebe21ddf | |||
| 87ce453b5f | |||
| 71452dd1e6 | |||
| a61d8f2901 | |||
| df6f549101 | |||
| 872619f601 | |||
| 567a3ee1c3 | |||
| 4395178912 | |||
| 0c744cd01e | |||
| 849349795d | |||
| ccc31c6065 | |||
| 8c20503ce5 | |||
| 1734b7b4cd | |||
| 9cfb76eea2 | |||
| 86139a6eab | |||
| 067dbfb06b | |||
| 21b57a166e | |||
| 2086a35dce | |||
| 5dbfd6ea2a | |||
| 5290bf2589 | |||
| 179c9a4f96 | |||
| cd3cf54427 | |||
| 72784878c5 | |||
| acac967773 | |||
| 90d3b1dda0 | |||
| 550298e9cf | |||
| 5abb3f29bc | |||
| 75fd043c01 | |||
| 3b926d9f2e | |||
| 3fb911290f | |||
| f87a476691 | |||
| 4a391ce61a | |||
| be383b67f2 | |||
| e4deee25ef | |||
| 290f470ef0 | |||
| 38ace79bce | |||
| 17f10c94b3 | |||
| 8ba5f74174 | |||
| 33faf80a1b | |||
| e9bfc3c27f | |||
| f1f16e0ab8 | |||
| 840c3d713c | |||
| 43ba7819c9 | |||
| 6bf602057b | |||
| 42abbbe4eb | |||
| 99eae0a73e | |||
| 42461cdd81 | |||
| ab6c6bc0d7 | |||
| 020567b5c2 | |||
| 1ccb656964 | |||
| 699c121181 | |||
| 4035dff056 | |||
| 9d1a2796a4 | |||
| da198d31f5 | |||
| fab79bdcfa | |||
| d298a9564a | |||
| fe5de659be | |||
| 40de68cee6 | |||
| 93b5d7e6e4 | |||
| 1fbf51225e | |||
| 40f1f3b350 | |||
| 8b354b0c80 | |||
| d52a4936b9 | |||
| 00b8ba6f10 | |||
| c53cd917c7 | |||
| f50346c201 | |||
| 467c1d1017 | |||
| f847739643 | |||
| 827f81dbd1 | |||
| 304cfdeb9d | |||
| ad261f30ab | |||
| f23f271463 | |||
| 396d1893e2 | |||
| 6c2f66e96d | |||
| 7a57ab281c | |||
| 98c512096e | |||
| f4624a4391 | |||
| 6ffd8540af | |||
| a657a7c16b | |||
| 7ae35d8778 | |||
| bea2c7b022 | |||
| cdf7d1f354 | |||
| 60c22d5e72 | |||
| d21fbced20 | |||
| 8a1d6cc4f8 | |||
| 6c3b6e4c40 | |||
| a51afb8a3d | |||
| 059bb2ef52 | |||
| 39347b5710 | |||
| 6a58748058 | |||
| 098eb7e6e9 | |||
| 6a4f9800d5 | |||
| a503d36b1e | |||
| 069a298e16 | |||
| 427f4c97ec | |||
| 201021b38c | |||
| 3ad4dfa365 | |||
| 3980e9bd31 | |||
| 029f2a8a18 | |||
| cb1a9a491c | |||
| e25cbd4ebb | |||
| 22f4621720 | |||
| 98c5108417 | |||
| 6ecc24538a | |||
| b5d3794538 | |||
| ee08e5ccae | |||
| 7939ec5755 | |||
| e7865dc660 | |||
| 0bb1e1a024 | |||
| 5ebb017c0b | |||
| 549ea25316 | |||
| 543dadc0e7 | |||
| 4d30853f4c | |||
| ade8a1132b | |||
| f13d5fec14 | |||
| 5ca0d7b88b | |||
| 213fd4217a | |||
| cafac39c4d | |||
| c8a4852df2 | |||
| 688a746b71 | |||
| d15d505e68 | |||
| 7503bd3c0b | |||
| c61e9c4734 | |||
| 2b06f8aa6f | |||
| b8f4a9b022 | |||
| 7c3d33629e | |||
| fdf40ecdb4 | |||
| 995691a72a | |||
| 8effeef082 | |||
| f6944642bc | |||
| 56644e98fb | |||
| 1aa532a32a | |||
| e7936073bc | |||
| 9f8280479d | |||
| f8644087ac | |||
| 281916763c | |||
| be6bacbb36 | |||
| 1fe7630b89 | |||
| bf1baeef01 | |||
| c2cb901c92 | |||
| e795e9a99a | |||
| be7d096ded | |||
| fdde526b59 | |||
| ebc7369a2c | |||
| bb1ee2e21e | |||
| affdaa70e0 | |||
| 229e50b0f9 | |||
| 887a521051 | |||
| c91928f3c6 | |||
| 4cde40be71 | |||
| f035497bb6 | |||
| 8d2391ca38 | |||
| 4175992659 | |||
| af0d60a7bf | |||
| 40ea2cc606 | |||
| 8ddc656248 | |||
| ec244f6770 | |||
| 08b7262bb3 | |||
| 5a32473989 | |||
| fc78d9b15a | |||
| 7e292ba409 | |||
| 660d82c011 | |||
| 9575d8958d | |||
| 1a4e9db35c | |||
| df5bdc26de | |||
| 1a686cc468 | |||
| 911e448f37 | |||
| 300ab11be0 | |||
| 6347ce8a21 | |||
| be9bb06910 | |||
| f947e688f5 | |||
| ac5fc73ecf | |||
| 8b18c6a4e2 | |||
| 0821e5360d | |||
| 8201023680 | |||
| 4e5fea2d06 | |||
| e05062ed43 | |||
| 0747991607 | |||
| 4230b101c7 | |||
| de18e50036 | |||
| 302358fbdd |
3
.gitignore
vendored
3
.gitignore
vendored
@ -92,3 +92,6 @@ GTAGS
|
||||
*.orig
|
||||
*~
|
||||
\#*#
|
||||
|
||||
/oe-*
|
||||
bitbake-cookerdaemon.log
|
||||
|
||||
30
CONTRIBUTING.md
Normal file
30
CONTRIBUTING.md
Normal file
@ -0,0 +1,30 @@
|
||||
# Contributing guide
|
||||
|
||||
This document serves as a checklist before contributing to this repository. It includes links to read up on if topics are unclear to you.
|
||||
|
||||
This guide mainly focuses on the proper use of Git.
|
||||
|
||||
## 1. Issues
|
||||
|
||||
STM32MPU projects do not activate "Github issues" feature for the time being. If you need to report an issue or question about this project deliverables, you can report them using [ ST Support Center ](https://my.st.com/ols#/ols/newrequest) or [ ST Community MPU Forum ](https://community.st.com/s/topic/0TO0X0000003u2AWAQ/stm32-mpus).
|
||||
|
||||
## 2. Pull Requests
|
||||
|
||||
STMicrolectronics is happy to receive contributions from the community, based on an initial Contributor License Agreement (CLA) procedure.
|
||||
|
||||
* If you are an individual writing original source code and you are sure **you own the intellectual property**, then you need to sign an Individual CLA (https://cla.st.com).
|
||||
* If you work for a company that wants also to allow you to contribute with your work, your company needs to provide a Corporate CLA (https://cla.st.com) mentioning your GitHub account name.
|
||||
* If you are not sure that a CLA (Individual or Corporate) has been signed for your GitHub account you can check here (https://cla.st.com).
|
||||
|
||||
Please note that:
|
||||
* The Corporate CLA will always take precedence over the Individual CLA.
|
||||
* One CLA submission is sufficient, for any project proposed by STMicroelectronics.
|
||||
|
||||
__How to proceed__
|
||||
|
||||
* We recommend to fork the project in your GitHub account to further develop your contribution. Please use the latest commit version.
|
||||
* Please, submit one Pull Request for one new feature or proposal. This will ease the analysis and final merge if accepted.
|
||||
|
||||
__Note__
|
||||
|
||||
Merge will not be done directly in GitHub but it will need first to follow internal integration process before public deliver in a standard release. The Pull request will stay open until it is merged and delivered.
|
||||
@ -337,6 +337,7 @@ L: uboot-stm32@st-md-mailman.stormreply.com (moderated for non-subscribers)
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-stm.git
|
||||
S: Maintained
|
||||
F: arch/arm/mach-stm32mp/
|
||||
F: doc/board/st/
|
||||
F: drivers/adc/stm32-adc*
|
||||
F: drivers/clk/clk_stm32mp1.c
|
||||
F: drivers/gpio/stm32_gpio.c
|
||||
|
||||
2
Makefile
2
Makefile
@ -3,7 +3,7 @@
|
||||
VERSION = 2020
|
||||
PATCHLEVEL = 01
|
||||
SUBLEVEL =
|
||||
EXTRAVERSION =
|
||||
EXTRAVERSION = -stm32mp-r1
|
||||
NAME =
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
||||
@ -823,12 +823,21 @@ dtb-$(CONFIG_ARCH_ASPEED) += ast2500-evb.dtb
|
||||
|
||||
dtb-$(CONFIG_ARCH_STI) += stih410-b2260.dtb
|
||||
|
||||
dtb-$(CONFIG_TARGET_STM32MP1) += \
|
||||
stm32mp157a-dk1.dtb \
|
||||
dtb-$(CONFIG_STM32MP15x) += \
|
||||
stm32mp157a-avenger96.dtb \
|
||||
stm32mp157a-dk1.dtb \
|
||||
stm32mp157a-ed1.dtb \
|
||||
stm32mp157a-ev1.dtb \
|
||||
stm32mp157c-dk2.dtb \
|
||||
stm32mp157c-ed1.dtb \
|
||||
stm32mp157c-ev1.dtb
|
||||
stm32mp157c-ev1.dtb \
|
||||
stm32mp157d-dk1.dtb \
|
||||
stm32mp157d-ed1.dtb \
|
||||
stm32mp157d-ev1.dtb \
|
||||
stm32mp157f-dk2.dtb \
|
||||
stm32mp157f-ed1.dtb \
|
||||
stm32mp157f-ev1.dtb \
|
||||
stm32mp15xx-dhcom-pdk2.dtb
|
||||
|
||||
dtb-$(CONFIG_SOC_K3_AM6) += k3-am654-base-board.dtb k3-am654-r5-base-board.dtb
|
||||
dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
/ {
|
||||
soc {
|
||||
ddr: ddr@5A003000 {
|
||||
ddr: ddr@5a003000 {
|
||||
u-boot,dm-pre-reloc;
|
||||
|
||||
compatible = "st,stm32mp1-ddr";
|
||||
@ -31,6 +31,7 @@
|
||||
st,mem-speed = <DDR_MEM_SPEED>;
|
||||
st,mem-size = <DDR_MEM_SIZE>;
|
||||
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
st,ctl-reg = <
|
||||
DDR_MSTR
|
||||
DDR_MRCTRL0
|
||||
@ -133,6 +134,7 @@
|
||||
DDR_MR3
|
||||
>;
|
||||
|
||||
#ifdef DDR_PHY_CAL_SKIP
|
||||
st,phy-cal = <
|
||||
DDR_DX0DLLCR
|
||||
DDR_DX0DQTR
|
||||
@ -147,6 +149,9 @@
|
||||
DDR_DX3DQTR
|
||||
DDR_DX3DQSTR
|
||||
>;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -1,22 +1,21 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
* STM32MP157C DK1/DK2 BOARD configuration
|
||||
* 1x DDR3L 4Gb, 16-bit, 533MHz.
|
||||
* Reference used NT5CC256M16DP-DI from NANYA
|
||||
*
|
||||
* DDR type / Platform DDR3/3L
|
||||
* freq 533MHz
|
||||
* width 16
|
||||
* datasheet 0 = MT41J256M16-187 / DDR3-1066 bin G
|
||||
* DDR density 4
|
||||
* timing mode optimized
|
||||
* Scheduling/QoS options : type = 2
|
||||
* address mapping : RBC
|
||||
* Tc > + 85C : N
|
||||
*/
|
||||
#define DDR_MEM_NAME "DDR3-1066/888 bin G 1x4Gb 533MHz v1.45"
|
||||
|
||||
/*
|
||||
* File generated by STMicroelectronics STM32CubeMX DDR Tool for MPUs
|
||||
* DDR type: DDR3 / DDR3L
|
||||
* DDR width: 16bits
|
||||
* DDR density: 4Gb
|
||||
* System frequency: 533000Khz
|
||||
* Relaxed Timing Mode: false
|
||||
* Address mapping type: RBC
|
||||
*
|
||||
* Save Date: 2020.02.20, save Time: 18:45:20
|
||||
*/
|
||||
|
||||
#define DDR_MEM_NAME "DDR3-DDR3L 16bits 533000Khz"
|
||||
#define DDR_MEM_SPEED 533000
|
||||
#define DDR_MEM_SIZE 0x20000000
|
||||
|
||||
@ -50,15 +49,6 @@
|
||||
#define DDR_DFIUPD1 0x00000000
|
||||
#define DDR_DFIUPD2 0x00000000
|
||||
#define DDR_DFIPHYMSTR 0x00000000
|
||||
#define DDR_ADDRMAP1 0x00070707
|
||||
#define DDR_ADDRMAP2 0x00000000
|
||||
#define DDR_ADDRMAP3 0x1F000000
|
||||
#define DDR_ADDRMAP4 0x00001F1F
|
||||
#define DDR_ADDRMAP5 0x06060606
|
||||
#define DDR_ADDRMAP6 0x0F060606
|
||||
#define DDR_ADDRMAP9 0x00000000
|
||||
#define DDR_ADDRMAP10 0x00000000
|
||||
#define DDR_ADDRMAP11 0x00000000
|
||||
#define DDR_ODTCFG 0x06000600
|
||||
#define DDR_ODTMAP 0x00000001
|
||||
#define DDR_SCHED 0x00000C01
|
||||
@ -83,6 +73,15 @@
|
||||
#define DDR_PCFGQOS1_1 0x00800040
|
||||
#define DDR_PCFGWQOS0_1 0x01100C03
|
||||
#define DDR_PCFGWQOS1_1 0x01000200
|
||||
#define DDR_ADDRMAP1 0x00070707
|
||||
#define DDR_ADDRMAP2 0x00000000
|
||||
#define DDR_ADDRMAP3 0x1F000000
|
||||
#define DDR_ADDRMAP4 0x00001F1F
|
||||
#define DDR_ADDRMAP5 0x06060606
|
||||
#define DDR_ADDRMAP6 0x0F060606
|
||||
#define DDR_ADDRMAP9 0x00000000
|
||||
#define DDR_ADDRMAP10 0x00000000
|
||||
#define DDR_ADDRMAP11 0x00000000
|
||||
#define DDR_PGCR 0x01442E02
|
||||
#define DDR_PTR0 0x0022AA5B
|
||||
#define DDR_PTR1 0x04841104
|
||||
|
||||
@ -1,22 +1,21 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
* STM32MP157C ED1 BOARD configuration
|
||||
* 2x DDR3L 4Gb each, 16-bit, 533MHz, Single Die Package in flyby topology.
|
||||
* Reference used NT5CC256M16DP-DI from NANYA
|
||||
*
|
||||
* DDR type / Platform DDR3/3L
|
||||
* freq 533MHz
|
||||
* width 32
|
||||
* datasheet 0 = MT41J256M16-187 / DDR3-1066 bin G
|
||||
* DDR density 8
|
||||
* timing mode optimized
|
||||
* Scheduling/QoS options : type = 2
|
||||
* address mapping : RBC
|
||||
* Tc > + 85C : N
|
||||
*/
|
||||
#define DDR_MEM_NAME "DDR3-1066/888 bin G 2x4Gb 533MHz v1.45"
|
||||
|
||||
/*
|
||||
* File generated by STMicroelectronics STM32CubeMX DDR Tool for MPUs
|
||||
* DDR type: DDR3 / DDR3L
|
||||
* DDR width: 32bits
|
||||
* DDR density: 8Gb
|
||||
* System frequency: 533000Khz
|
||||
* Relaxed Timing Mode: false
|
||||
* Address mapping type: RBC
|
||||
*
|
||||
* Save Date: 2020.02.20, save Time: 18:49:33
|
||||
*/
|
||||
|
||||
#define DDR_MEM_NAME "DDR3-DDR3L 32bits 533000Khz"
|
||||
#define DDR_MEM_SPEED 533000
|
||||
#define DDR_MEM_SIZE 0x40000000
|
||||
|
||||
@ -50,15 +49,6 @@
|
||||
#define DDR_DFIUPD1 0x00000000
|
||||
#define DDR_DFIUPD2 0x00000000
|
||||
#define DDR_DFIPHYMSTR 0x00000000
|
||||
#define DDR_ADDRMAP1 0x00080808
|
||||
#define DDR_ADDRMAP2 0x00000000
|
||||
#define DDR_ADDRMAP3 0x00000000
|
||||
#define DDR_ADDRMAP4 0x00001F1F
|
||||
#define DDR_ADDRMAP5 0x07070707
|
||||
#define DDR_ADDRMAP6 0x0F070707
|
||||
#define DDR_ADDRMAP9 0x00000000
|
||||
#define DDR_ADDRMAP10 0x00000000
|
||||
#define DDR_ADDRMAP11 0x00000000
|
||||
#define DDR_ODTCFG 0x06000600
|
||||
#define DDR_ODTMAP 0x00000001
|
||||
#define DDR_SCHED 0x00000C01
|
||||
@ -83,6 +73,15 @@
|
||||
#define DDR_PCFGQOS1_1 0x00800040
|
||||
#define DDR_PCFGWQOS0_1 0x01100C03
|
||||
#define DDR_PCFGWQOS1_1 0x01000200
|
||||
#define DDR_ADDRMAP1 0x00080808
|
||||
#define DDR_ADDRMAP2 0x00000000
|
||||
#define DDR_ADDRMAP3 0x00000000
|
||||
#define DDR_ADDRMAP4 0x00001F1F
|
||||
#define DDR_ADDRMAP5 0x07070707
|
||||
#define DDR_ADDRMAP6 0x0F070707
|
||||
#define DDR_ADDRMAP9 0x00000000
|
||||
#define DDR_ADDRMAP10 0x00000000
|
||||
#define DDR_ADDRMAP11 0x00000000
|
||||
#define DDR_PGCR 0x01442E02
|
||||
#define DDR_PTR0 0x0022AA5B
|
||||
#define DDR_PTR1 0x04841104
|
||||
|
||||
157
arch/arm/dts/stm32mp15-no-scmi.dtsi
Normal file
157
arch/arm/dts/stm32mp15-no-scmi.dtsi
Normal file
@ -0,0 +1,157 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2020 - All Rights Reserved
|
||||
* Author: Gabriel Fernandez <gabriel.fernandez@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
/ {
|
||||
|
||||
clocks {
|
||||
clk_hse: clk-hse {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <24000000>;
|
||||
};
|
||||
|
||||
clk_hsi: clk-hsi {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <64000000>;
|
||||
};
|
||||
|
||||
clk_lse: clk-lse {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
|
||||
clk_lsi: clk-lsi {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <32000>;
|
||||
};
|
||||
|
||||
clk_csi: clk-csi {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <4000000>;
|
||||
};
|
||||
};
|
||||
|
||||
cpus {
|
||||
cpu0: cpu@0 {
|
||||
clocks = <&rcc CK_MPU>;
|
||||
};
|
||||
|
||||
cpu1: cpu@1 {
|
||||
clocks = <&rcc CK_MPU>;
|
||||
};
|
||||
};
|
||||
|
||||
soc {
|
||||
m_can1: can@4400e000 {
|
||||
clocks = <&rcc CK_HSE>, <&rcc FDCAN_K>;
|
||||
};
|
||||
|
||||
m_can2: can@4400f000 {
|
||||
clocks = <&rcc CK_HSE>, <&rcc FDCAN_K>;
|
||||
};
|
||||
|
||||
cryp1: cryp@54001000 {
|
||||
clocks = <&rcc CRYP1>;
|
||||
resets = <&rcc CRYP1_R>;
|
||||
};
|
||||
};
|
||||
|
||||
mlahb {
|
||||
m4_rproc: m4@10000000 {
|
||||
resets = <&rcc MCU_R>;
|
||||
|
||||
m4_system_resources {
|
||||
m4_cec: cec@40016000 {
|
||||
clocks = <&rcc CEC_K>, <&rcc CK_LSE>;
|
||||
};
|
||||
|
||||
m4_m_can1: can@4400e000 {
|
||||
clocks = <&rcc CK_HSE>, <&rcc FDCAN_K>;
|
||||
};
|
||||
|
||||
m4_m_can2: can@4400f000 {
|
||||
clocks = <&rcc CK_HSE>, <&rcc FDCAN_K>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
firmware {
|
||||
/delete-node/ scmi-0;
|
||||
/delete-node/ scmi-1;
|
||||
};
|
||||
/delete-node/ sram@2ffff000;
|
||||
/delete-node/ mailbox-0;
|
||||
/delete-node/ mailbox-1;
|
||||
};
|
||||
|
||||
&cec {
|
||||
clocks = <&rcc CEC_K>, <&clk_lse>;
|
||||
};
|
||||
|
||||
&ddrperfm {
|
||||
clocks = <&rcc DDRPERFM>, <&rcc PLL2_R>;
|
||||
};
|
||||
|
||||
&dsi {
|
||||
clocks = <&rcc DSI_K>, <&clk_hse>, <&rcc DSI_PX>;
|
||||
};
|
||||
|
||||
&gpioz {
|
||||
clocks = <&rcc GPIOZ>;
|
||||
};
|
||||
|
||||
&hash1 {
|
||||
clocks = <&rcc HASH1>;
|
||||
resets = <&rcc HASH1_R>;
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
clocks = <&rcc I2C4_K>;
|
||||
resets = <&rcc I2C4_R>;
|
||||
};
|
||||
|
||||
&i2c6 {
|
||||
clocks = <&rcc I2C6_K>;
|
||||
resets = <&rcc I2C6_R>;
|
||||
};
|
||||
|
||||
&iwdg2 {
|
||||
clocks = <&rcc IWDG2>, <&rcc CK_LSI>;
|
||||
};
|
||||
|
||||
&mdma1 {
|
||||
clocks = <&rcc MDMA>;
|
||||
resets = <&rcc MDMA_R>;
|
||||
};
|
||||
|
||||
&rcc {
|
||||
compatible = "st,stm32mp1-rcc", "syscon";
|
||||
clocks = <&clk_hse>, <&clk_hsi>, <&clk_csi>, <&clk_lse>, <&clk_lsi>;
|
||||
};
|
||||
|
||||
&rng1 {
|
||||
clocks = <&rcc RNG1_K>;
|
||||
resets = <&rcc RNG1_R>;
|
||||
};
|
||||
|
||||
&rtc {
|
||||
clocks = <&rcc RTCAPB>, <&rcc RTC>;
|
||||
};
|
||||
|
||||
&spi6 {
|
||||
clocks = <&rcc SPI6_K>;
|
||||
resets = <&rcc SPI6_R>;
|
||||
};
|
||||
|
||||
&usart1 {
|
||||
clocks = <&rcc USART1_K>;
|
||||
resets = <&rcc USART1_R>;
|
||||
};
|
||||
1426
arch/arm/dts/stm32mp15-pinctrl.dtsi
Normal file
1426
arch/arm/dts/stm32mp15-pinctrl.dtsi
Normal file
File diff suppressed because it is too large
Load Diff
@ -21,45 +21,17 @@
|
||||
pinctrl1 = &pinctrl_z;
|
||||
};
|
||||
|
||||
clocks {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* need PSCI for sysreset during board_f */
|
||||
psci {
|
||||
u-boot,dm-pre-proper;
|
||||
};
|
||||
|
||||
reboot {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
soc {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
&bsec {
|
||||
u-boot,dm-pre-proper;
|
||||
};
|
||||
|
||||
&clk_csi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_hsi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_hse {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_lsi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_lse {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
@ -128,14 +100,58 @@
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&pwr {
|
||||
&pwr_regulators {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&rcc {
|
||||
u-boot,dm-pre-reloc;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_STM32MP1_TRUSTED
|
||||
&scmi0 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&scmi0_clk {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&scmi0_mbox {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&scmi0_reset {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&scmi0_shm {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&scmi1 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&scmi1_clk {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&scmi1_mbox {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&scmi1_shm {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&scmi_sram {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
#endif
|
||||
|
||||
&sdmmc1 {
|
||||
compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell";
|
||||
};
|
||||
@ -148,6 +164,68 @@
|
||||
compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell";
|
||||
};
|
||||
|
||||
&usbotg_hs {
|
||||
compatible = "st,stm32mp1-hsotg", "snps,dwc2";
|
||||
/* NO MORE USE SCMI SUPPORT for BASIC boot chain */
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
|
||||
#include "stm32mp15-no-scmi.dtsi"
|
||||
|
||||
/ {
|
||||
clocks {
|
||||
u-boot,dm-pre-reloc;
|
||||
|
||||
clk_hse: clk-hse {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
clk_hsi: clk-hsi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
clk_lse: clk-lse {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
clk_lsi: clk-lsi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
clk_csi: clk-csi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
reboot {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
&clk_hse {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_hsi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_lse {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_lsi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&clk_csi {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&cpu0_opp_table {
|
||||
u-boot,dm-spl;
|
||||
opp-650000000 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
opp-800000000 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
#endif /* CONFIG_STM32MP1_TRUSTED */
|
||||
File diff suppressed because it is too large
Load Diff
54
arch/arm/dts/stm32mp153.dtsi
Normal file
54
arch/arm/dts/stm32mp153.dtsi
Normal file
@ -0,0 +1,54 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
#include "stm32mp151.dtsi"
|
||||
|
||||
/ {
|
||||
cpus {
|
||||
cpu1: cpu@1 {
|
||||
compatible = "arm,cortex-a7";
|
||||
device_type = "cpu";
|
||||
reg = <1>;
|
||||
clocks = <&scmi0_clk CK_SCMI0_MPU>;
|
||||
clock-names = "cpu";
|
||||
operating-points-v2 = <&cpu0_opp_table>;
|
||||
};
|
||||
};
|
||||
|
||||
arm-pmu {
|
||||
interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-affinity = <&cpu0>, <&cpu1>;
|
||||
};
|
||||
|
||||
soc {
|
||||
m_can1: can@4400e000 {
|
||||
compatible = "bosch,m_can";
|
||||
reg = <0x4400e000 0x400>, <0x44011000 0x1400>;
|
||||
reg-names = "m_can", "message_ram";
|
||||
interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "int0", "int1";
|
||||
clocks = <&scmi0_clk CK_SCMI0_HSE>, <&rcc FDCAN_K>;
|
||||
clock-names = "hclk", "cclk";
|
||||
bosch,mram-cfg = <0x0 0 0 32 0 0 2 2>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
m_can2: can@4400f000 {
|
||||
compatible = "bosch,m_can";
|
||||
reg = <0x4400f000 0x400>, <0x44011000 0x2800>;
|
||||
reg-names = "m_can", "message_ram";
|
||||
interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "int0", "int1";
|
||||
clocks = <&scmi0_clk CK_SCMI0_HSE>, <&rcc FDCAN_K>;
|
||||
clock-names = "hclk", "cclk";
|
||||
bosch,mram-cfg = <0x1400 0 0 32 0 0 2 2>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
524
arch/arm/dts/stm32mp157-m4-srm-pinctrl.dtsi
Normal file
524
arch/arm/dts/stm32mp157-m4-srm-pinctrl.dtsi
Normal file
@ -0,0 +1,524 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Fabien Dessenne <fabien.dessenne@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
m4_adc1_in6_pins_a: m4-adc1-in6 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 12, RSVD)>;
|
||||
};
|
||||
};
|
||||
|
||||
m4_adc12_ain_pins_a: m4-adc12-ain-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('C', 3, RSVD)>, /* ADC1 in13 */
|
||||
<STM32_PINMUX('F', 12, RSVD)>, /* ADC1 in6 */
|
||||
<STM32_PINMUX('F', 13, RSVD)>, /* ADC2 in2 */
|
||||
<STM32_PINMUX('F', 14, RSVD)>; /* ADC2 in6 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_adc12_usb_pwr_pins_a: m4-adc12-usb-pwr-pins-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 4, RSVD)>, /* ADC12 in18 */
|
||||
<STM32_PINMUX('A', 5, RSVD)>; /* ADC12 in19 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_cec_pins_a: m4-cec-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 15, RSVD)>;
|
||||
};
|
||||
};
|
||||
|
||||
m4_cec_pins_b: m4-cec-1 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 6, RSVD)>;
|
||||
};
|
||||
};
|
||||
|
||||
m4_dac_ch1_pins_a: m4-dac-ch1 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 4, RSVD)>;
|
||||
};
|
||||
};
|
||||
|
||||
m4_dac_ch2_pins_a: m4-dac-ch2 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 5, RSVD)>;
|
||||
};
|
||||
};
|
||||
|
||||
m4_dcmi_pins_a: m4-dcmi-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('H', 8, RSVD)>,/* DCMI_HSYNC */
|
||||
<STM32_PINMUX('B', 7, RSVD)>,/* DCMI_VSYNC */
|
||||
<STM32_PINMUX('A', 6, RSVD)>,/* DCMI_PIXCLK */
|
||||
<STM32_PINMUX('H', 9, RSVD)>,/* DCMI_D0 */
|
||||
<STM32_PINMUX('H', 10, RSVD)>,/* DCMI_D1 */
|
||||
<STM32_PINMUX('H', 11, RSVD)>,/* DCMI_D2 */
|
||||
<STM32_PINMUX('H', 12, RSVD)>,/* DCMI_D3 */
|
||||
<STM32_PINMUX('H', 14, RSVD)>,/* DCMI_D4 */
|
||||
<STM32_PINMUX('I', 4, RSVD)>,/* DCMI_D5 */
|
||||
<STM32_PINMUX('B', 8, RSVD)>,/* DCMI_D6 */
|
||||
<STM32_PINMUX('E', 6, RSVD)>,/* DCMI_D7 */
|
||||
<STM32_PINMUX('I', 1, RSVD)>,/* DCMI_D8 */
|
||||
<STM32_PINMUX('H', 7, RSVD)>,/* DCMI_D9 */
|
||||
<STM32_PINMUX('I', 3, RSVD)>,/* DCMI_D10 */
|
||||
<STM32_PINMUX('H', 15, RSVD)>;/* DCMI_D11 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_dfsdm_clkout_pins_a: m4-dfsdm-clkout-pins-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 13, RSVD)>; /* DFSDM_CKOUT */
|
||||
};
|
||||
};
|
||||
|
||||
m4_dfsdm_data1_pins_a: m4-dfsdm-data1-pins-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('C', 3, RSVD)>; /* DFSDM_DATA1 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_dfsdm_data3_pins_a: m4-dfsdm-data3-pins-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 13, RSVD)>; /* DFSDM_DATA3 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_ethernet0_rgmii_pins_a: m4-rgmii-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('G', 5, RSVD)>, /* ETH_RGMII_CLK125 */
|
||||
<STM32_PINMUX('G', 4, RSVD)>, /* ETH_RGMII_GTX_CLK */
|
||||
<STM32_PINMUX('G', 13, RSVD)>, /* ETH_RGMII_TXD0 */
|
||||
<STM32_PINMUX('G', 14, RSVD)>, /* ETH_RGMII_TXD1 */
|
||||
<STM32_PINMUX('C', 2, RSVD)>, /* ETH_RGMII_TXD2 */
|
||||
<STM32_PINMUX('E', 2, RSVD)>, /* ETH_RGMII_TXD3 */
|
||||
<STM32_PINMUX('B', 11, RSVD)>, /* ETH_RGMII_TX_CTL */
|
||||
<STM32_PINMUX('C', 1, RSVD)>, /* ETH_MDC */
|
||||
<STM32_PINMUX('A', 2, RSVD)>, /* ETH_MDIO */
|
||||
<STM32_PINMUX('C', 4, RSVD)>, /* ETH_RGMII_RXD0 */
|
||||
<STM32_PINMUX('C', 5, RSVD)>, /* ETH_RGMII_RXD1 */
|
||||
<STM32_PINMUX('B', 0, RSVD)>, /* ETH_RGMII_RXD2 */
|
||||
<STM32_PINMUX('B', 1, RSVD)>, /* ETH_RGMII_RXD3 */
|
||||
<STM32_PINMUX('A', 1, RSVD)>, /* ETH_RGMII_RX_CLK */
|
||||
<STM32_PINMUX('A', 7, RSVD)>; /* ETH_RGMII_RX_CTL */
|
||||
};
|
||||
};
|
||||
|
||||
m4_fmc_pins_a: m4-fmc-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('D', 4, RSVD)>, /* FMC_NOE */
|
||||
<STM32_PINMUX('D', 5, RSVD)>, /* FMC_NWE */
|
||||
<STM32_PINMUX('D', 11, RSVD)>, /* FMC_A16_FMC_CLE */
|
||||
<STM32_PINMUX('D', 12, RSVD)>, /* FMC_A17_FMC_ALE */
|
||||
<STM32_PINMUX('D', 14, RSVD)>, /* FMC_D0 */
|
||||
<STM32_PINMUX('D', 15, RSVD)>, /* FMC_D1 */
|
||||
<STM32_PINMUX('D', 0, RSVD)>, /* FMC_D2 */
|
||||
<STM32_PINMUX('D', 1, RSVD)>, /* FMC_D3 */
|
||||
<STM32_PINMUX('E', 7, RSVD)>, /* FMC_D4 */
|
||||
<STM32_PINMUX('E', 8, RSVD)>, /* FMC_D5 */
|
||||
<STM32_PINMUX('E', 9, RSVD)>, /* FMC_D6 */
|
||||
<STM32_PINMUX('E', 10, RSVD)>, /* FMC_D7 */
|
||||
<STM32_PINMUX('G', 9, RSVD)>, /* FMC_NE2_FMC_NCE */
|
||||
<STM32_PINMUX('D', 6, RSVD)>; /* FMC_NWAIT */
|
||||
};
|
||||
};
|
||||
|
||||
m4_hdp0_pins_a: m4-hdp0-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 12, RSVD)>; /* HDP0 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_hdp6_pins_a: m4-hdp6-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('K', 5, RSVD)>; /* HDP6 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_hdp7_pins_a: m4-hdp7-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('K', 6, RSVD)>; /* HDP7 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_i2c1_pins_a: m4-i2c1-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('D', 12, RSVD)>, /* I2C1_SCL */
|
||||
<STM32_PINMUX('F', 15, RSVD)>; /* I2C1_SDA */
|
||||
};
|
||||
};
|
||||
|
||||
m4_i2c2_pins_a: m4-i2c2-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('H', 4, RSVD)>, /* I2C2_SCL */
|
||||
<STM32_PINMUX('H', 5, RSVD)>; /* I2C2_SDA */
|
||||
};
|
||||
};
|
||||
|
||||
m4_i2c5_pins_a: m4-i2c5-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 11, RSVD)>, /* I2C5_SCL */
|
||||
<STM32_PINMUX('A', 12, RSVD)>; /* I2C5_SDA */
|
||||
};
|
||||
};
|
||||
|
||||
m4_i2s2_pins_a: m4-i2s2-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 3, RSVD)>, /* I2S2_SDO */
|
||||
<STM32_PINMUX('B', 9, RSVD)>, /* I2S2_WS */
|
||||
<STM32_PINMUX('A', 9, RSVD)>; /* I2S2_CK */
|
||||
};
|
||||
};
|
||||
|
||||
m4_ltdc_pins_a: m4-ltdc-a-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('G', 7, RSVD)>, /* LCD_CLK */
|
||||
<STM32_PINMUX('I', 10, RSVD)>, /* LCD_HSYNC */
|
||||
<STM32_PINMUX('I', 9, RSVD)>, /* LCD_VSYNC */
|
||||
<STM32_PINMUX('F', 10, RSVD)>, /* LCD_DE */
|
||||
<STM32_PINMUX('H', 2, RSVD)>, /* LCD_R0 */
|
||||
<STM32_PINMUX('H', 3, RSVD)>, /* LCD_R1 */
|
||||
<STM32_PINMUX('H', 8, RSVD)>, /* LCD_R2 */
|
||||
<STM32_PINMUX('H', 9, RSVD)>, /* LCD_R3 */
|
||||
<STM32_PINMUX('H', 10, RSVD)>, /* LCD_R4 */
|
||||
<STM32_PINMUX('C', 0, RSVD)>, /* LCD_R5 */
|
||||
<STM32_PINMUX('H', 12, RSVD)>, /* LCD_R6 */
|
||||
<STM32_PINMUX('E', 15, RSVD)>, /* LCD_R7 */
|
||||
<STM32_PINMUX('E', 5, RSVD)>, /* LCD_G0 */
|
||||
<STM32_PINMUX('E', 6, RSVD)>, /* LCD_G1 */
|
||||
<STM32_PINMUX('H', 13, RSVD)>, /* LCD_G2 */
|
||||
<STM32_PINMUX('H', 14, RSVD)>, /* LCD_G3 */
|
||||
<STM32_PINMUX('H', 15, RSVD)>, /* LCD_G4 */
|
||||
<STM32_PINMUX('I', 0, RSVD)>, /* LCD_G5 */
|
||||
<STM32_PINMUX('I', 1, RSVD)>, /* LCD_G6 */
|
||||
<STM32_PINMUX('I', 2, RSVD)>, /* LCD_G7 */
|
||||
<STM32_PINMUX('D', 9, RSVD)>, /* LCD_B0 */
|
||||
<STM32_PINMUX('G', 12, RSVD)>, /* LCD_B1 */
|
||||
<STM32_PINMUX('G', 10, RSVD)>, /* LCD_B2 */
|
||||
<STM32_PINMUX('D', 10, RSVD)>, /* LCD_B3 */
|
||||
<STM32_PINMUX('I', 4, RSVD)>, /* LCD_B4 */
|
||||
<STM32_PINMUX('A', 3, RSVD)>, /* LCD_B5 */
|
||||
<STM32_PINMUX('B', 8, RSVD)>, /* LCD_B6 */
|
||||
<STM32_PINMUX('D', 8, RSVD)>; /* LCD_B7 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_ltdc_pins_b: m4-ltdc-b-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 14, RSVD)>, /* LCD_CLK */
|
||||
<STM32_PINMUX('I', 12, RSVD)>, /* LCD_HSYNC */
|
||||
<STM32_PINMUX('I', 13, RSVD)>, /* LCD_VSYNC */
|
||||
<STM32_PINMUX('K', 7, RSVD)>, /* LCD_DE */
|
||||
<STM32_PINMUX('I', 15, RSVD)>, /* LCD_R0 */
|
||||
<STM32_PINMUX('J', 0, RSVD)>, /* LCD_R1 */
|
||||
<STM32_PINMUX('J', 1, RSVD)>, /* LCD_R2 */
|
||||
<STM32_PINMUX('J', 2, RSVD)>, /* LCD_R3 */
|
||||
<STM32_PINMUX('J', 3, RSVD)>, /* LCD_R4 */
|
||||
<STM32_PINMUX('J', 4, RSVD)>, /* LCD_R5 */
|
||||
<STM32_PINMUX('J', 5, RSVD)>, /* LCD_R6 */
|
||||
<STM32_PINMUX('J', 6, RSVD)>, /* LCD_R7 */
|
||||
<STM32_PINMUX('J', 7, RSVD)>, /* LCD_G0 */
|
||||
<STM32_PINMUX('J', 8, RSVD)>, /* LCD_G1 */
|
||||
<STM32_PINMUX('J', 9, RSVD)>, /* LCD_G2 */
|
||||
<STM32_PINMUX('J', 10, RSVD)>, /* LCD_G3 */
|
||||
<STM32_PINMUX('J', 11, RSVD)>, /* LCD_G4 */
|
||||
<STM32_PINMUX('K', 0, RSVD)>, /* LCD_G5 */
|
||||
<STM32_PINMUX('K', 1, RSVD)>, /* LCD_G6 */
|
||||
<STM32_PINMUX('K', 2, RSVD)>, /* LCD_G7 */
|
||||
<STM32_PINMUX('J', 12, RSVD)>, /* LCD_B0 */
|
||||
<STM32_PINMUX('J', 13, RSVD)>, /* LCD_B1 */
|
||||
<STM32_PINMUX('J', 14, RSVD)>, /* LCD_B2 */
|
||||
<STM32_PINMUX('J', 15, RSVD)>, /* LCD_B3 */
|
||||
<STM32_PINMUX('K', 3, RSVD)>, /* LCD_B4 */
|
||||
<STM32_PINMUX('K', 4, RSVD)>, /* LCD_B5 */
|
||||
<STM32_PINMUX('K', 5, RSVD)>, /* LCD_B6 */
|
||||
<STM32_PINMUX('K', 6, RSVD)>; /* LCD_B7 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_m_can1_pins_a: m4-m-can1-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('H', 13, RSVD)>, /* CAN1_TX */
|
||||
<STM32_PINMUX('I', 9, RSVD)>; /* CAN1_RX */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm1_pins_a: m4-pwm1-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('E', 9, RSVD)>, /* TIM1_CH1 */
|
||||
<STM32_PINMUX('E', 11, RSVD)>, /* TIM1_CH2 */
|
||||
<STM32_PINMUX('E', 14, RSVD)>; /* TIM1_CH4 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm2_pins_a: m4-pwm2-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 3, RSVD)>; /* TIM2_CH4 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm3_pins_a: m4-pwm3-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('C', 7, RSVD)>; /* TIM3_CH2 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm4_pins_a: m4-pwm4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('D', 14, RSVD)>, /* TIM4_CH3 */
|
||||
<STM32_PINMUX('D', 15, RSVD)>; /* TIM4_CH4 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm4_pins_b: m4-pwm4-1 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('D', 13, RSVD)>; /* TIM4_CH2 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm5_pins_a: m4-pwm5-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('H', 11, RSVD)>; /* TIM5_CH2 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm8_pins_a: m4-pwm8-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 2, RSVD)>; /* TIM8_CH4 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_pwm12_pins_a: m4-pwm12-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('H', 6, RSVD)>; /* TIM12_CH1 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_qspi_bk1_pins_a: m4-qspi-bk1-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 8, RSVD)>, /* QSPI_BK1_IO0 */
|
||||
<STM32_PINMUX('F', 9, RSVD)>, /* QSPI_BK1_IO1 */
|
||||
<STM32_PINMUX('F', 7, RSVD)>, /* QSPI_BK1_IO2 */
|
||||
<STM32_PINMUX('F', 6, RSVD)>, /* QSPI_BK1_IO3 */
|
||||
<STM32_PINMUX('B', 6, RSVD)>; /* QSPI_BK1_NCS */
|
||||
};
|
||||
};
|
||||
|
||||
m4_qspi_bk2_pins_a: m4-qspi-bk2-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('H', 2, RSVD)>, /* QSPI_BK2_IO0 */
|
||||
<STM32_PINMUX('H', 3, RSVD)>, /* QSPI_BK2_IO1 */
|
||||
<STM32_PINMUX('G', 10, RSVD)>, /* QSPI_BK2_IO2 */
|
||||
<STM32_PINMUX('G', 7, RSVD)>, /* QSPI_BK2_IO3 */
|
||||
<STM32_PINMUX('C', 0, RSVD)>; /* QSPI_BK2_NCS */
|
||||
};
|
||||
};
|
||||
|
||||
m4_qspi_clk_pins_a: m4-qspi-clk-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 10, RSVD)>; /* QSPI_CLK */
|
||||
};
|
||||
};
|
||||
|
||||
m4_rtc_out2_rmp_pins_a: m4-rtc-out2-rmp-pins-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 8, RSVD)>; /* RTC_OUT2_RMP */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sai2a_pins_a: m4-sai2a-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 5, RSVD)>, /* SAI2_SCK_A */
|
||||
<STM32_PINMUX('I', 6, RSVD)>, /* SAI2_SD_A */
|
||||
<STM32_PINMUX('I', 7, RSVD)>, /* SAI2_FS_A */
|
||||
<STM32_PINMUX('E', 0, RSVD)>; /* SAI2_MCLK_A */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sai2b_pins_a: m4-sai2b-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('E', 12, RSVD)>, /* SAI2_SCK_B */
|
||||
<STM32_PINMUX('E', 13, RSVD)>, /* SAI2_FS_B */
|
||||
<STM32_PINMUX('E', 14, RSVD)>, /* SAI2_MCLK_B */
|
||||
<STM32_PINMUX('F', 11, RSVD)>; /* SAI2_SD_B */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sai2b_pins_b: m4-sai2b-2 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 11, RSVD)>; /* SAI2_SD_B */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sai4a_pins_a: m4-sai4a-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 5, RSVD)>; /* SAI4_SD_A */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sdmmc1_b4_pins_a: m4-sdmmc1-b4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('C', 8, RSVD)>, /* SDMMC1_D0 */
|
||||
<STM32_PINMUX('C', 9, RSVD)>, /* SDMMC1_D1 */
|
||||
<STM32_PINMUX('C', 10, RSVD)>, /* SDMMC1_D2 */
|
||||
<STM32_PINMUX('C', 11, RSVD)>, /* SDMMC1_D3 */
|
||||
<STM32_PINMUX('D', 2, RSVD)>, /* SDMMC1_CMD */
|
||||
<STM32_PINMUX('C', 12, RSVD)>; /* SDMMC1_CK */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sdmmc1_dir_pins_a: m4-sdmmc1-dir-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 2, RSVD)>, /* SDMMC1_D0DIR */
|
||||
<STM32_PINMUX('C', 7, RSVD)>, /* SDMMC1_D123DIR */
|
||||
<STM32_PINMUX('B', 9, RSVD)>, /* SDMMC1_CDIR */
|
||||
<STM32_PINMUX('E', 4, RSVD)>; /* SDMMC1_CKIN */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sdmmc2_b4_pins_a: m4-sdmmc2-b4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 14, RSVD)>, /* SDMMC2_D0 */
|
||||
<STM32_PINMUX('B', 15, RSVD)>, /* SDMMC2_D1 */
|
||||
<STM32_PINMUX('B', 3, RSVD)>, /* SDMMC2_D2 */
|
||||
<STM32_PINMUX('B', 4, RSVD)>, /* SDMMC2_D3 */
|
||||
<STM32_PINMUX('G', 6, RSVD)>, /* SDMMC2_CMD */
|
||||
<STM32_PINMUX('E', 3, RSVD)>; /* SDMMC2_CK */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sdmmc2_b4_pins_b: m4-sdmmc2-b4-1 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 14, RSVD)>, /* SDMMC2_D0 */
|
||||
<STM32_PINMUX('B', 15, RSVD)>, /* SDMMC2_D1 */
|
||||
<STM32_PINMUX('B', 3, RSVD)>, /* SDMMC2_D2 */
|
||||
<STM32_PINMUX('B', 4, RSVD)>, /* SDMMC2_D3 */
|
||||
<STM32_PINMUX('G', 6, RSVD)>, /* SDMMC2_CMD */
|
||||
<STM32_PINMUX('E', 3, RSVD)>; /* SDMMC2_CK */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sdmmc2_d47_pins_a: m4-sdmmc2-d47-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 8, RSVD)>, /* SDMMC2_D4 */
|
||||
<STM32_PINMUX('A', 9, RSVD)>, /* SDMMC2_D5 */
|
||||
<STM32_PINMUX('E', 5, RSVD)>, /* SDMMC2_D6 */
|
||||
<STM32_PINMUX('D', 3, RSVD)>; /* SDMMC2_D7 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_sdmmc3_b4_pins_a: m4-sdmmc3-b4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 0, RSVD)>, /* SDMMC3_D0 */
|
||||
<STM32_PINMUX('F', 4, RSVD)>, /* SDMMC3_D1 */
|
||||
<STM32_PINMUX('F', 5, RSVD)>, /* SDMMC3_D2 */
|
||||
<STM32_PINMUX('D', 7, RSVD)>, /* SDMMC3_D3 */
|
||||
<STM32_PINMUX('F', 1, RSVD)>, /* SDMMC3_CMD */
|
||||
<STM32_PINMUX('G', 15, RSVD)>; /* SDMMC3_CK */
|
||||
};
|
||||
};
|
||||
|
||||
m4_spdifrx_pins_a: m4-spdifrx-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('G', 12, RSVD)>; /* SPDIF_IN1 */
|
||||
};
|
||||
};
|
||||
|
||||
m4_spi4_pins_a: m4-spi4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('E', 12, RSVD)>, /* SPI4_SCK */
|
||||
<STM32_PINMUX('E', 14, RSVD)>, /* SPI4_MOSI */
|
||||
<STM32_PINMUX('E', 13, RSVD)>; /* SPI4_MISO */
|
||||
};
|
||||
};
|
||||
|
||||
m4_spi5_pins_a: m4-spi5-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('F', 7, RSVD)>, /* SPI5_SCK */
|
||||
<STM32_PINMUX('F', 9, RSVD)>, /* SPI5_MOSI */
|
||||
<STM32_PINMUX('F', 8, RSVD)>; /* SPI5_MISO */
|
||||
};
|
||||
};
|
||||
|
||||
m4_stusb1600_pins_a: m4-stusb1600-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('I', 11, RSVD)>;
|
||||
};
|
||||
};
|
||||
|
||||
m4_uart4_pins_a: m4-uart4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('G', 11, RSVD)>, /* UART4_TX */
|
||||
<STM32_PINMUX('B', 2, RSVD)>; /* UART4_RX */
|
||||
};
|
||||
};
|
||||
|
||||
m4_uart7_pins_a: m4-uart7-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('E', 8, RSVD)>, /* USART7_TX */
|
||||
<STM32_PINMUX('E', 7, RSVD)>; /* USART7_RX */
|
||||
};
|
||||
};
|
||||
|
||||
m4_usart2_pins_a: m4-usart2-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('D', 5, RSVD)>, /* USART2_TX */
|
||||
<STM32_PINMUX('D', 4, RSVD)>, /* USART2_RTS */
|
||||
<STM32_PINMUX('D', 6, RSVD)>, /* USART2_RX */
|
||||
<STM32_PINMUX('D', 3, RSVD)>; /* USART2_CTS_NSS */
|
||||
};
|
||||
};
|
||||
|
||||
m4_usart3_pins_a: m4-usart3-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 10, RSVD)>, /* USART3_TX */
|
||||
<STM32_PINMUX('G', 8, RSVD)>, /* USART3_RTS */
|
||||
<STM32_PINMUX('B', 12, RSVD)>, /* USART3_RX */
|
||||
<STM32_PINMUX('I', 10, RSVD)>; /* USART3_CTS_NSS */
|
||||
};
|
||||
};
|
||||
|
||||
m4_usart3_pins_b: m4-usart3-1 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('B', 10, RSVD)>, /* USART3_TX */
|
||||
<STM32_PINMUX('G', 8, RSVD)>, /* USART3_RTS */
|
||||
<STM32_PINMUX('B', 12, RSVD)>, /* USART3_RX */
|
||||
<STM32_PINMUX('B', 13, RSVD)>; /* USART3_CTS_NSS */
|
||||
};
|
||||
};
|
||||
|
||||
m4_usbotg_hs_pins_a: m4-usbotg_hs-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 10, RSVD)>; /* OTG_ID */
|
||||
};
|
||||
};
|
||||
|
||||
m4_usbotg_fs_dp_dm_pins_a: m4-usbotg-fs-dp-dm-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('A', 11, RSVD)>, /* OTG_FS_DM */
|
||||
<STM32_PINMUX('A', 12, RSVD)>; /* OTG_FS_DP */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl_z {
|
||||
m4_i2c4_pins_a: m4-i2c4-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('Z', 4, RSVD)>, /* I2C4_SCL */
|
||||
<STM32_PINMUX('Z', 5, RSVD)>; /* I2C4_SDA */
|
||||
};
|
||||
};
|
||||
|
||||
m4_spi1_pins_a: m4-spi1-0 {
|
||||
pins {
|
||||
pinmux = <STM32_PINMUX('Z', 0, RSVD)>, /* SPI1_SCK */
|
||||
<STM32_PINMUX('Z', 2, RSVD)>, /* SPI1_MOSI */
|
||||
<STM32_PINMUX('Z', 1, RSVD)>; /* SPI1_MISO */
|
||||
};
|
||||
};
|
||||
};
|
||||
442
arch/arm/dts/stm32mp157-m4-srm.dtsi
Normal file
442
arch/arm/dts/stm32mp157-m4-srm.dtsi
Normal file
@ -0,0 +1,442 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Fabien Dessenne <fabien.dessenne@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
&m4_rproc {
|
||||
m4_system_resources {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
m4_timers2: timer@40000000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40000000 0x400>;
|
||||
clocks = <&rcc TIM2_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers3: timer@40001000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40001000 0x400>;
|
||||
clocks = <&rcc TIM3_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers4: timer@40002000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40002000 0x400>;
|
||||
clocks = <&rcc TIM4_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers5: timer@40003000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40003000 0x400>;
|
||||
clocks = <&rcc TIM5_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers6: timer@40004000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40004000 0x400>;
|
||||
clocks = <&rcc TIM6_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers7: timer@40005000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40005000 0x400>;
|
||||
clocks = <&rcc TIM7_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers12: timer@40006000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40006000 0x400>;
|
||||
clocks = <&rcc TIM12_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers13: timer@40007000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40007000 0x400>;
|
||||
clocks = <&rcc TIM13_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers14: timer@40008000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40008000 0x400>;
|
||||
clocks = <&rcc TIM14_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_lptimer1: timer@40009000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40009000 0x400>;
|
||||
clocks = <&rcc LPTIM1_K>;
|
||||
clock-names = "mux";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_spi2: spi@4000b000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000b000 0x400>;
|
||||
clocks = <&rcc SPI2_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2s2: audio-controller@4000b000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000b000 0x400>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_spi3: spi@4000c000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000c000 0x400>;
|
||||
clocks = <&rcc SPI3_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2s3: audio-controller@4000c000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000c000 0x400>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_spdifrx: audio-controller@4000d000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000d000 0x400>;
|
||||
clocks = <&rcc SPDIF_K>;
|
||||
clock-names = "kclk";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_usart2: serial@4000e000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000e000 0x400>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <27 1>;
|
||||
clocks = <&rcc USART2_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_usart3: serial@4000f000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4000f000 0x400>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <28 1>;
|
||||
clocks = <&rcc USART3_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_uart4: serial@40010000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40010000 0x400>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <30 1>;
|
||||
clocks = <&rcc UART4_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_uart5: serial@40011000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40011000 0x400>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <31 1>;
|
||||
clocks = <&rcc UART5_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2c1: i2c@40012000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40012000 0x400>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <21 1>;
|
||||
clocks = <&rcc I2C1_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2c2: i2c@40013000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40013000 0x400>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <22 1>;
|
||||
clocks = <&rcc I2C2_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2c3: i2c@40014000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40014000 0x400>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <23 1>;
|
||||
clocks = <&rcc I2C3_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2c5: i2c@40015000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40015000 0x400>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <25 1>;
|
||||
clocks = <&rcc I2C5_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_cec: cec@40016000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40016000 0x400>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <69 1>;
|
||||
clocks = <&rcc CEC_K>, <&scmi0_clk CK_SCMI0_LSE>;
|
||||
clock-names = "cec", "hdmi-cec";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_dac: dac@40017000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40017000 0x400>;
|
||||
clocks = <&rcc DAC12>;
|
||||
clock-names = "pclk";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_uart7: serial@40018000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40018000 0x400>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <32 1>;
|
||||
clocks = <&rcc UART7_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_uart8: serial@40019000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x40019000 0x400>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <33 1>;
|
||||
clocks = <&rcc UART8_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers1: timer@44000000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44000000 0x400>;
|
||||
clocks = <&rcc TIM1_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers8: timer@44001000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44001000 0x400>;
|
||||
clocks = <&rcc TIM8_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_usart6: serial@44003000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44003000 0x400>;
|
||||
interrupt-parent = <&exti>;
|
||||
interrupts = <29 1>;
|
||||
clocks = <&rcc USART6_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_spi1: spi@44004000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44004000 0x400>;
|
||||
clocks = <&rcc SPI1_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_i2s1: audio-controller@44004000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44004000 0x400>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_spi4: spi@44005000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44005000 0x400>;
|
||||
clocks = <&rcc SPI4_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers15: timer@44006000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44006000 0x400>;
|
||||
clocks = <&rcc TIM15_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers16: timer@44007000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44007000 0x400>;
|
||||
clocks = <&rcc TIM16_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_timers17: timer@44008000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44008000 0x400>;
|
||||
clocks = <&rcc TIM17_K>;
|
||||
clock-names = "int";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_spi5: spi@44009000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x44009000 0x400>;
|
||||
clocks = <&rcc SPI5_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_sai1: sai@4400a000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4400a000 0x4>;
|
||||
clocks = <&rcc SAI1_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_sai2: sai@4400b000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4400b000 0x4>;
|
||||
clocks = <&rcc SAI2_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_sai3: sai@4400c000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4400c000 0x4>;
|
||||
clocks = <&rcc SAI3_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_dfsdm: dfsdm@4400d000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4400d000 0x800>;
|
||||
clocks = <&rcc DFSDM_K>, <&rcc ADFSDM_K>;
|
||||
clock-names = "dfsdm", "audio";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_m_can1: can@4400e000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4400e000 0x400>, <0x44011000 0x2800>;
|
||||
clocks = <&scmi0_clk CK_SCMI0_HSE>, <&rcc FDCAN_K>;
|
||||
clock-names = "hclk", "cclk";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_m_can2: can@4400f000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4400f000 0x400>, <0x44011000 0x2800>;
|
||||
clocks = <&scmi0_clk CK_SCMI0_HSE>, <&rcc FDCAN_K>;
|
||||
clock-names = "hclk", "cclk";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_dma1: dma@48000000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x48000000 0x400>;
|
||||
clocks = <&rcc DMA1>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_dma2: dma@48001000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x48001000 0x400>;
|
||||
clocks = <&rcc DMA2>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_dmamux1: dma-router@48002000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x48002000 0x1c>;
|
||||
clocks = <&rcc DMAMUX>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_adc: adc@48003000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x48003000 0x400>;
|
||||
clocks = <&rcc ADC12>, <&rcc ADC12_K>;
|
||||
clock-names = "bus", "adc";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_sdmmc3: sdmmc@48004000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x48004000 0x400>, <0x48005000 0x400>;
|
||||
clocks = <&rcc SDMMC3_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_usbotg_hs: usb-otg@49000000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x49000000 0x10000>;
|
||||
clocks = <&rcc USBO_K>;
|
||||
clock-names = "otg";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_hash2: hash@4c002000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4c002000 0x400>;
|
||||
clocks = <&rcc HASH2>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_rng2: rng@4c003000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4c003000 0x400>;
|
||||
clocks = <&rcc RNG2_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_crc2: crc@4c004000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4c004000 0x400>;
|
||||
clocks = <&rcc CRC2>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_cryp2: cryp@4c005000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4c005000 0x400>;
|
||||
clocks = <&rcc CRYP2>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_dcmi: dcmi@4c006000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x4c006000 0x400>;
|
||||
clocks = <&rcc DCMI>;
|
||||
clock-names = "mclk";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_lptimer2: timer@50021000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x50021000 0x400>;
|
||||
clocks = <&rcc LPTIM2_K>;
|
||||
clock-names = "mux";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_lptimer3: timer@50022000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x50022000 0x400>;
|
||||
clocks = <&rcc LPTIM3_K>;
|
||||
clock-names = "mux";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_lptimer4: timer@50023000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x50023000 0x400>;
|
||||
clocks = <&rcc LPTIM4_K>;
|
||||
clock-names = "mux";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_lptimer5: timer@50024000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x50024000 0x400>;
|
||||
clocks = <&rcc LPTIM5_K>;
|
||||
clock-names = "mux";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_sai4: sai@50027000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x50027000 0x4>;
|
||||
clocks = <&rcc SAI4_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "disabled";
|
||||
};
|
||||
m4_qspi: qspi@58003000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x58003000 0x1000>, <0x70000000 0x10000000>;
|
||||
clocks = <&rcc QSPI_K>;
|
||||
status = "disabled";
|
||||
};
|
||||
m4_ethernet0: ethernet@5800a000 {
|
||||
compatible = "rproc-srm-dev";
|
||||
reg = <0x5800a000 0x2000>;
|
||||
clock-names = "stmmaceth",
|
||||
"mac-clk-tx",
|
||||
"mac-clk-rx",
|
||||
"ethstp",
|
||||
"syscfg-clk";
|
||||
clocks = <&rcc ETHMAC>,
|
||||
<&rcc ETHTX>,
|
||||
<&rcc ETHRX>,
|
||||
<&rcc ETHSTP>,
|
||||
<&rcc SYSCFG>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
32
arch/arm/dts/stm32mp157.dtsi
Normal file
32
arch/arm/dts/stm32mp157.dtsi
Normal file
@ -0,0 +1,32 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
#include "stm32mp153.dtsi"
|
||||
|
||||
/ {
|
||||
soc {
|
||||
gpu: gpu@59000000 {
|
||||
compatible = "vivante,gc";
|
||||
reg = <0x59000000 0x800>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&rcc GPU>, <&rcc GPU_K>;
|
||||
clock-names = "bus" ,"core";
|
||||
resets = <&rcc GPU_R>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
dsi: dsi@5a000000 {
|
||||
compatible = "st,stm32-dsi";
|
||||
reg = <0x5a000000 0x800>;
|
||||
phy-dsi-supply = <®18>;
|
||||
clocks = <&rcc DSI_K>, <&scmi0_clk CK_SCMI0_HSE>, <&rcc DSI_PX>;
|
||||
clock-names = "pclk", "ref", "px_clk";
|
||||
resets = <&rcc DSI_R>;
|
||||
reset-names = "apb";
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <dt-bindings/clock/stm32mp1-clksrc.h>
|
||||
#include "stm32mp157-u-boot.dtsi"
|
||||
#include "stm32mp15-u-boot.dtsi"
|
||||
#include "stm32mp15-ddr3-2x4Gb-1066-binG.dtsi"
|
||||
|
||||
/ {
|
||||
@ -20,6 +20,7 @@
|
||||
config {
|
||||
u-boot,boot-led = "led1";
|
||||
u-boot,error-led = "led4";
|
||||
u-boot,mmc-env-partition = "ssbl";
|
||||
};
|
||||
};
|
||||
|
||||
@ -91,7 +92,7 @@
|
||||
CLK_UART6_HSI
|
||||
CLK_UART78_HSI
|
||||
CLK_SPDIF_PLL4P
|
||||
CLK_FDCAN_PLL4Q
|
||||
CLK_FDCAN_PLL4R
|
||||
CLK_SAI1_PLL3Q
|
||||
CLK_SAI2_PLL3Q
|
||||
CLK_SAI3_PLL3Q
|
||||
@ -103,15 +104,10 @@
|
||||
CLK_LPTIM45_LSE
|
||||
>;
|
||||
|
||||
/* VCO = 1300.0 MHz => P = 650 (CPU) */
|
||||
pll1: st,pll@0 {
|
||||
cfg = < 2 80 0 0 0 PQR(1,0,0) >;
|
||||
frac = < 0x800 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */
|
||||
pll2: st,pll@1 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <1>;
|
||||
cfg = < 2 65 1 0 0 PQR(1,1,1) >;
|
||||
frac = < 0x1400 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
@ -119,6 +115,8 @@
|
||||
|
||||
/* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */
|
||||
pll3: st,pll@2 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <2>;
|
||||
cfg = < 1 33 1 16 36 PQR(1,1,1) >;
|
||||
frac = < 0x1a04 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
@ -126,6 +124,8 @@
|
||||
|
||||
/* VCO = 480.0 MHz => P = 120, Q = 40, R = 96 */
|
||||
pll4: st,pll@3 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <3>;
|
||||
cfg = < 1 39 3 11 4 PQR(1,1,1) >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
@ -137,14 +137,20 @@
|
||||
|
||||
&sdmmc1_b4_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc1_dir_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
@ -188,7 +194,3 @@
|
||||
u-boot,force-b-session-valid;
|
||||
hnp-srp-disable;
|
||||
};
|
||||
|
||||
&v3v3 {
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
@ -6,9 +6,10 @@
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157c.dtsi"
|
||||
#include "stm32mp157xac-pinctrl.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include "stm32mp157.dtsi"
|
||||
#include "stm32mp15xa.dtsi"
|
||||
#include "stm32mp15-pinctrl.dtsi"
|
||||
#include "stm32mp15xxac-pinctrl.dtsi"
|
||||
#include <dt-bindings/mfd/st,stpmic1.h>
|
||||
|
||||
/ {
|
||||
@ -252,14 +253,13 @@
|
||||
regulator-name = "vbus_otg";
|
||||
interrupts = <IT_OCP_OTG 0>;
|
||||
interrupt-parent = <&pmic>;
|
||||
regulator-active-discharge;
|
||||
};
|
||||
|
||||
vbus_sw: pwr_sw2 {
|
||||
regulator-name = "vbus_sw";
|
||||
interrupts = <IT_OCP_SWOUT 0>;
|
||||
interrupt-parent = <&pmic>;
|
||||
regulator-active-discharge;
|
||||
regulator-active-discharge = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -282,12 +282,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pwr {
|
||||
pwr-regulators {
|
||||
&pwr_regulators {
|
||||
vdd-supply = <&vdd>;
|
||||
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
||||
};
|
||||
};
|
||||
|
||||
&rng1 {
|
||||
status = "okay";
|
||||
@ -302,7 +300,7 @@
|
||||
pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_a>;
|
||||
pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
|
||||
pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
|
||||
broken-cd;
|
||||
cd-gpios = <&gpioi 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
|
||||
st,sig-dir;
|
||||
st,neg-edge;
|
||||
st,use-ckin;
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <dt-bindings/clock/stm32mp1-clksrc.h>
|
||||
#include "stm32mp157-u-boot.dtsi"
|
||||
#include "stm32mp15-u-boot.dtsi"
|
||||
#include "stm32mp15-ddr3-1x4Gb-1066-binG.dtsi"
|
||||
|
||||
/ {
|
||||
@ -16,6 +16,7 @@
|
||||
config {
|
||||
u-boot,boot-led = "heartbeat";
|
||||
u-boot,error-led = "error";
|
||||
u-boot,mmc-env-partition = "ssbl";
|
||||
st,adc_usb_pd = <&adc1 18>, <&adc1 19>;
|
||||
st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
|
||||
st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
|
||||
@ -27,34 +28,14 @@
|
||||
default-state = "off";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
blue {
|
||||
default-state = "on";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&adc12_usb_pwr_pins_a>;
|
||||
vdd-supply = <&vdd>;
|
||||
vdda-supply = <&vdd>;
|
||||
vref-supply = <&vrefbuf>;
|
||||
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";
|
||||
};
|
||||
};
|
||||
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
&clk_hse {
|
||||
st,digbypass;
|
||||
};
|
||||
@ -70,6 +51,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
&i2s2 {
|
||||
clocks = <&rcc SPI2>, <&rcc SPI2_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
};
|
||||
|
||||
&pmic {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
@ -127,7 +112,7 @@
|
||||
CLK_UART6_HSI
|
||||
CLK_UART78_HSI
|
||||
CLK_SPDIF_PLL4P
|
||||
CLK_FDCAN_PLL4Q
|
||||
CLK_FDCAN_PLL4R
|
||||
CLK_SAI1_PLL3Q
|
||||
CLK_SAI2_PLL3Q
|
||||
CLK_SAI3_PLL3Q
|
||||
@ -139,15 +124,10 @@
|
||||
CLK_LPTIM45_LSE
|
||||
>;
|
||||
|
||||
/* VCO = 1300.0 MHz => P = 650 (CPU) */
|
||||
pll1: st,pll@0 {
|
||||
cfg = < 2 80 0 0 0 PQR(1,0,0) >;
|
||||
frac = < 0x800 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */
|
||||
pll2: st,pll@1 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <1>;
|
||||
cfg = < 2 65 1 0 0 PQR(1,1,1) >;
|
||||
frac = < 0x1400 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
@ -155,6 +135,8 @@
|
||||
|
||||
/* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */
|
||||
pll3: st,pll@2 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <2>;
|
||||
cfg = < 1 33 1 16 36 PQR(1,1,1) >;
|
||||
frac = < 0x1a04 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
@ -162,21 +144,31 @@
|
||||
|
||||
/* VCO = 594.0 MHz => P = 99, Q = 74, R = 74 */
|
||||
pll4: st,pll@3 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <3>;
|
||||
cfg = < 3 98 5 7 7 PQR(1,1,1) >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
&sai2 {
|
||||
clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
};
|
||||
|
||||
&sdmmc1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&sdmmc1_b4_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
&uart4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
@ -197,4 +189,6 @@
|
||||
&usbotg_hs {
|
||||
u-boot,force-b-session-valid;
|
||||
hnp-srp-disable;
|
||||
/* TEMP: force peripheral for USB OTG */
|
||||
dr_mode = "peripheral";
|
||||
};
|
||||
|
||||
@ -6,11 +6,11 @@
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157c.dtsi"
|
||||
#include "stm32mp157xac-pinctrl.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/mfd/st,stpmic1.h>
|
||||
|
||||
#include "stm32mp157.dtsi"
|
||||
#include "stm32mp15xa.dtsi"
|
||||
#include "stm32mp15-pinctrl.dtsi"
|
||||
#include "stm32mp15xxac-pinctrl.dtsi"
|
||||
#include "stm32mp15xx-dkx.dtsi"
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157A-DK1 Discovery Board";
|
||||
compatible = "st,stm32mp157a-dk1", "st,stm32mp157";
|
||||
@ -18,491 +18,27 @@
|
||||
aliases {
|
||||
ethernet0 = ðernet0;
|
||||
serial0 = &uart4;
|
||||
serial1 = &usart3;
|
||||
serial2 = &uart7;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
memory@c0000000 {
|
||||
reg = <0xc0000000 0x20000000>;
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
mcuram2: mcuram2@10000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0x10000000 0x40000>;
|
||||
gpu_reserved: gpu@da000000 {
|
||||
reg = <0xda000000 0x4000000>;
|
||||
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;
|
||||
};
|
||||
|
||||
gpu_reserved: gpu@d4000000 {
|
||||
reg = <0xd4000000 0x4000000>;
|
||||
optee_memory: optee@0xde000000 {
|
||||
reg = <0xde000000 0x02000000>;
|
||||
no-map;
|
||||
};
|
||||
};
|
||||
|
||||
led {
|
||||
compatible = "gpio-leds";
|
||||
blue {
|
||||
label = "heartbeat";
|
||||
gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "heartbeat";
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
|
||||
sound {
|
||||
compatible = "audio-graph-card";
|
||||
label = "STM32MP1-DK";
|
||||
routing =
|
||||
"Playback" , "MCLK",
|
||||
"Capture" , "MCLK",
|
||||
"MICL" , "Mic Bias";
|
||||
dais = <&sai2a_port &sai2b_port>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&cec {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&cec_pins_b>;
|
||||
pinctrl-1 = <&cec_pins_sleep_b>;
|
||||
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-id";
|
||||
max-speed = <1000>;
|
||||
phy-handle = <&phy0>;
|
||||
|
||||
mdio0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "snps,dwmac-mdio";
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&gpu {
|
||||
contiguous-area = <&gpu_reserved>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2c1_pins_a>;
|
||||
pinctrl-1 = <&i2c1_pins_sleep_a>;
|
||||
i2c-scl-rising-time-ns = <100>;
|
||||
i2c-scl-falling-time-ns = <7>;
|
||||
status = "okay";
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
|
||||
hdmi-transmitter@39 {
|
||||
compatible = "sil,sii9022";
|
||||
reg = <0x39>;
|
||||
iovcc-supply = <&v3v3_hdmi>;
|
||||
cvcc12-supply = <&v1v2_hdmi>;
|
||||
reset-gpios = <&gpioa 10 GPIO_ACTIVE_LOW>;
|
||||
interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-parent = <&gpiog>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <<dc_pins_a>;
|
||||
pinctrl-1 = <<dc_pins_sleep_a>;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
sii9022_in: endpoint {
|
||||
remote-endpoint = <<dc_ep0_out>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
cs42l51: cs42l51@4a {
|
||||
compatible = "cirrus,cs42l51";
|
||||
reg = <0x4a>;
|
||||
#sound-dai-cells = <0>;
|
||||
VL-supply = <&v3v3>;
|
||||
VD-supply = <&v1v8_audio>;
|
||||
VA-supply = <&v1v8_audio>;
|
||||
VAHP-supply = <&v1v8_audio>;
|
||||
reset-gpios = <&gpiog 9 GPIO_ACTIVE_LOW>;
|
||||
clocks = <&sai2a>;
|
||||
clock-names = "MCLK";
|
||||
status = "okay";
|
||||
|
||||
cs42l51_port: port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cs42l51_tx_endpoint: endpoint@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&sai2a_endpoint>;
|
||||
frame-master;
|
||||
bitclock-master;
|
||||
};
|
||||
|
||||
cs42l51_rx_endpoint: endpoint@1 {
|
||||
reg = <1>;
|
||||
remote-endpoint = <&sai2b_endpoint>;
|
||||
frame-master;
|
||||
bitclock-master;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c4_pins_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
status = "okay";
|
||||
/* spare dmas for other usage */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
|
||||
typec: stusb1600@28 {
|
||||
compatible = "st,stusb1600";
|
||||
reg = <0x28>;
|
||||
interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-parent = <&gpioi>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&stusb1600_pins_a>;
|
||||
|
||||
status = "okay";
|
||||
|
||||
typec_con: connector {
|
||||
compatible = "usb-c-connector";
|
||||
label = "USB-C";
|
||||
power-role = "sink";
|
||||
power-opmode = "default";
|
||||
};
|
||||
};
|
||||
|
||||
pmic: stpmic@33 {
|
||||
compatible = "st,stpmic1";
|
||||
reg = <0x33>;
|
||||
interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "okay";
|
||||
|
||||
regulators {
|
||||
compatible = "st,stpmic1-regulators";
|
||||
ldo1-supply = <&v3v3>;
|
||||
ldo3-supply = <&vdd_ddr>;
|
||||
ldo6-supply = <&v3v3>;
|
||||
pwr_sw1-supply = <&bst_out>;
|
||||
pwr_sw2-supply = <&bst_out>;
|
||||
|
||||
vddcore: buck1 {
|
||||
regulator-name = "vddcore";
|
||||
regulator-min-microvolt = <800000>;
|
||||
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 = <IT_CURLIM_LDO1 0>;
|
||||
};
|
||||
|
||||
v3v3_hdmi: ldo2 {
|
||||
regulator-name = "v3v3_hdmi";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-always-on;
|
||||
interrupts = <IT_CURLIM_LDO2 0>;
|
||||
};
|
||||
|
||||
vtt_ddr: ldo3 {
|
||||
regulator-name = "vtt_ddr";
|
||||
regulator-min-microvolt = <500000>;
|
||||
regulator-max-microvolt = <750000>;
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
vdd_usb: ldo4 {
|
||||
regulator-name = "vdd_usb";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
interrupts = <IT_CURLIM_LDO4 0>;
|
||||
};
|
||||
|
||||
vdda: ldo5 {
|
||||
regulator-name = "vdda";
|
||||
regulator-min-microvolt = <2900000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
interrupts = <IT_CURLIM_LDO5 0>;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
v1v2_hdmi: ldo6 {
|
||||
regulator-name = "v1v2_hdmi";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <1200000>;
|
||||
regulator-always-on;
|
||||
interrupts = <IT_CURLIM_LDO6 0>;
|
||||
};
|
||||
|
||||
vref_ddr: vref_ddr {
|
||||
regulator-name = "vref_ddr";
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
bst_out: boost {
|
||||
regulator-name = "bst_out";
|
||||
interrupts = <IT_OCP_BOOST 0>;
|
||||
};
|
||||
|
||||
vbus_otg: pwr_sw1 {
|
||||
regulator-name = "vbus_otg";
|
||||
interrupts = <IT_OCP_OTG 0>;
|
||||
};
|
||||
|
||||
vbus_sw: pwr_sw2 {
|
||||
regulator-name = "vbus_sw";
|
||||
interrupts = <IT_OCP_SWOUT 0>;
|
||||
regulator-active-discharge;
|
||||
};
|
||||
};
|
||||
|
||||
onkey {
|
||||
compatible = "st,stpmic1-onkey";
|
||||
interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
|
||||
interrupt-names = "onkey-falling", "onkey-rising";
|
||||
power-off-time-sec = <10>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
watchdog {
|
||||
compatible = "st,stpmic1-wdt";
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ipcc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&iwdg2 {
|
||||
timeout-sec = <32>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
<dc {
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
ltdc_ep0_out: endpoint@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&sii9022_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&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>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pwr {
|
||||
pwr-regulators {
|
||||
vdd-supply = <&vdd>;
|
||||
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
||||
};
|
||||
};
|
||||
|
||||
&rng1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rtc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sai2 {
|
||||
clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
clock-names = "pclk", "x8k", "x11k";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sai2a_pins_a>, <&sai2b_pins_b>;
|
||||
pinctrl-1 = <&sai2a_sleep_pins_a>, <&sai2b_sleep_pins_b>;
|
||||
status = "okay";
|
||||
|
||||
sai2a: audio-controller@4400b004 {
|
||||
#clock-cells = <0>;
|
||||
dma-names = "tx";
|
||||
clocks = <&rcc SAI2_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "okay";
|
||||
|
||||
sai2a_port: port {
|
||||
sai2a_endpoint: endpoint {
|
||||
remote-endpoint = <&cs42l51_tx_endpoint>;
|
||||
format = "i2s";
|
||||
mclk-fs = <256>;
|
||||
dai-tdm-slot-num = <2>;
|
||||
dai-tdm-slot-width = <32>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sai2b: audio-controller@4400b024 {
|
||||
dma-names = "rx";
|
||||
st,sync = <&sai2a 2>;
|
||||
clocks = <&rcc SAI2_K>, <&sai2a>;
|
||||
clock-names = "sai_ck", "MCLK";
|
||||
status = "okay";
|
||||
|
||||
sai2b_port: port {
|
||||
sai2b_endpoint: endpoint {
|
||||
remote-endpoint = <&cs42l51_rx_endpoint>;
|
||||
format = "i2s";
|
||||
mclk-fs = <256>;
|
||||
dai-tdm-slot-num = <2>;
|
||||
dai-tdm-slot-width = <32>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&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 = <&v3v3>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart4 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart4_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbh_ehci {
|
||||
phys = <&usbphyc_port0>;
|
||||
phy-names = "usb";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbotg_hs {
|
||||
dr_mode = "peripheral";
|
||||
phys = <&usbphyc_port1 0>;
|
||||
phy-names = "usb2-phy";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbphyc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbphyc_port0 {
|
||||
phy-supply = <&vdd_usb>;
|
||||
};
|
||||
|
||||
&usbphyc_port1 {
|
||||
phy-supply = <&vdd_usb>;
|
||||
};
|
||||
|
||||
&vrefbuf {
|
||||
regulator-min-microvolt = <2500000>;
|
||||
regulator-max-microvolt = <2500000>;
|
||||
vdda-supply = <&vdd>;
|
||||
&optee {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
207
arch/arm/dts/stm32mp157a-ed1-u-boot.dtsi
Normal file
207
arch/arm/dts/stm32mp157a-ed1-u-boot.dtsi
Normal file
@ -0,0 +1,207 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright : STMicroelectronics 2018
|
||||
*/
|
||||
|
||||
#include <dt-bindings/clock/stm32mp1-clksrc.h>
|
||||
#include "stm32mp15-u-boot.dtsi"
|
||||
#include "stm32mp15-ddr3-2x4Gb-1066-binG.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
i2c3 = &i2c4;
|
||||
mmc0 = &sdmmc1;
|
||||
mmc1 = &sdmmc2;
|
||||
};
|
||||
|
||||
config {
|
||||
u-boot,boot-led = "heartbeat";
|
||||
u-boot,error-led = "error";
|
||||
u-boot,mmc-env-partition = "ssbl";
|
||||
st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
|
||||
st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led {
|
||||
red {
|
||||
label = "error";
|
||||
gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
|
||||
default-state = "off";
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
&clk_hse {
|
||||
st,digbypass;
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&i2c4_pins_a {
|
||||
u-boot,dm-pre-reloc;
|
||||
pins {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
&pmic {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&rcc {
|
||||
st,clksrc = <
|
||||
CLK_MPU_PLL1P
|
||||
CLK_AXI_PLL2P
|
||||
CLK_MCU_PLL3P
|
||||
CLK_PLL12_HSE
|
||||
CLK_PLL3_HSE
|
||||
CLK_PLL4_HSE
|
||||
CLK_RTC_LSE
|
||||
CLK_MCO1_DISABLED
|
||||
CLK_MCO2_DISABLED
|
||||
>;
|
||||
|
||||
st,clkdiv = <
|
||||
1 /*MPU*/
|
||||
0 /*AXI*/
|
||||
0 /*MCU*/
|
||||
1 /*APB1*/
|
||||
1 /*APB2*/
|
||||
1 /*APB3*/
|
||||
1 /*APB4*/
|
||||
2 /*APB5*/
|
||||
23 /*RTC*/
|
||||
0 /*MCO1*/
|
||||
0 /*MCO2*/
|
||||
>;
|
||||
|
||||
st,pkcs = <
|
||||
CLK_CKPER_HSE
|
||||
CLK_FMC_ACLK
|
||||
CLK_QSPI_ACLK
|
||||
CLK_ETH_DISABLED
|
||||
CLK_SDMMC12_PLL4P
|
||||
CLK_DSI_DSIPLL
|
||||
CLK_STGEN_HSE
|
||||
CLK_USBPHY_HSE
|
||||
CLK_SPI2S1_PLL3Q
|
||||
CLK_SPI2S23_PLL3Q
|
||||
CLK_SPI45_HSI
|
||||
CLK_SPI6_HSI
|
||||
CLK_I2C46_HSI
|
||||
CLK_SDMMC3_PLL4P
|
||||
CLK_USBO_USBPHY
|
||||
CLK_ADC_CKPER
|
||||
CLK_CEC_LSE
|
||||
CLK_I2C12_HSI
|
||||
CLK_I2C35_HSI
|
||||
CLK_UART1_HSI
|
||||
CLK_UART24_HSI
|
||||
CLK_UART35_HSI
|
||||
CLK_UART6_HSI
|
||||
CLK_UART78_HSI
|
||||
CLK_SPDIF_PLL4P
|
||||
CLK_FDCAN_PLL4R
|
||||
CLK_SAI1_PLL3Q
|
||||
CLK_SAI2_PLL3Q
|
||||
CLK_SAI3_PLL3Q
|
||||
CLK_SAI4_PLL3Q
|
||||
CLK_RNG1_LSI
|
||||
CLK_RNG2_LSI
|
||||
CLK_LPTIM1_PCLK1
|
||||
CLK_LPTIM23_PCLK3
|
||||
CLK_LPTIM45_LSE
|
||||
>;
|
||||
|
||||
/* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */
|
||||
pll2: st,pll@1 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <1>;
|
||||
cfg = < 2 65 1 0 0 PQR(1,1,1) >;
|
||||
frac = < 0x1400 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */
|
||||
pll3: st,pll@2 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <2>;
|
||||
cfg = < 1 33 1 16 36 PQR(1,1,1) >;
|
||||
frac = < 0x1a04 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 594.0 MHz => P = 99, Q = 74, R = 74 */
|
||||
pll4: st,pll@3 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <3>;
|
||||
cfg = < 3 98 5 7 7 PQR(1,1,1) >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&sdmmc1_b4_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc1_dir_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&sdmmc2_b4_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc2_d47_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
&uart4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&uart4_pins_a {
|
||||
u-boot,dm-pre-reloc;
|
||||
pins1 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-pre-reloc;
|
||||
/* pull-up on rx to avoid floating level */
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
52
arch/arm/dts/stm32mp157a-ed1.dts
Normal file
52
arch/arm/dts/stm32mp157a-ed1.dts
Normal file
@ -0,0 +1,52 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157.dtsi"
|
||||
#include "stm32mp15xa.dtsi"
|
||||
#include "stm32mp15-pinctrl.dtsi"
|
||||
#include "stm32mp15xxaa-pinctrl.dtsi"
|
||||
#include "stm32mp157-m4-srm.dtsi"
|
||||
#include "stm32mp157-m4-srm-pinctrl.dtsi"
|
||||
#include "stm32mp15xx-edx.dtsi"
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157A eval daughter";
|
||||
compatible = "st,stm32mp157a-ed1", "st,stm32mp157";
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
aliases {
|
||||
serial0 = &uart4;
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
gpu_reserved: gpu@f6000000 {
|
||||
reg = <0xf6000000 0x8000000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
optee_memory: optee@fe000000 {
|
||||
reg = <0xfe000000 0x02000000>;
|
||||
no-map;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&cpu1{
|
||||
cpu-supply = <&vddcore>;
|
||||
};
|
||||
|
||||
&gpu {
|
||||
contiguous-area = <&gpu_reserved>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&optee {
|
||||
status = "okay";
|
||||
};
|
||||
69
arch/arm/dts/stm32mp157a-ev1-u-boot.dtsi
Normal file
69
arch/arm/dts/stm32mp157a-ev1-u-boot.dtsi
Normal file
@ -0,0 +1,69 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright : STMicroelectronics 2018
|
||||
*/
|
||||
|
||||
#include "stm32mp157c-ed1-u-boot.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
gpio26 = &stmfx_pinctrl;
|
||||
i2c1 = &i2c2;
|
||||
i2c4 = &i2c5;
|
||||
pinctrl2 = &stmfx_pinctrl;
|
||||
spi0 = &qspi;
|
||||
usb0 = &usbotg_hs;
|
||||
};
|
||||
};
|
||||
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
&flash0 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&qspi {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&qspi_clk_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&qspi_bk1_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&qspi_bk2_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sai2 {
|
||||
clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
};
|
||||
|
||||
&sai4 {
|
||||
clocks = <&rcc SAI4>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/* TEMP: force peripheral for USB OTG */
|
||||
&usbotg_hs {
|
||||
dr_mode = "peripheral";
|
||||
};
|
||||
|
||||
86
arch/arm/dts/stm32mp157a-ev1.dts
Normal file
86
arch/arm/dts/stm32mp157a-ev1.dts
Normal file
@ -0,0 +1,86 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157a-ed1.dts"
|
||||
#include "stm32mp15xx-evx.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/soc/stm32-hdp.h>
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157A eval daughter on eval mother";
|
||||
compatible = "st,stm32mp157a-ev1", "st,stm32mp157a-ed1", "st,stm32mp157";
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
aliases {
|
||||
serial1 = &usart3;
|
||||
ethernet0 = ðernet0;
|
||||
};
|
||||
};
|
||||
|
||||
&dsi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
dsi_in: endpoint {
|
||||
remote-endpoint = <<dc_ep0_out>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
dsi_out: endpoint {
|
||||
remote-endpoint = <&dsi_panel_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
panel_dsi: panel-dsi@0 {
|
||||
compatible = "raydium,rm68200";
|
||||
reg = <0>;
|
||||
reset-gpios = <&gpiof 15 GPIO_ACTIVE_LOW>;
|
||||
backlight = <&panel_backlight>;
|
||||
power-supply = <&v3v3>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
dsi_panel_in: endpoint {
|
||||
remote-endpoint = <&dsi_out>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c2 {
|
||||
gt9147: goodix_ts@5d {
|
||||
compatible = "goodix,gt9147";
|
||||
reg = <0x5d>;
|
||||
panel = <&panel_dsi>;
|
||||
pinctrl-0 = <&goodix_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
|
||||
interrupts = <14 IRQ_TYPE_EDGE_RISING>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
};
|
||||
};
|
||||
|
||||
&m_can1 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&m_can1_pins_a>;
|
||||
pinctrl-1 = <&m_can1_sleep_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
@ -4,9 +4,3 @@
|
||||
*/
|
||||
|
||||
#include "stm32mp157a-dk1-u-boot.dtsi"
|
||||
|
||||
&i2c1 {
|
||||
hdmi-transmitter@39 {
|
||||
reset-gpios = <&gpioa 10 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -6,18 +6,55 @@
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157a-dk1.dts"
|
||||
#include "stm32mp157.dtsi"
|
||||
#include "stm32mp15xc.dtsi"
|
||||
#include "stm32mp15-pinctrl.dtsi"
|
||||
#include "stm32mp15xxac-pinctrl.dtsi"
|
||||
#include "stm32mp15xx-dkx.dtsi"
|
||||
#include <dt-bindings/rtc/rtc-stm32.h>
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157C-DK2 Discovery Board";
|
||||
compatible = "st,stm32mp157c-dk2", "st,stm32mp157";
|
||||
|
||||
aliases {
|
||||
ethernet0 = ðernet0;
|
||||
serial0 = &uart4;
|
||||
serial1 = &usart3;
|
||||
serial2 = &uart7;
|
||||
serial3 = &usart2;
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
wifi_pwrseq: wifi-pwrseq {
|
||||
compatible = "mmc-pwrseq-simple";
|
||||
reset-gpios = <&gpioh 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
&cryp1 {
|
||||
status="okay";
|
||||
};
|
||||
|
||||
&dsi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
phy-dsi-supply = <®18>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
@ -38,7 +75,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
panel@0 {
|
||||
panel_otm8009a: panel-otm8009a@0 {
|
||||
compatible = "orisetech,otm8009a";
|
||||
reg = <0>;
|
||||
reset-gpios = <&gpioe 4 GPIO_ACTIVE_LOW>;
|
||||
@ -53,6 +90,31 @@
|
||||
};
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
touchscreen@2a {
|
||||
compatible = "focaltech,ft6236";
|
||||
reg = <0x2a>;
|
||||
interrupts = <2 2>;
|
||||
interrupt-parent = <&gpiof>;
|
||||
interrupt-controller;
|
||||
touchscreen-size-x = <480>;
|
||||
touchscreen-size-y = <800>;
|
||||
panel = <&panel_otm8009a>;
|
||||
status = "okay";
|
||||
};
|
||||
touchscreen@38 {
|
||||
compatible = "focaltech,ft6236";
|
||||
reg = <0x38>;
|
||||
interrupts = <2 2>;
|
||||
interrupt-parent = <&gpiof>;
|
||||
interrupt-controller;
|
||||
touchscreen-size-x = <480>;
|
||||
touchscreen-size-y = <800>;
|
||||
panel = <&panel_otm8009a>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
<dc {
|
||||
status = "okay";
|
||||
|
||||
@ -66,3 +128,57 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&rtc {
|
||||
st,lsco = <RTC_OUT2_RMP>;
|
||||
pinctrl-0 = <&rtc_out2_rmp_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
/* Wifi */
|
||||
&sdmmc2 {
|
||||
arm,primecell-periphid = <0x10153180>;
|
||||
pinctrl-names = "default", "opendrain", "sleep";
|
||||
pinctrl-0 = <&sdmmc2_b4_pins_a>;
|
||||
pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
|
||||
pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
|
||||
non-removable;
|
||||
st,neg-edge;
|
||||
bus-width = <4>;
|
||||
vmmc-supply = <&v3v3>;
|
||||
mmc-pwrseq = <&wifi_pwrseq>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
brcmf: bcrmf@1 {
|
||||
reg = <1>;
|
||||
compatible = "brcm,bcm4329-fmac";
|
||||
};
|
||||
};
|
||||
|
||||
/* Bluetooth */
|
||||
&usart2 {
|
||||
pinctrl-names = "default", "sleep", "idle";
|
||||
pinctrl-0 = <&usart2_pins_a>;
|
||||
pinctrl-1 = <&usart2_sleep_pins_a>;
|
||||
pinctrl-2 = <&usart2_idle_pins_a>;
|
||||
uart-has-rtscts;
|
||||
status = "okay";
|
||||
|
||||
bluetooth {
|
||||
shutdown-gpios = <&gpioz 6 GPIO_ACTIVE_HIGH>;
|
||||
compatible = "brcm,bcm43438-bt";
|
||||
max-speed = <3000000>;
|
||||
vbat-supply = <&v3v3>;
|
||||
vddio-supply = <&v3v3>;
|
||||
};
|
||||
};
|
||||
|
||||
&optee_memory {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&optee {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -3,204 +3,4 @@
|
||||
* Copyright : STMicroelectronics 2018
|
||||
*/
|
||||
|
||||
#include <dt-bindings/clock/stm32mp1-clksrc.h>
|
||||
#include "stm32mp157-u-boot.dtsi"
|
||||
#include "stm32mp15-ddr3-2x4Gb-1066-binG.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
i2c3 = &i2c4;
|
||||
mmc0 = &sdmmc1;
|
||||
mmc1 = &sdmmc2;
|
||||
};
|
||||
|
||||
config {
|
||||
u-boot,boot-led = "heartbeat";
|
||||
u-boot,error-led = "error";
|
||||
st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
|
||||
st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led {
|
||||
red {
|
||||
label = "error";
|
||||
gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
|
||||
default-state = "off";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
blue {
|
||||
default-state = "on";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&clk_hse {
|
||||
st,digbypass;
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&i2c4_pins_a {
|
||||
u-boot,dm-pre-reloc;
|
||||
pins {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
&pmic {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&rcc {
|
||||
st,clksrc = <
|
||||
CLK_MPU_PLL1P
|
||||
CLK_AXI_PLL2P
|
||||
CLK_MCU_PLL3P
|
||||
CLK_PLL12_HSE
|
||||
CLK_PLL3_HSE
|
||||
CLK_PLL4_HSE
|
||||
CLK_RTC_LSE
|
||||
CLK_MCO1_DISABLED
|
||||
CLK_MCO2_DISABLED
|
||||
>;
|
||||
|
||||
st,clkdiv = <
|
||||
1 /*MPU*/
|
||||
0 /*AXI*/
|
||||
0 /*MCU*/
|
||||
1 /*APB1*/
|
||||
1 /*APB2*/
|
||||
1 /*APB3*/
|
||||
1 /*APB4*/
|
||||
2 /*APB5*/
|
||||
23 /*RTC*/
|
||||
0 /*MCO1*/
|
||||
0 /*MCO2*/
|
||||
>;
|
||||
|
||||
st,pkcs = <
|
||||
CLK_CKPER_HSE
|
||||
CLK_FMC_ACLK
|
||||
CLK_QSPI_ACLK
|
||||
CLK_ETH_DISABLED
|
||||
CLK_SDMMC12_PLL4P
|
||||
CLK_DSI_DSIPLL
|
||||
CLK_STGEN_HSE
|
||||
CLK_USBPHY_HSE
|
||||
CLK_SPI2S1_PLL3Q
|
||||
CLK_SPI2S23_PLL3Q
|
||||
CLK_SPI45_HSI
|
||||
CLK_SPI6_HSI
|
||||
CLK_I2C46_HSI
|
||||
CLK_SDMMC3_PLL4P
|
||||
CLK_USBO_USBPHY
|
||||
CLK_ADC_CKPER
|
||||
CLK_CEC_LSE
|
||||
CLK_I2C12_HSI
|
||||
CLK_I2C35_HSI
|
||||
CLK_UART1_HSI
|
||||
CLK_UART24_HSI
|
||||
CLK_UART35_HSI
|
||||
CLK_UART6_HSI
|
||||
CLK_UART78_HSI
|
||||
CLK_SPDIF_PLL4P
|
||||
CLK_FDCAN_PLL4Q
|
||||
CLK_SAI1_PLL3Q
|
||||
CLK_SAI2_PLL3Q
|
||||
CLK_SAI3_PLL3Q
|
||||
CLK_SAI4_PLL3Q
|
||||
CLK_RNG1_LSI
|
||||
CLK_RNG2_LSI
|
||||
CLK_LPTIM1_PCLK1
|
||||
CLK_LPTIM23_PCLK3
|
||||
CLK_LPTIM45_LSE
|
||||
>;
|
||||
|
||||
/* VCO = 1300.0 MHz => P = 650 (CPU) */
|
||||
pll1: st,pll@0 {
|
||||
cfg = < 2 80 0 0 0 PQR(1,0,0) >;
|
||||
frac = < 0x800 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */
|
||||
pll2: st,pll@1 {
|
||||
cfg = < 2 65 1 0 0 PQR(1,1,1) >;
|
||||
frac = < 0x1400 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */
|
||||
pll3: st,pll@2 {
|
||||
cfg = < 1 33 1 16 36 PQR(1,1,1) >;
|
||||
frac = < 0x1a04 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 594.0 MHz => P = 99, Q = 74, R = 74 */
|
||||
pll4: st,pll@3 {
|
||||
cfg = < 3 98 5 7 7 PQR(1,1,1) >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&sdmmc1_b4_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc1_dir_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&sdmmc2_b4_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc2_d47_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&uart4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&uart4_pins_a {
|
||||
u-boot,dm-pre-reloc;
|
||||
pins1 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-pre-reloc;
|
||||
/* pull-up on rx to avoid floating level */
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
#include "stm32mp157a-ed1-u-boot.dtsi"
|
||||
|
||||
@ -1,14 +1,17 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2017 - All Rights Reserved
|
||||
* Author: Ludovic Barre <ludovic.barre@st.com> for STMicroelectronics.
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157c.dtsi"
|
||||
#include "stm32mp157xaa-pinctrl.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/mfd/st,stpmic1.h>
|
||||
#include "stm32mp157.dtsi"
|
||||
#include "stm32mp15xc.dtsi"
|
||||
#include "stm32mp15-pinctrl.dtsi"
|
||||
#include "stm32mp15xxaa-pinctrl.dtsi"
|
||||
#include "stm32mp157-m4-srm.dtsi"
|
||||
#include "stm32mp157-m4-srm-pinctrl.dtsi"
|
||||
#include "stm32mp15xx-edx.dtsi"
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157C eval daughter";
|
||||
@ -18,77 +21,28 @@
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
memory@c0000000 {
|
||||
device_type = "memory";
|
||||
reg = <0xC0000000 0x40000000>;
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
gpu_reserved: gpu@e8000000 {
|
||||
reg = <0xe8000000 0x8000000>;
|
||||
no-map;
|
||||
};
|
||||
};
|
||||
|
||||
aliases {
|
||||
serial0 = &uart4;
|
||||
};
|
||||
|
||||
sd_switch: regulator-sd_switch {
|
||||
compatible = "regulator-gpio";
|
||||
regulator-name = "sd_switch";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
regulator-type = "voltage";
|
||||
regulator-always-on;
|
||||
reserved-memory {
|
||||
gpu_reserved: gpu@f6000000 {
|
||||
reg = <0xf6000000 0x8000000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
gpios = <&gpiof 14 GPIO_ACTIVE_HIGH>;
|
||||
gpios-states = <0>;
|
||||
states = <1800000 0x1 2900000 0x0>;
|
||||
optee_memory: optee@fe000000 {
|
||||
reg = <0xfe000000 0x02000000>;
|
||||
no-map;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&dts {
|
||||
&cpu1{
|
||||
cpu-supply = <&vddcore>;
|
||||
};
|
||||
|
||||
&cryp1 {
|
||||
status="okay";
|
||||
};
|
||||
|
||||
@ -97,242 +51,6 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c4_pins_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
status = "okay";
|
||||
/* spare dmas for other usage */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
|
||||
pmic: stpmic@33 {
|
||||
compatible = "st,stpmic1";
|
||||
reg = <0x33>;
|
||||
interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "okay";
|
||||
|
||||
regulators {
|
||||
compatible = "st,stpmic1-regulators";
|
||||
ldo1-supply = <&v3v3>;
|
||||
ldo2-supply = <&v3v3>;
|
||||
ldo3-supply = <&vdd_ddr>;
|
||||
ldo5-supply = <&v3v3>;
|
||||
ldo6-supply = <&v3v3>;
|
||||
pwr_sw1-supply = <&bst_out>;
|
||||
pwr_sw2-supply = <&bst_out>;
|
||||
|
||||
vddcore: buck1 {
|
||||
regulator-name = "vddcore";
|
||||
regulator-min-microvolt = <800000>;
|
||||
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>;
|
||||
};
|
||||
|
||||
vdda: ldo1 {
|
||||
regulator-name = "vdda";
|
||||
regulator-min-microvolt = <2900000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
interrupts = <IT_CURLIM_LDO1 0>;
|
||||
};
|
||||
|
||||
v2v8: ldo2 {
|
||||
regulator-name = "v2v8";
|
||||
regulator-min-microvolt = <2800000>;
|
||||
regulator-max-microvolt = <2800000>;
|
||||
interrupts = <IT_CURLIM_LDO2 0>;
|
||||
};
|
||||
|
||||
vtt_ddr: ldo3 {
|
||||
regulator-name = "vtt_ddr";
|
||||
regulator-min-microvolt = <500000>;
|
||||
regulator-max-microvolt = <750000>;
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
vdd_usb: ldo4 {
|
||||
regulator-name = "vdd_usb";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
interrupts = <IT_CURLIM_LDO4 0>;
|
||||
};
|
||||
|
||||
vdd_sd: ldo5 {
|
||||
regulator-name = "vdd_sd";
|
||||
regulator-min-microvolt = <2900000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
interrupts = <IT_CURLIM_LDO5 0>;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
v1v8: ldo6 {
|
||||
regulator-name = "v1v8";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
interrupts = <IT_CURLIM_LDO6 0>;
|
||||
};
|
||||
|
||||
vref_ddr: vref_ddr {
|
||||
regulator-name = "vref_ddr";
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
bst_out: boost {
|
||||
regulator-name = "bst_out";
|
||||
interrupts = <IT_OCP_BOOST 0>;
|
||||
};
|
||||
|
||||
vbus_otg: pwr_sw1 {
|
||||
regulator-name = "vbus_otg";
|
||||
interrupts = <IT_OCP_OTG 0>;
|
||||
};
|
||||
|
||||
vbus_sw: pwr_sw2 {
|
||||
regulator-name = "vbus_sw";
|
||||
interrupts = <IT_OCP_SWOUT 0>;
|
||||
regulator-active-discharge;
|
||||
};
|
||||
};
|
||||
|
||||
onkey {
|
||||
compatible = "st,stpmic1-onkey";
|
||||
interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
|
||||
interrupt-names = "onkey-falling", "onkey-rising";
|
||||
power-off-time-sec = <10>;
|
||||
&optee {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
watchdog {
|
||||
compatible = "st,stpmic1-wdt";
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&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>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pwr {
|
||||
pwr-regulators {
|
||||
vdd-supply = <&vdd>;
|
||||
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
||||
};
|
||||
};
|
||||
|
||||
&rng1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rtc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdmmc1 {
|
||||
pinctrl-names = "default", "opendrain", "sleep";
|
||||
pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_a>;
|
||||
pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_dir_pins_a>;
|
||||
pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_a>;
|
||||
broken-cd;
|
||||
st,sig-dir;
|
||||
st,neg-edge;
|
||||
st,use-ckin;
|
||||
bus-width = <4>;
|
||||
vmmc-supply = <&vdd_sd>;
|
||||
vqmmc-supply = <&sd_switch>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&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>;
|
||||
vqmmc-supply = <&v3v3>;
|
||||
mmc-ddr-3_3v;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&timers6 {
|
||||
status = "okay";
|
||||
/* spare dmas for other usage */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
timer@5 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&uart4 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart4_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbotg_hs {
|
||||
vbus-supply = <&vbus_otg>;
|
||||
};
|
||||
|
||||
&usbphyc_port0 {
|
||||
phy-supply = <&vdd_usb>;
|
||||
};
|
||||
|
||||
&usbphyc_port1 {
|
||||
phy-supply = <&vdd_usb>;
|
||||
};
|
||||
|
||||
@ -3,51 +3,4 @@
|
||||
* Copyright : STMicroelectronics 2018
|
||||
*/
|
||||
|
||||
#include "stm32mp157c-ed1-u-boot.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
gpio26 = &stmfx_pinctrl;
|
||||
i2c1 = &i2c2;
|
||||
i2c4 = &i2c5;
|
||||
pinctrl2 = &stmfx_pinctrl;
|
||||
spi0 = &qspi;
|
||||
usb0 = &usbotg_hs;
|
||||
};
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&qspi {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&qspi_clk_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&qspi_bk1_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&qspi_bk2_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
#include "stm32mp157a-ev1-u-boot.dtsi"
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2017 - All Rights Reserved
|
||||
* Author: Ludovic Barre <ludovic.barre@st.com> for STMicroelectronics.
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157c-ed1.dts"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include "stm32mp15xx-evx.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/soc/stm32-hdp.h>
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157C eval daughter on eval mother";
|
||||
@ -18,90 +19,14 @@
|
||||
};
|
||||
|
||||
aliases {
|
||||
serial0 = &uart4;
|
||||
serial1 = &usart3;
|
||||
ethernet0 = ðernet0;
|
||||
};
|
||||
|
||||
clocks {
|
||||
clk_ext_camera: clk-ext-camera {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <24000000>;
|
||||
};
|
||||
};
|
||||
|
||||
joystick {
|
||||
compatible = "gpio-keys";
|
||||
#size-cells = <0>;
|
||||
pinctrl-0 = <&joystick_pins>;
|
||||
pinctrl-names = "default";
|
||||
button-0 {
|
||||
label = "JoySel";
|
||||
linux,code = <KEY_ENTER>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <0 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
button-1 {
|
||||
label = "JoyDown";
|
||||
linux,code = <KEY_DOWN>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <1 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
button-2 {
|
||||
label = "JoyLeft";
|
||||
linux,code = <KEY_LEFT>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <2 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
button-3 {
|
||||
label = "JoyRight";
|
||||
linux,code = <KEY_RIGHT>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <3 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
button-4 {
|
||||
label = "JoyUp";
|
||||
linux,code = <KEY_UP>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <4 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
};
|
||||
|
||||
panel_backlight: panel-backlight {
|
||||
compatible = "gpio-backlight";
|
||||
gpios = <&gpiod 13 GPIO_ACTIVE_LOW>;
|
||||
default-on;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&cec {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&cec_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&dcmi {
|
||||
status = "okay";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&dcmi_pins_a>;
|
||||
pinctrl-1 = <&dcmi_sleep_pins_a>;
|
||||
|
||||
port {
|
||||
dcmi_0: endpoint {
|
||||
remote-endpoint = <&ov5640_0>;
|
||||
bus-width = <8>;
|
||||
hsync-active = <0>;
|
||||
vsync-active = <0>;
|
||||
pclk-sample = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&dsi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
phy-dsi-supply = <®18>;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
@ -123,7 +48,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
panel-dsi@0 {
|
||||
panel_dsi: panel-dsi@0 {
|
||||
compatible = "raydium,rm68200";
|
||||
reg = <0>;
|
||||
reset-gpios = <&gpiof 15 GPIO_ACTIVE_LOW>;
|
||||
@ -139,122 +64,17 @@
|
||||
};
|
||||
};
|
||||
|
||||
ðernet0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <ðernet0_rgmii_pins_a>;
|
||||
pinctrl-1 = <ðernet0_rgmii_pins_sleep_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
phy-mode = "rgmii-id";
|
||||
max-speed = <1000>;
|
||||
phy-handle = <&phy0>;
|
||||
|
||||
mdio0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "snps,dwmac-mdio";
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&fmc {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&fmc_pins_a>;
|
||||
pinctrl-1 = <&fmc_sleep_pins_a>;
|
||||
status = "okay";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
nand@0 {
|
||||
reg = <0>;
|
||||
nand-on-flash-bbt;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c2 {
|
||||
gt9147: goodix_ts@5d {
|
||||
compatible = "goodix,gt9147";
|
||||
reg = <0x5d>;
|
||||
panel = <&panel_dsi>;
|
||||
pinctrl-0 = <&goodix_pins>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c2_pins_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
status = "okay";
|
||||
|
||||
ov5640: camera@3c {
|
||||
compatible = "ovti,ov5640";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&ov5640_pins>;
|
||||
reg = <0x3c>;
|
||||
clocks = <&clk_ext_camera>;
|
||||
clock-names = "xclk";
|
||||
DOVDD-supply = <&v2v8>;
|
||||
powerdown-gpios = <&stmfx_pinctrl 18 GPIO_ACTIVE_HIGH>;
|
||||
reset-gpios = <&stmfx_pinctrl 19 GPIO_ACTIVE_LOW>;
|
||||
rotation = <180>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
ov5640_0: endpoint {
|
||||
remote-endpoint = <&dcmi_0>;
|
||||
bus-width = <8>;
|
||||
data-shift = <2>; /* lines 9:2 are used */
|
||||
hsync-active = <0>;
|
||||
vsync-active = <0>;
|
||||
pclk-sample = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
stmfx: stmfx@42 {
|
||||
compatible = "st,stmfx-0300";
|
||||
reg = <0x42>;
|
||||
interrupts = <8 IRQ_TYPE_EDGE_RISING>;
|
||||
interrupt-parent = <&gpioi>;
|
||||
vdd-supply = <&v3v3>;
|
||||
|
||||
stmfx_pinctrl: stmfx-pin-controller {
|
||||
compatible = "st,stmfx-0300-pinctrl";
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-ranges = <&stmfx_pinctrl 0 0 24>;
|
||||
|
||||
joystick_pins: joystick {
|
||||
pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4";
|
||||
drive-push-pull;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
ov5640_pins: camera {
|
||||
pins = "agpio2", "agpio3"; /* stmfx pins 18 & 19 */
|
||||
drive-push-pull;
|
||||
output-low;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c5 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c5_pins_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
<dc {
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
ltdc_ep0_out: endpoint@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&dsi_in>;
|
||||
};
|
||||
interrupts = <14 IRQ_TYPE_EDGE_RISING>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
};
|
||||
};
|
||||
|
||||
@ -264,97 +84,3 @@
|
||||
pinctrl-1 = <&m_can1_sleep_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qspi {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a &qspi_bk2_pins_a>;
|
||||
pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a &qspi_bk2_sleep_pins_a>;
|
||||
reg = <0x58003000 0x1000>, <0x70000000 0x4000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
flash0: mx66l51235l@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-rx-bus-width = <4>;
|
||||
spi-max-frequency = <108000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
|
||||
flash1: mx66l51235l@1 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <1>;
|
||||
spi-rx-bus-width = <4>;
|
||||
spi-max-frequency = <108000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi1_pins_a>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&timers2 {
|
||||
/* spare dmas for other usage (un-delete to enable pwm capture) */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm2_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
};
|
||||
timer@1 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&timers8 {
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm8_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
};
|
||||
timer@7 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&timers12 {
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm12_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
};
|
||||
timer@11 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&usbh_ehci {
|
||||
phys = <&usbphyc_port0>;
|
||||
phy-names = "usb";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbotg_hs {
|
||||
dr_mode = "peripheral";
|
||||
phys = <&usbphyc_port1 0>;
|
||||
phy-names = "usb2-phy";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbphyc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
6
arch/arm/dts/stm32mp157d-dk1-u-boot.dtsi
Normal file
6
arch/arm/dts/stm32mp157d-dk1-u-boot.dtsi
Normal file
@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright : STMicroelectronics 2019
|
||||
*/
|
||||
|
||||
#include "stm32mp157a-dk1-u-boot.dtsi"
|
||||
44
arch/arm/dts/stm32mp157d-dk1.dts
Normal file
44
arch/arm/dts/stm32mp157d-dk1.dts
Normal file
@ -0,0 +1,44 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157.dtsi"
|
||||
#include "stm32mp15xd.dtsi"
|
||||
#include "stm32mp15-pinctrl.dtsi"
|
||||
#include "stm32mp15xxac-pinctrl.dtsi"
|
||||
#include "stm32mp15xx-dkx.dtsi"
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157D-DK1 Discovery Board";
|
||||
compatible = "st,stm32mp157d-dk1", "st,stm32mp157";
|
||||
|
||||
aliases {
|
||||
ethernet0 = ðernet0;
|
||||
serial0 = &uart4;
|
||||
serial1 = &usart3;
|
||||
serial2 = &uart7;
|
||||
};
|
||||
|
||||
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";
|
||||
};
|
||||
6
arch/arm/dts/stm32mp157d-ed1-u-boot.dtsi
Normal file
6
arch/arm/dts/stm32mp157d-ed1-u-boot.dtsi
Normal file
@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright : STMicroelectronics 2019
|
||||
*/
|
||||
|
||||
#include "stm32mp157a-ed1-u-boot.dtsi"
|
||||
52
arch/arm/dts/stm32mp157d-ed1.dts
Normal file
52
arch/arm/dts/stm32mp157d-ed1.dts
Normal file
@ -0,0 +1,52 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157.dtsi"
|
||||
#include "stm32mp15xd.dtsi"
|
||||
#include "stm32mp15-pinctrl.dtsi"
|
||||
#include "stm32mp15xxaa-pinctrl.dtsi"
|
||||
#include "stm32mp157-m4-srm.dtsi"
|
||||
#include "stm32mp157-m4-srm-pinctrl.dtsi"
|
||||
#include "stm32mp15xx-edx.dtsi"
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157D eval daughter";
|
||||
compatible = "st,stm32mp157d-ed1", "st,stm32mp157";
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
aliases {
|
||||
serial0 = &uart4;
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
gpu_reserved: gpu@f6000000 {
|
||||
reg = <0xf6000000 0x8000000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
optee_memory: optee@fe000000 {
|
||||
reg = <0xfe000000 0x02000000>;
|
||||
no-map;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&cpu1{
|
||||
cpu-supply = <&vddcore>;
|
||||
};
|
||||
|
||||
&gpu {
|
||||
contiguous-area = <&gpu_reserved>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&optee {
|
||||
status = "okay";
|
||||
};
|
||||
6
arch/arm/dts/stm32mp157d-ev1-u-boot.dtsi
Normal file
6
arch/arm/dts/stm32mp157d-ev1-u-boot.dtsi
Normal file
@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright : STMicroelectronics 2019
|
||||
*/
|
||||
|
||||
#include "stm32mp157a-ev1-u-boot.dtsi"
|
||||
86
arch/arm/dts/stm32mp157d-ev1.dts
Normal file
86
arch/arm/dts/stm32mp157d-ev1.dts
Normal file
@ -0,0 +1,86 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157d-ed1.dts"
|
||||
#include "stm32mp15xx-evx.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/soc/stm32-hdp.h>
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157D eval daughter on eval mother";
|
||||
compatible = "st,stm32mp157d-ev1", "st,stm32mp157d-ed1", "st,stm32mp157";
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
aliases {
|
||||
serial1 = &usart3;
|
||||
ethernet0 = ðernet0;
|
||||
};
|
||||
};
|
||||
|
||||
&dsi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
dsi_in: endpoint {
|
||||
remote-endpoint = <<dc_ep0_out>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
dsi_out: endpoint {
|
||||
remote-endpoint = <&dsi_panel_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
panel_dsi: panel-dsi@0 {
|
||||
compatible = "raydium,rm68200";
|
||||
reg = <0>;
|
||||
reset-gpios = <&gpiof 15 GPIO_ACTIVE_LOW>;
|
||||
backlight = <&panel_backlight>;
|
||||
power-supply = <&v3v3>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
dsi_panel_in: endpoint {
|
||||
remote-endpoint = <&dsi_out>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c2 {
|
||||
gt9147: goodix_ts@5d {
|
||||
compatible = "goodix,gt9147";
|
||||
reg = <0x5d>;
|
||||
panel = <&panel_dsi>;
|
||||
pinctrl-0 = <&goodix_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
|
||||
interrupts = <14 IRQ_TYPE_EDGE_RISING>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
};
|
||||
};
|
||||
|
||||
&m_can1 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&m_can1_pins_a>;
|
||||
pinctrl-1 = <&m_can1_sleep_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
6
arch/arm/dts/stm32mp157f-dk2-u-boot.dtsi
Normal file
6
arch/arm/dts/stm32mp157f-dk2-u-boot.dtsi
Normal file
@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright : STMicroelectronics 2019
|
||||
*/
|
||||
|
||||
#include "stm32mp157c-dk2-u-boot.dtsi"
|
||||
185
arch/arm/dts/stm32mp157f-dk2.dts
Normal file
185
arch/arm/dts/stm32mp157f-dk2.dts
Normal file
@ -0,0 +1,185 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157.dtsi"
|
||||
#include "stm32mp15xf.dtsi"
|
||||
#include "stm32mp15-pinctrl.dtsi"
|
||||
#include "stm32mp15xxac-pinctrl.dtsi"
|
||||
#include "stm32mp15xx-dkx.dtsi"
|
||||
#include <dt-bindings/rtc/rtc-stm32.h>
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157F-DK2 Discovery Board";
|
||||
compatible = "st,stm32mp157f-dk2", "st,stm32mp157";
|
||||
|
||||
aliases {
|
||||
ethernet0 = ðernet0;
|
||||
serial0 = &uart4;
|
||||
serial1 = &usart3;
|
||||
serial2 = &uart7;
|
||||
serial3 = &usart2;
|
||||
};
|
||||
|
||||
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;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
wifi_pwrseq: wifi-pwrseq {
|
||||
compatible = "mmc-pwrseq-simple";
|
||||
reset-gpios = <&gpioh 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
&cryp1 {
|
||||
status="okay";
|
||||
};
|
||||
|
||||
&dsi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
dsi_in: endpoint {
|
||||
remote-endpoint = <<dc_ep1_out>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
dsi_out: endpoint {
|
||||
remote-endpoint = <&panel_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
panel_otm8009a: panel-otm8009a@0 {
|
||||
compatible = "orisetech,otm8009a";
|
||||
reg = <0>;
|
||||
reset-gpios = <&gpioe 4 GPIO_ACTIVE_LOW>;
|
||||
power-supply = <&v3v3>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
panel_in: endpoint {
|
||||
remote-endpoint = <&dsi_out>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
touchscreen@2a {
|
||||
compatible = "focaltech,ft6236";
|
||||
reg = <0x2a>;
|
||||
interrupts = <2 2>;
|
||||
interrupt-parent = <&gpiof>;
|
||||
interrupt-controller;
|
||||
touchscreen-size-x = <480>;
|
||||
touchscreen-size-y = <800>;
|
||||
panel = <&panel_otm8009a>;
|
||||
status = "okay";
|
||||
};
|
||||
touchscreen@38 {
|
||||
compatible = "focaltech,ft6236";
|
||||
reg = <0x38>;
|
||||
interrupts = <2 2>;
|
||||
interrupt-parent = <&gpiof>;
|
||||
interrupt-controller;
|
||||
touchscreen-size-x = <480>;
|
||||
touchscreen-size-y = <800>;
|
||||
panel = <&panel_otm8009a>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
<dc {
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
ltdc_ep1_out: endpoint@1 {
|
||||
reg = <1>;
|
||||
remote-endpoint = <&dsi_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&rtc {
|
||||
st,lsco = <RTC_OUT2_RMP>;
|
||||
pinctrl-0 = <&rtc_out2_rmp_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
/* Wifi */
|
||||
&sdmmc2 {
|
||||
arm,primecell-periphid = <0x10153180>;
|
||||
pinctrl-names = "default", "opendrain", "sleep";
|
||||
pinctrl-0 = <&sdmmc2_b4_pins_a>;
|
||||
pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
|
||||
pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
|
||||
non-removable;
|
||||
st,neg-edge;
|
||||
bus-width = <4>;
|
||||
vmmc-supply = <&v3v3>;
|
||||
mmc-pwrseq = <&wifi_pwrseq>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
brcmf: bcrmf@1 {
|
||||
reg = <1>;
|
||||
compatible = "brcm,bcm4329-fmac";
|
||||
};
|
||||
};
|
||||
|
||||
/* Bluetooth */
|
||||
&usart2 {
|
||||
pinctrl-names = "default", "sleep", "idle";
|
||||
pinctrl-0 = <&usart2_pins_a>;
|
||||
pinctrl-1 = <&usart2_sleep_pins_a>;
|
||||
pinctrl-2 = <&usart2_idle_pins_a>;
|
||||
uart-has-rtscts;
|
||||
status = "okay";
|
||||
|
||||
bluetooth {
|
||||
shutdown-gpios = <&gpioz 6 GPIO_ACTIVE_HIGH>;
|
||||
compatible = "brcm,bcm43438-bt";
|
||||
max-speed = <3000000>;
|
||||
vbat-supply = <&v3v3>;
|
||||
vddio-supply = <&v3v3>;
|
||||
};
|
||||
};
|
||||
|
||||
&optee_memory {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&optee {
|
||||
status = "okay";
|
||||
};
|
||||
6
arch/arm/dts/stm32mp157f-ed1-u-boot.dtsi
Normal file
6
arch/arm/dts/stm32mp157f-ed1-u-boot.dtsi
Normal file
@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright : STMicroelectronics 2019
|
||||
*/
|
||||
|
||||
#include "stm32mp157c-ed1-u-boot.dtsi"
|
||||
56
arch/arm/dts/stm32mp157f-ed1.dts
Normal file
56
arch/arm/dts/stm32mp157f-ed1.dts
Normal file
@ -0,0 +1,56 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157.dtsi"
|
||||
#include "stm32mp15xf.dtsi"
|
||||
#include "stm32mp15-pinctrl.dtsi"
|
||||
#include "stm32mp15xxaa-pinctrl.dtsi"
|
||||
#include "stm32mp157-m4-srm.dtsi"
|
||||
#include "stm32mp157-m4-srm-pinctrl.dtsi"
|
||||
#include "stm32mp15xx-edx.dtsi"
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157F eval daughter";
|
||||
compatible = "st,stm32mp157f-ed1", "st,stm32mp157";
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
aliases {
|
||||
serial0 = &uart4;
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
gpu_reserved: gpu@f6000000 {
|
||||
reg = <0xf6000000 0x8000000>;
|
||||
no-map;
|
||||
};
|
||||
|
||||
optee_memory: optee@0xfe000000 {
|
||||
reg = <0xfe000000 0x02000000>;
|
||||
no-map;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&cpu1{
|
||||
cpu-supply = <&vddcore>;
|
||||
};
|
||||
|
||||
&cryp1 {
|
||||
status="okay";
|
||||
};
|
||||
|
||||
&gpu {
|
||||
contiguous-area = <&gpu_reserved>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&optee {
|
||||
status = "okay";
|
||||
};
|
||||
6
arch/arm/dts/stm32mp157f-ev1-u-boot.dtsi
Normal file
6
arch/arm/dts/stm32mp157f-ev1-u-boot.dtsi
Normal file
@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright : STMicroelectronics 2019
|
||||
*/
|
||||
|
||||
#include "stm32mp157c-ev1-u-boot.dtsi"
|
||||
86
arch/arm/dts/stm32mp157f-ev1.dts
Normal file
86
arch/arm/dts/stm32mp157f-ev1.dts
Normal file
@ -0,0 +1,86 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157f-ed1.dts"
|
||||
#include "stm32mp15xx-evx.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/soc/stm32-hdp.h>
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP157F eval daughter on eval mother";
|
||||
compatible = "st,stm32mp157f-ev1", "st,stm32mp157f-ed1", "st,stm32mp157";
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
aliases {
|
||||
serial1 = &usart3;
|
||||
ethernet0 = ðernet0;
|
||||
};
|
||||
};
|
||||
|
||||
&dsi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
dsi_in: endpoint {
|
||||
remote-endpoint = <<dc_ep0_out>;
|
||||
};
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
dsi_out: endpoint {
|
||||
remote-endpoint = <&dsi_panel_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
panel_dsi: panel-dsi@0 {
|
||||
compatible = "raydium,rm68200";
|
||||
reg = <0>;
|
||||
reset-gpios = <&gpiof 15 GPIO_ACTIVE_LOW>;
|
||||
backlight = <&panel_backlight>;
|
||||
power-supply = <&v3v3>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
dsi_panel_in: endpoint {
|
||||
remote-endpoint = <&dsi_out>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c2 {
|
||||
gt9147: goodix_ts@5d {
|
||||
compatible = "goodix,gt9147";
|
||||
reg = <0x5d>;
|
||||
panel = <&panel_dsi>;
|
||||
pinctrl-0 = <&goodix_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
|
||||
interrupts = <14 IRQ_TYPE_EDGE_RISING>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
};
|
||||
};
|
||||
|
||||
&m_can1 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&m_can1_pins_a>;
|
||||
pinctrl-1 = <&m_can1_sleep_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
@ -1,90 +0,0 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>
|
||||
*/
|
||||
|
||||
#include "stm32mp157-pinctrl.dtsi"
|
||||
/ {
|
||||
soc {
|
||||
pinctrl: pin-controller@50002000 {
|
||||
st,package = <STM32MP_PKG_AA>;
|
||||
|
||||
gpioa: gpio@50002000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 0 16>;
|
||||
};
|
||||
|
||||
gpiob: gpio@50003000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 16 16>;
|
||||
};
|
||||
|
||||
gpioc: gpio@50004000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 32 16>;
|
||||
};
|
||||
|
||||
gpiod: gpio@50005000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 48 16>;
|
||||
};
|
||||
|
||||
gpioe: gpio@50006000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 64 16>;
|
||||
};
|
||||
|
||||
gpiof: gpio@50007000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 80 16>;
|
||||
};
|
||||
|
||||
gpiog: gpio@50008000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 96 16>;
|
||||
};
|
||||
|
||||
gpioh: gpio@50009000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 112 16>;
|
||||
};
|
||||
|
||||
gpioi: gpio@5000a000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 128 16>;
|
||||
};
|
||||
|
||||
gpioj: gpio@5000b000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 144 16>;
|
||||
};
|
||||
|
||||
gpiok: gpio@5000c000 {
|
||||
status = "okay";
|
||||
ngpios = <8>;
|
||||
gpio-ranges = <&pinctrl 0 160 8>;
|
||||
};
|
||||
};
|
||||
|
||||
pinctrl_z: pin-controller-z@54004000 {
|
||||
st,package = <STM32MP_PKG_AA>;
|
||||
|
||||
gpioz: gpio@54004000 {
|
||||
status = "okay";
|
||||
ngpios = <8>;
|
||||
gpio-ranges = <&pinctrl_z 0 400 8>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -1,62 +0,0 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>
|
||||
*/
|
||||
|
||||
#include "stm32mp157-pinctrl.dtsi"
|
||||
/ {
|
||||
soc {
|
||||
pinctrl: pin-controller@50002000 {
|
||||
st,package = <STM32MP_PKG_AB>;
|
||||
|
||||
gpioa: gpio@50002000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 0 16>;
|
||||
};
|
||||
|
||||
gpiob: gpio@50003000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 16 16>;
|
||||
};
|
||||
|
||||
gpioc: gpio@50004000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 32 16>;
|
||||
};
|
||||
|
||||
gpiod: gpio@50005000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 48 16>;
|
||||
};
|
||||
|
||||
gpioe: gpio@50006000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 64 16>;
|
||||
};
|
||||
|
||||
gpiof: gpio@50007000 {
|
||||
status = "okay";
|
||||
ngpios = <6>;
|
||||
gpio-ranges = <&pinctrl 6 86 6>;
|
||||
};
|
||||
|
||||
gpiog: gpio@50008000 {
|
||||
status = "okay";
|
||||
ngpios = <10>;
|
||||
gpio-ranges = <&pinctrl 6 102 10>;
|
||||
};
|
||||
|
||||
gpioh: gpio@50009000 {
|
||||
status = "okay";
|
||||
ngpios = <2>;
|
||||
gpio-ranges = <&pinctrl 0 112 2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -1,78 +0,0 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>
|
||||
*/
|
||||
|
||||
#include "stm32mp157-pinctrl.dtsi"
|
||||
/ {
|
||||
soc {
|
||||
pinctrl: pin-controller@50002000 {
|
||||
st,package = <STM32MP_PKG_AC>;
|
||||
|
||||
gpioa: gpio@50002000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 0 16>;
|
||||
};
|
||||
|
||||
gpiob: gpio@50003000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 16 16>;
|
||||
};
|
||||
|
||||
gpioc: gpio@50004000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 32 16>;
|
||||
};
|
||||
|
||||
gpiod: gpio@50005000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 48 16>;
|
||||
};
|
||||
|
||||
gpioe: gpio@50006000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 64 16>;
|
||||
};
|
||||
|
||||
gpiof: gpio@50007000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 80 16>;
|
||||
};
|
||||
|
||||
gpiog: gpio@50008000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 96 16>;
|
||||
};
|
||||
|
||||
gpioh: gpio@50009000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 112 16>;
|
||||
};
|
||||
|
||||
gpioi: gpio@5000a000 {
|
||||
status = "okay";
|
||||
ngpios = <12>;
|
||||
gpio-ranges = <&pinctrl 0 128 12>;
|
||||
};
|
||||
};
|
||||
|
||||
pinctrl_z: pin-controller-z@54004000 {
|
||||
st,package = <STM32MP_PKG_AC>;
|
||||
|
||||
gpioz: gpio@54004000 {
|
||||
status = "okay";
|
||||
ngpios = <8>;
|
||||
gpio-ranges = <&pinctrl_z 0 400 8>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -1,62 +0,0 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>
|
||||
*/
|
||||
|
||||
#include "stm32mp157-pinctrl.dtsi"
|
||||
/ {
|
||||
soc {
|
||||
pinctrl: pin-controller@50002000 {
|
||||
st,package = <STM32MP_PKG_AD>;
|
||||
|
||||
gpioa: gpio@50002000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 0 16>;
|
||||
};
|
||||
|
||||
gpiob: gpio@50003000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 16 16>;
|
||||
};
|
||||
|
||||
gpioc: gpio@50004000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 32 16>;
|
||||
};
|
||||
|
||||
gpiod: gpio@50005000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 48 16>;
|
||||
};
|
||||
|
||||
gpioe: gpio@50006000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 64 16>;
|
||||
};
|
||||
|
||||
gpiof: gpio@50007000 {
|
||||
status = "okay";
|
||||
ngpios = <6>;
|
||||
gpio-ranges = <&pinctrl 6 86 6>;
|
||||
};
|
||||
|
||||
gpiog: gpio@50008000 {
|
||||
status = "okay";
|
||||
ngpios = <10>;
|
||||
gpio-ranges = <&pinctrl 6 102 10>;
|
||||
};
|
||||
|
||||
gpioh: gpio@50009000 {
|
||||
status = "okay";
|
||||
ngpios = <2>;
|
||||
gpio-ranges = <&pinctrl 0 112 2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
13
arch/arm/dts/stm32mp15xa.dtsi
Normal file
13
arch/arm/dts/stm32mp15xa.dtsi
Normal file
@ -0,0 +1,13 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
&cpu0_opp_table {
|
||||
opp-650000000 {
|
||||
opp-hz = /bits/ 64 <650000000>;
|
||||
opp-microvolt = <1200000>;
|
||||
opp-supported-hw = <0x1>;
|
||||
};
|
||||
};
|
||||
20
arch/arm/dts/stm32mp15xc.dtsi
Normal file
20
arch/arm/dts/stm32mp15xc.dtsi
Normal file
@ -0,0 +1,20 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
#include "stm32mp15xa.dtsi"
|
||||
|
||||
/ {
|
||||
soc {
|
||||
cryp1: cryp@54001000 {
|
||||
compatible = "st,stm32mp1-cryp";
|
||||
reg = <0x54001000 0x400>;
|
||||
interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&scmi0_clk CK_SCMI0_CRYP1>;
|
||||
resets = <&scmi0_reset RST_SCMI0_CRYP1>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
42
arch/arm/dts/stm32mp15xd.dtsi
Normal file
42
arch/arm/dts/stm32mp15xd.dtsi
Normal file
@ -0,0 +1,42 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
&cpu0_opp_table {
|
||||
opp-800000000 {
|
||||
opp-hz = /bits/ 64 <800000000>;
|
||||
opp-microvolt = <1350000>;
|
||||
opp-supported-hw = <0x2>;
|
||||
};
|
||||
opp-400000000 {
|
||||
opp-hz = /bits/ 64 <400000000>;
|
||||
opp-microvolt = <1200000>;
|
||||
opp-supported-hw = <0x2>;
|
||||
opp-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
&cpu_thermal {
|
||||
trips {
|
||||
cpu-crit {
|
||||
temperature = <105000>;
|
||||
hysteresis = <0>;
|
||||
type = "critical";
|
||||
};
|
||||
|
||||
cpu_alert: cpu-alert {
|
||||
temperature = <950000>;
|
||||
hysteresis = <10000>;
|
||||
type = "passive";
|
||||
};
|
||||
};
|
||||
|
||||
cooling-maps {
|
||||
map0 {
|
||||
trip = <&cpu_alert>;
|
||||
cooling-device = <&cpu0 1 1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
20
arch/arm/dts/stm32mp15xf.dtsi
Normal file
20
arch/arm/dts/stm32mp15xf.dtsi
Normal file
@ -0,0 +1,20 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
#include "stm32mp15xd.dtsi"
|
||||
|
||||
/ {
|
||||
soc {
|
||||
cryp1: cryp@54001000 {
|
||||
compatible = "st,stm32mp1-cryp";
|
||||
reg = <0x54001000 0x400>;
|
||||
interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&scmi0_clk CK_SCMI0_CRYP1>;
|
||||
resets = <&scmi0_reset RST_SCMI0_CRYP1>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
6
arch/arm/dts/stm32mp15xx-dhcom-pdk2-u-boot.dtsi
Normal file
6
arch/arm/dts/stm32mp15xx-dhcom-pdk2-u-boot.dtsi
Normal file
@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2019 Marek Vasut <marex@denx.de>
|
||||
*/
|
||||
|
||||
#include "stm32mp15xx-dhcom-u-boot.dtsi"
|
||||
88
arch/arm/dts/stm32mp15xx-dhcom-pdk2.dts
Normal file
88
arch/arm/dts/stm32mp15xx-dhcom-pdk2.dts
Normal file
@ -0,0 +1,88 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2019 Marek Vasut <marex@denx.de>
|
||||
*/
|
||||
|
||||
#include "stm32mp15xx-dhcom.dtsi"
|
||||
|
||||
/ {
|
||||
model = "STMicroelectronics STM32MP15xx DHCOM Premium Developer Kit (2)";
|
||||
compatible = "dh,stm32mp15xx-dhcom-pdk2", "st,stm32mp15x";
|
||||
|
||||
aliases {
|
||||
serial0 = &uart4;
|
||||
ethernet0 = ðernet0;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
ethernet_vio: vioregulator {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vio";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
gpio = <&gpiog 3 GPIO_ACTIVE_LOW>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
};
|
||||
};
|
||||
|
||||
ðernet0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <ðernet0_rmii_pins_a>;
|
||||
pinctrl-1 = <ðernet0_rmii_pins_sleep_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
phy-mode = "rmii";
|
||||
max-speed = <100>;
|
||||
phy-handle = <&phy0>;
|
||||
st,eth_ref_clk_sel;
|
||||
phy-reset-gpios = <&gpioh 15 GPIO_ACTIVE_LOW>;
|
||||
|
||||
mdio0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "snps,dwmac-mdio";
|
||||
|
||||
phy0: ethernet-phy@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
ethernet0_rmii_pins_a: rmii-0 {
|
||||
pins1 {
|
||||
pinmux = <STM32_PINMUX('G', 13, AF11)>, /* ETH1_RMII_TXD0 */
|
||||
<STM32_PINMUX('G', 14, AF11)>, /* ETH1_RMII_TXD1 */
|
||||
<STM32_PINMUX('B', 11, AF11)>, /* ETH1_RMII_TX_EN */
|
||||
<STM32_PINMUX('A', 1, AF0)>, /* ETH1_RMII_REF_CLK */
|
||||
<STM32_PINMUX('A', 2, AF11)>, /* ETH1_MDIO */
|
||||
<STM32_PINMUX('C', 1, AF11)>; /* ETH1_MDC */
|
||||
bias-disable;
|
||||
drive-push-pull;
|
||||
slew-rate = <2>;
|
||||
};
|
||||
pins2 {
|
||||
pinmux = <STM32_PINMUX('C', 4, AF11)>, /* ETH1_RMII_RXD0 */
|
||||
<STM32_PINMUX('C', 5, AF11)>, /* ETH1_RMII_RXD1 */
|
||||
<STM32_PINMUX('A', 7, AF11)>; /* ETH1_RMII_CRS_DV */
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
ethernet0_rmii_pins_sleep_a: rmii-sleep-0 {
|
||||
pins1 {
|
||||
pinmux = <STM32_PINMUX('G', 13, ANALOG)>, /* ETH1_RMII_TXD0 */
|
||||
<STM32_PINMUX('G', 14, ANALOG)>, /* ETH1_RMII_TXD1 */
|
||||
<STM32_PINMUX('B', 11, ANALOG)>, /* ETH1_RMII_TX_EN */
|
||||
<STM32_PINMUX('A', 2, ANALOG)>, /* ETH1_MDIO */
|
||||
<STM32_PINMUX('C', 1, ANALOG)>, /* ETH1_MDC */
|
||||
<STM32_PINMUX('C', 4, ANALOG)>, /* ETH1_RMII_RXD0 */
|
||||
<STM32_PINMUX('C', 5, ANALOG)>, /* ETH1_RMII_RXD1 */
|
||||
<STM32_PINMUX('A', 1, ANALOG)>, /* ETH1_RMII_REF_CLK */
|
||||
<STM32_PINMUX('A', 7, ANALOG)>; /* ETH1_RMII_CRS_DV */
|
||||
};
|
||||
};
|
||||
};
|
||||
249
arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi
Normal file
249
arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi
Normal file
@ -0,0 +1,249 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2019 Marek Vasut <marex@denx.de>
|
||||
*/
|
||||
|
||||
#include <dt-bindings/clock/stm32mp1-clksrc.h>
|
||||
#include "stm32mp15-u-boot.dtsi"
|
||||
#include "stm32mp15-ddr3-2x4Gb-1066-binG.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
i2c1 = &i2c2;
|
||||
i2c3 = &i2c4;
|
||||
i2c4 = &i2c5;
|
||||
mmc0 = &sdmmc1;
|
||||
mmc1 = &sdmmc2;
|
||||
spi0 = &qspi;
|
||||
usb0 = &usbotg_hs;
|
||||
};
|
||||
|
||||
config {
|
||||
u-boot,boot-led = "heartbeat";
|
||||
u-boot,error-led = "error";
|
||||
st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
|
||||
st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led {
|
||||
red {
|
||||
label = "error";
|
||||
gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
|
||||
default-state = "off";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
blue {
|
||||
default-state = "on";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&i2c4_pins_a {
|
||||
u-boot,dm-pre-reloc;
|
||||
pins {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
&pmic {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&qspi {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&qspi_clk_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&qspi_bk1_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&qspi_bk2_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&rcc {
|
||||
st,clksrc = <
|
||||
CLK_MPU_PLL1P
|
||||
CLK_AXI_PLL2P
|
||||
CLK_MCU_PLL3P
|
||||
CLK_PLL12_HSE
|
||||
CLK_PLL3_HSE
|
||||
CLK_PLL4_HSE
|
||||
CLK_RTC_LSE
|
||||
CLK_MCO1_DISABLED
|
||||
CLK_MCO2_DISABLED
|
||||
>;
|
||||
|
||||
st,clkdiv = <
|
||||
1 /*MPU*/
|
||||
0 /*AXI*/
|
||||
0 /*MCU*/
|
||||
1 /*APB1*/
|
||||
1 /*APB2*/
|
||||
1 /*APB3*/
|
||||
1 /*APB4*/
|
||||
2 /*APB5*/
|
||||
23 /*RTC*/
|
||||
0 /*MCO1*/
|
||||
0 /*MCO2*/
|
||||
>;
|
||||
|
||||
st,pkcs = <
|
||||
CLK_CKPER_HSE
|
||||
CLK_FMC_ACLK
|
||||
CLK_QSPI_ACLK
|
||||
CLK_ETH_PLL4P
|
||||
CLK_SDMMC12_PLL4P
|
||||
CLK_DSI_DSIPLL
|
||||
CLK_STGEN_HSE
|
||||
CLK_USBPHY_HSE
|
||||
CLK_SPI2S1_PLL3Q
|
||||
CLK_SPI2S23_PLL3Q
|
||||
CLK_SPI45_HSI
|
||||
CLK_SPI6_HSI
|
||||
CLK_I2C46_HSI
|
||||
CLK_SDMMC3_PLL4P
|
||||
CLK_USBO_USBPHY
|
||||
CLK_ADC_CKPER
|
||||
CLK_CEC_LSE
|
||||
CLK_I2C12_HSI
|
||||
CLK_I2C35_HSI
|
||||
CLK_UART1_HSI
|
||||
CLK_UART24_HSI
|
||||
CLK_UART35_HSI
|
||||
CLK_UART6_HSI
|
||||
CLK_UART78_HSI
|
||||
CLK_SPDIF_PLL4P
|
||||
CLK_FDCAN_PLL4R
|
||||
CLK_SAI1_PLL3Q
|
||||
CLK_SAI2_PLL3Q
|
||||
CLK_SAI3_PLL3Q
|
||||
CLK_SAI4_PLL3Q
|
||||
CLK_RNG1_LSI
|
||||
CLK_RNG2_LSI
|
||||
CLK_LPTIM1_PCLK1
|
||||
CLK_LPTIM23_PCLK3
|
||||
CLK_LPTIM45_LSE
|
||||
>;
|
||||
|
||||
/* VCO = 1300.0 MHz => P = 650 (CPU) */
|
||||
pll1: st,pll@0 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <0>;
|
||||
cfg = < 2 80 0 0 0 PQR(1,0,0) >;
|
||||
frac = < 0x800 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */
|
||||
pll2: st,pll@1 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <1>;
|
||||
cfg = < 2 65 1 0 0 PQR(1,1,1) >;
|
||||
frac = < 0x1400 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */
|
||||
pll3: st,pll@2 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <2>;
|
||||
cfg = < 1 33 1 16 36 PQR(1,1,1) >;
|
||||
frac = < 0x1a04 >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
/* VCO = 600.0 MHz => P = 50, Q = 50, R = 50 */
|
||||
pll4: st,pll@3 {
|
||||
compatible = "st,stm32mp1-pll";
|
||||
reg = <3>;
|
||||
cfg = < 1 49 11 11 11 PQR(1,1,1) >;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&sdmmc1_b4_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc1_dir_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins1 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc2 {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
|
||||
&sdmmc2_b4_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc2_d47_pins_a {
|
||||
u-boot,dm-spl;
|
||||
pins {
|
||||
u-boot,dm-spl;
|
||||
};
|
||||
};
|
||||
|
||||
&uart4 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&uart4_pins_a {
|
||||
u-boot,dm-pre-reloc;
|
||||
pins1 {
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
pins2 {
|
||||
u-boot,dm-pre-reloc;
|
||||
/* pull-up on rx to avoid floating level */
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
379
arch/arm/dts/stm32mp15xx-dhcom.dtsi
Normal file
379
arch/arm/dts/stm32mp15xx-dhcom.dtsi
Normal file
@ -0,0 +1,379 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) 2019 Marek Vasut <marex@denx.de>
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "stm32mp157.dtsi"
|
||||
#include "stm32mp15xc.dtsi"
|
||||
#include "stm32mp15-pinctrl.dtsi"
|
||||
#include "stm32mp15xxaa-pinctrl.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/mfd/st,stpmic1.h>
|
||||
|
||||
/ {
|
||||
memory@c0000000 {
|
||||
device_type = "memory";
|
||||
reg = <0xC0000000 0x40000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&cec {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&cec_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&dcmi {
|
||||
status = "okay";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&dcmi_pins_a>;
|
||||
pinctrl-1 = <&dcmi_sleep_pins_a>;
|
||||
};
|
||||
|
||||
&dts {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c2_pins_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c4_pins_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
status = "okay";
|
||||
/* spare dmas for other usage */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
|
||||
pmic: stpmic@33 {
|
||||
compatible = "st,stpmic1";
|
||||
reg = <0x33>;
|
||||
interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "okay";
|
||||
|
||||
regulators {
|
||||
compatible = "st,stpmic1-regulators";
|
||||
ldo1-supply = <&v3v3>;
|
||||
ldo2-supply = <&v3v3>;
|
||||
ldo3-supply = <&vdd_ddr>;
|
||||
ldo5-supply = <&v3v3>;
|
||||
ldo6-supply = <&v3v3>;
|
||||
pwr_sw1-supply = <&bst_out>;
|
||||
pwr_sw2-supply = <&bst_out>;
|
||||
|
||||
vddcore: buck1 {
|
||||
regulator-name = "vddcore";
|
||||
regulator-min-microvolt = <800000>;
|
||||
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>;
|
||||
};
|
||||
|
||||
vdda: ldo1 {
|
||||
regulator-name = "vdda";
|
||||
regulator-min-microvolt = <2900000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
interrupts = <IT_CURLIM_LDO1 0>;
|
||||
};
|
||||
|
||||
v2v8: ldo2 {
|
||||
regulator-name = "v2v8";
|
||||
regulator-min-microvolt = <2800000>;
|
||||
regulator-max-microvolt = <2800000>;
|
||||
interrupts = <IT_CURLIM_LDO2 0>;
|
||||
};
|
||||
|
||||
vtt_ddr: ldo3 {
|
||||
regulator-name = "vtt_ddr";
|
||||
regulator-min-microvolt = <500000>;
|
||||
regulator-max-microvolt = <750000>;
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
vdd_usb: ldo4 {
|
||||
regulator-name = "vdd_usb";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
interrupts = <IT_CURLIM_LDO4 0>;
|
||||
};
|
||||
|
||||
vdd_sd: ldo5 {
|
||||
regulator-name = "vdd_sd";
|
||||
regulator-min-microvolt = <2900000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
interrupts = <IT_CURLIM_LDO5 0>;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
v1v8: ldo6 {
|
||||
regulator-name = "v1v8";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
interrupts = <IT_CURLIM_LDO6 0>;
|
||||
};
|
||||
|
||||
vref_ddr: vref_ddr {
|
||||
regulator-name = "vref_ddr";
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
bst_out: boost {
|
||||
regulator-name = "bst_out";
|
||||
interrupts = <IT_OCP_BOOST 0>;
|
||||
};
|
||||
|
||||
vbus_otg: pwr_sw1 {
|
||||
regulator-name = "vbus_otg";
|
||||
interrupts = <IT_OCP_OTG 0>;
|
||||
};
|
||||
|
||||
vbus_sw: pwr_sw2 {
|
||||
regulator-name = "vbus_sw";
|
||||
interrupts = <IT_OCP_SWOUT 0>;
|
||||
regulator-active-discharge;
|
||||
};
|
||||
};
|
||||
|
||||
onkey {
|
||||
compatible = "st,stpmic1-onkey";
|
||||
interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
|
||||
interrupt-names = "onkey-falling", "onkey-rising";
|
||||
power-off-time-sec = <10>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
watchdog {
|
||||
compatible = "st,stpmic1-wdt";
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
eeprom@50 {
|
||||
compatible = "atmel,24c02";
|
||||
reg = <0x50>;
|
||||
pagesize = <16>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c5 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c5_pins_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&ipcc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&iwdg2 {
|
||||
timeout-sec = <32>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&m4_rproc {
|
||||
mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
|
||||
mbox-names = "vq0", "vq1", "shutdown";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pwr_regulators {
|
||||
vdd-supply = <&vdd>;
|
||||
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
||||
};
|
||||
|
||||
&qspi {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a &qspi_bk2_pins_a>;
|
||||
pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a &qspi_bk2_sleep_pins_a>;
|
||||
reg = <0x58003000 0x1000>, <0x70000000 0x4000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
flash0: mx66l51235l@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-rx-bus-width = <4>;
|
||||
spi-max-frequency = <108000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
|
||||
flash1: mx66l51235l@1 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <1>;
|
||||
spi-rx-bus-width = <4>;
|
||||
spi-max-frequency = <108000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&rng1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rtc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdmmc1 {
|
||||
pinctrl-names = "default", "opendrain", "sleep";
|
||||
pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_a>;
|
||||
pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_dir_pins_a>;
|
||||
pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_a>;
|
||||
broken-cd;
|
||||
st,sig-dir;
|
||||
st,neg-edge;
|
||||
st,use-ckin;
|
||||
bus-width = <4>;
|
||||
vmmc-supply = <&vdd_sd>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdmmc2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_a>;
|
||||
non-removable;
|
||||
no-sd;
|
||||
no-sdio;
|
||||
st,sig-dir;
|
||||
st,neg-edge;
|
||||
bus-width = <8>;
|
||||
vmmc-supply = <&v3v3>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi1_pins_a>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&timers2 {
|
||||
/* spare dmas for other usage (un-delete to enable pwm capture) */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm2_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
};
|
||||
timer@1 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&timers6 {
|
||||
status = "okay";
|
||||
/* spare dmas for other usage */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
timer@5 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&timers8 {
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm8_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
};
|
||||
timer@7 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&timers12 {
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm12_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
status = "okay";
|
||||
};
|
||||
timer@11 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&uart4 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart4_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbh_ehci {
|
||||
phys = <&usbphyc_port0>;
|
||||
phy-names = "usb";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbotg_hs {
|
||||
dr_mode = "peripheral";
|
||||
phys = <&usbphyc_port1 0>;
|
||||
phy-names = "usb2-phy";
|
||||
vbus-supply = <&vbus_otg>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbphyc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbphyc_port0 {
|
||||
phy-supply = <&vdd_usb>;
|
||||
};
|
||||
|
||||
&usbphyc_port1 {
|
||||
phy-supply = <&vdd_usb>;
|
||||
};
|
||||
768
arch/arm/dts/stm32mp15xx-dkx.dtsi
Normal file
768
arch/arm/dts/stm32mp15xx-dkx.dtsi
Normal file
@ -0,0 +1,768 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
#include "stm32mp157-m4-srm.dtsi"
|
||||
#include "stm32mp157-m4-srm-pinctrl.dtsi"
|
||||
#include <dt-bindings/mfd/st,stpmic1.h>
|
||||
|
||||
/ {
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
led {
|
||||
compatible = "gpio-leds";
|
||||
blue {
|
||||
label = "heartbeat";
|
||||
gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "heartbeat";
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
|
||||
sound {
|
||||
compatible = "audio-graph-card";
|
||||
label = "STM32MP1-DK";
|
||||
routing =
|
||||
"Playback" , "MCLK",
|
||||
"Capture" , "MCLK",
|
||||
"MICL" , "Mic Bias";
|
||||
dais = <&sai2a_port &sai2b_port &i2s2_port>;
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&adc12_ain_pins_a>, <&adc12_usb_cc_pins_a>;
|
||||
vdd-supply = <&vdd>;
|
||||
vdda-supply = <&vdd>;
|
||||
vref-supply = <&vrefbuf>;
|
||||
status = "disabled";
|
||||
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. 5us).
|
||||
*/
|
||||
st,min-sample-time-nsecs = <5000>;
|
||||
/* AIN connector, USB Type-C CC1 & CC2 */
|
||||
st,adc-channels = <0 1 6 13 18 19>;
|
||||
status = "okay";
|
||||
};
|
||||
adc2: adc@100 {
|
||||
/* AIN connector, USB Type-C CC1 & CC2 */
|
||||
st,adc-channels = <0 1 2 6 18 19>;
|
||||
st,min-sample-time-nsecs = <5000>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&cec {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&cec_pins_b>;
|
||||
pinctrl-1 = <&cec_pins_sleep_b>;
|
||||
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-id";
|
||||
max-speed = <1000>;
|
||||
phy-handle = <&phy0>;
|
||||
|
||||
mdio0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "snps,dwmac-mdio";
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&gpu {
|
||||
contiguous-area = <&gpu_reserved>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&hash1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2c1_pins_a>;
|
||||
pinctrl-1 = <&i2c1_pins_sleep_a>;
|
||||
i2c-scl-rising-time-ns = <100>;
|
||||
i2c-scl-falling-time-ns = <7>;
|
||||
status = "okay";
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
|
||||
hdmi-transmitter@39 {
|
||||
compatible = "sil,sii9022";
|
||||
reg = <0x39>;
|
||||
iovcc-supply = <&v3v3_hdmi>;
|
||||
cvcc12-supply = <&v1v2_hdmi>;
|
||||
reset-gpios = <&gpioa 10 GPIO_ACTIVE_LOW>;
|
||||
interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-parent = <&gpiog>;
|
||||
#sound-dai-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
sii9022_in: endpoint {
|
||||
remote-endpoint = <<dc_ep0_out>;
|
||||
};
|
||||
};
|
||||
|
||||
port@3 {
|
||||
reg = <3>;
|
||||
sii9022_tx_endpoint: endpoint {
|
||||
remote-endpoint = <&i2s2_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
cs42l51: cs42l51@4a {
|
||||
compatible = "cirrus,cs42l51";
|
||||
reg = <0x4a>;
|
||||
#sound-dai-cells = <0>;
|
||||
VL-supply = <&v3v3>;
|
||||
VD-supply = <&v1v8_audio>;
|
||||
VA-supply = <&v1v8_audio>;
|
||||
VAHP-supply = <&v1v8_audio>;
|
||||
reset-gpios = <&gpiog 9 GPIO_ACTIVE_LOW>;
|
||||
clocks = <&sai2a>;
|
||||
clock-names = "MCLK";
|
||||
status = "okay";
|
||||
|
||||
cs42l51_port: port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cs42l51_tx_endpoint: endpoint@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&sai2a_endpoint>;
|
||||
frame-master;
|
||||
bitclock-master;
|
||||
};
|
||||
|
||||
cs42l51_rx_endpoint: endpoint@1 {
|
||||
reg = <1>;
|
||||
remote-endpoint = <&sai2b_endpoint>;
|
||||
frame-master;
|
||||
bitclock-master;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&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;
|
||||
|
||||
stusb1600@28 {
|
||||
compatible = "st,stusb1600";
|
||||
reg = <0x28>;
|
||||
interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-parent = <&gpioi>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&stusb1600_pins_a>;
|
||||
status = "okay";
|
||||
vdd-supply = <&vin>;
|
||||
|
||||
connector {
|
||||
compatible = "usb-c-connector";
|
||||
label = "USB-C";
|
||||
power-role = "dual";
|
||||
power-opmode = "default";
|
||||
|
||||
port {
|
||||
con_usbotg_hs_ep: endpoint {
|
||||
remote-endpoint = <&usbotg_hs_ep>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
pmic: stpmic@33 {
|
||||
compatible = "st,stpmic1";
|
||||
reg = <0x33>;
|
||||
interrupts-extended = <&exti_pwr 55 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "okay";
|
||||
|
||||
regulators {
|
||||
compatible = "st,stpmic1-regulators";
|
||||
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 = <IT_CURLIM_LDO1 0>;
|
||||
};
|
||||
|
||||
v3v3_hdmi: ldo2 {
|
||||
regulator-name = "v3v3_hdmi";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-always-on;
|
||||
interrupts = <IT_CURLIM_LDO2 0>;
|
||||
};
|
||||
|
||||
vtt_ddr: ldo3 {
|
||||
regulator-name = "vtt_ddr";
|
||||
regulator-min-microvolt = <500000>;
|
||||
regulator-max-microvolt = <750000>;
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
vdd_usb: ldo4 {
|
||||
regulator-name = "vdd_usb";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
interrupts = <IT_CURLIM_LDO4 0>;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
vdda: ldo5 {
|
||||
regulator-name = "vdda";
|
||||
regulator-min-microvolt = <2900000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
interrupts = <IT_CURLIM_LDO5 0>;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
v1v2_hdmi: ldo6 {
|
||||
regulator-name = "v1v2_hdmi";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <1200000>;
|
||||
regulator-always-on;
|
||||
interrupts = <IT_CURLIM_LDO6 0>;
|
||||
};
|
||||
|
||||
vref_ddr: vref_ddr {
|
||||
regulator-name = "vref_ddr";
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
bst_out: boost {
|
||||
regulator-name = "bst_out";
|
||||
interrupts = <IT_OCP_BOOST 0>;
|
||||
};
|
||||
|
||||
vbus_otg: pwr_sw1 {
|
||||
regulator-name = "vbus_otg";
|
||||
interrupts = <IT_OCP_OTG 0>;
|
||||
};
|
||||
|
||||
vbus_sw: pwr_sw2 {
|
||||
regulator-name = "vbus_sw";
|
||||
interrupts = <IT_OCP_SWOUT 0>;
|
||||
regulator-active-discharge = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
onkey {
|
||||
compatible = "st,stpmic1-onkey";
|
||||
interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
|
||||
interrupt-names = "onkey-falling", "onkey-rising";
|
||||
power-off-time-sec = <10>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
watchdog {
|
||||
compatible = "st,stpmic1-wdt";
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c5 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2c5_pins_a>;
|
||||
pinctrl-1 = <&i2c5_pins_sleep_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
clock-frequency = <400000>;
|
||||
/* spare dmas for other usage */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&i2s2 {
|
||||
clocks = <&rcc SPI2>, <&rcc SPI2_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
clock-names = "pclk", "i2sclk", "x8k", "x11k";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2s2_pins_a>;
|
||||
pinctrl-1 = <&i2s2_pins_sleep_a>;
|
||||
status = "okay";
|
||||
|
||||
i2s2_port: port {
|
||||
i2s2_endpoint: endpoint {
|
||||
remote-endpoint = <&sii9022_tx_endpoint>;
|
||||
format = "i2s";
|
||||
mclk-fs = <256>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ipcc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&iwdg2 {
|
||||
timeout-sec = <32>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
<dc {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <<dc_pins_a>;
|
||||
pinctrl-1 = <<dc_pins_sleep_a>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
ltdc_ep0_out: endpoint@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&sii9022_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&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_regulators {
|
||||
vdd-supply = <&vdd>;
|
||||
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
||||
};
|
||||
|
||||
&rng1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rtc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sai2 {
|
||||
clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
clock-names = "pclk", "x8k", "x11k";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sai2a_pins_a>, <&sai2b_pins_b>;
|
||||
pinctrl-1 = <&sai2a_sleep_pins_a>, <&sai2b_sleep_pins_b>;
|
||||
status = "okay";
|
||||
|
||||
sai2a: audio-controller@4400b004 {
|
||||
#clock-cells = <0>;
|
||||
dma-names = "tx";
|
||||
clocks = <&rcc SAI2_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "okay";
|
||||
|
||||
sai2a_port: port {
|
||||
sai2a_endpoint: endpoint {
|
||||
remote-endpoint = <&cs42l51_tx_endpoint>;
|
||||
format = "i2s";
|
||||
mclk-fs = <256>;
|
||||
dai-tdm-slot-num = <2>;
|
||||
dai-tdm-slot-width = <32>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sai2b: audio-controller@4400b024 {
|
||||
dma-names = "rx";
|
||||
st,sync = <&sai2a 2>;
|
||||
clocks = <&rcc SAI2_K>, <&sai2a>;
|
||||
clock-names = "sai_ck", "MCLK";
|
||||
status = "okay";
|
||||
|
||||
sai2b_port: port {
|
||||
sai2b_endpoint: endpoint {
|
||||
remote-endpoint = <&cs42l51_rx_endpoint>;
|
||||
format = "i2s";
|
||||
mclk-fs = <256>;
|
||||
dai-tdm-slot-num = <2>;
|
||||
dai-tdm-slot-width = <32>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&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>;
|
||||
cd-gpios = <&gpiob 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
|
||||
disable-wp;
|
||||
st,neg-edge;
|
||||
bus-width = <4>;
|
||||
vmmc-supply = <&v3v3>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdmmc3 {
|
||||
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>;
|
||||
broken-cd;
|
||||
st,neg-edge;
|
||||
bus-width = <4>;
|
||||
vmmc-supply = <&v3v3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&spi4 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&spi4_pins_a>;
|
||||
pinctrl-1 = <&spi4_sleep_pins_a>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&spi5 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&spi5_pins_a>;
|
||||
pinctrl-1 = <&spi5_sleep_pins_a>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&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";
|
||||
};
|
||||
};
|
||||
|
||||
&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";
|
||||
};
|
||||
|
||||
&uart7 {
|
||||
pinctrl-names = "default", "sleep", "idle";
|
||||
pinctrl-0 = <&uart7_pins_b>;
|
||||
pinctrl-1 = <&uart7_sleep_pins_b>;
|
||||
pinctrl-2 = <&uart7_idle_pins_b>;
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&usart3 {
|
||||
pinctrl-names = "default", "sleep", "idle";
|
||||
pinctrl-0 = <&usart3_pins_b>;
|
||||
pinctrl-1 = <&usart3_sleep_pins_b>;
|
||||
pinctrl-2 = <&usart3_idle_pins_b>;
|
||||
uart-has-rtscts;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&usbh_ehci {
|
||||
phys = <&usbphyc_port0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbotg_hs {
|
||||
phys = <&usbphyc_port1 0>;
|
||||
phy-names = "usb2-phy";
|
||||
usb-role-switch;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
usbotg_hs_ep: endpoint {
|
||||
remote-endpoint = <&con_usbotg_hs_ep>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&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>;
|
||||
};
|
||||
|
||||
&vrefbuf {
|
||||
regulator-min-microvolt = <2500000>;
|
||||
regulator-max-microvolt = <2500000>;
|
||||
vdda-supply = <&vdd>;
|
||||
status = "okay";
|
||||
};
|
||||
408
arch/arm/dts/stm32mp15xx-edx.dtsi
Normal file
408
arch/arm/dts/stm32mp15xx-edx.dtsi
Normal file
@ -0,0 +1,408 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2017 - All Rights Reserved
|
||||
* Author: Ludovic Barre <ludovic.barre@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/mfd/st,stpmic1.h>
|
||||
|
||||
/ {
|
||||
memory@c0000000 {
|
||||
device_type = "memory";
|
||||
reg = <0xC0000000 0x40000000>;
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
led {
|
||||
compatible = "gpio-leds";
|
||||
blue {
|
||||
label = "heartbeat";
|
||||
gpios = <&gpiod 9 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "heartbeat";
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
|
||||
sd_switch: regulator-sd_switch {
|
||||
compatible = "regulator-gpio";
|
||||
regulator-name = "sd_switch";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
regulator-type = "voltage";
|
||||
regulator-always-on;
|
||||
|
||||
gpios = <&gpiof 14 GPIO_ACTIVE_HIGH>;
|
||||
gpios-states = <0>;
|
||||
states = <1800000 0x1 2900000 0x0>;
|
||||
};
|
||||
|
||||
vin: vin {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vin";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
regulator-always-on;
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
/* ANA0, ANA1 are dedicated pins and don't need pinctrl: only in6. */
|
||||
pinctrl-0 = <&adc1_in6_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
vdd-supply = <&vdd>;
|
||||
vdda-supply = <&vdda>;
|
||||
vref-supply = <&vdda>;
|
||||
status = "disabled";
|
||||
adc1: adc@0 {
|
||||
st,adc-channels = <0 1 6>;
|
||||
/* 16.5 ck_cycles sampling time */
|
||||
st,min-sample-time-nsecs = <400>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&cpu0{
|
||||
cpu-supply = <&vddcore>;
|
||||
};
|
||||
|
||||
&crc1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&dac {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&dac_ch1_pins_a &dac_ch2_pins_a>;
|
||||
vref-supply = <&vdda>;
|
||||
status = "disabled";
|
||||
dac1: dac@1 {
|
||||
status = "okay";
|
||||
};
|
||||
dac2: dac@2 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&dma1 {
|
||||
sram = <&dma_pool>;
|
||||
};
|
||||
|
||||
&dma2 {
|
||||
sram = <&dma_pool>;
|
||||
};
|
||||
|
||||
&dts {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&hash1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&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;
|
||||
|
||||
pmic: stpmic@33 {
|
||||
compatible = "st,stpmic1";
|
||||
reg = <0x33>;
|
||||
interrupts-extended = <&exti_pwr 55 IRQ_TYPE_EDGE_FALLING>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
status = "okay";
|
||||
|
||||
regulators {
|
||||
compatible = "st,stpmic1-regulators";
|
||||
buck1-supply = <&vin>;
|
||||
buck2-supply = <&vin>;
|
||||
buck3-supply = <&vin>;
|
||||
buck4-supply = <&vin>;
|
||||
ldo1-supply = <&v3v3>;
|
||||
ldo2-supply = <&v3v3>;
|
||||
ldo3-supply = <&vdd_ddr>;
|
||||
ldo4-supply = <&vin>;
|
||||
ldo5-supply = <&v3v3>;
|
||||
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>;
|
||||
};
|
||||
|
||||
vdda: ldo1 {
|
||||
regulator-name = "vdda";
|
||||
regulator-min-microvolt = <2900000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
interrupts = <IT_CURLIM_LDO1 0>;
|
||||
};
|
||||
|
||||
v2v8: ldo2 {
|
||||
regulator-name = "v2v8";
|
||||
regulator-min-microvolt = <2800000>;
|
||||
regulator-max-microvolt = <2800000>;
|
||||
interrupts = <IT_CURLIM_LDO2 0>;
|
||||
};
|
||||
|
||||
vtt_ddr: ldo3 {
|
||||
regulator-name = "vtt_ddr";
|
||||
regulator-min-microvolt = <500000>;
|
||||
regulator-max-microvolt = <750000>;
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
vdd_usb: ldo4 {
|
||||
regulator-name = "vdd_usb";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
interrupts = <IT_CURLIM_LDO4 0>;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
vdd_sd: ldo5 {
|
||||
regulator-name = "vdd_sd";
|
||||
regulator-min-microvolt = <2900000>;
|
||||
regulator-max-microvolt = <2900000>;
|
||||
interrupts = <IT_CURLIM_LDO5 0>;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
v1v8: ldo6 {
|
||||
regulator-name = "v1v8";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
interrupts = <IT_CURLIM_LDO6 0>;
|
||||
};
|
||||
|
||||
vref_ddr: vref_ddr {
|
||||
regulator-name = "vref_ddr";
|
||||
regulator-always-on;
|
||||
regulator-over-current-protection;
|
||||
};
|
||||
|
||||
bst_out: boost {
|
||||
regulator-name = "bst_out";
|
||||
interrupts = <IT_OCP_BOOST 0>;
|
||||
};
|
||||
|
||||
vbus_otg: pwr_sw1 {
|
||||
regulator-name = "vbus_otg";
|
||||
interrupts = <IT_OCP_OTG 0>;
|
||||
};
|
||||
|
||||
vbus_sw: pwr_sw2 {
|
||||
regulator-name = "vbus_sw";
|
||||
interrupts = <IT_OCP_SWOUT 0>;
|
||||
regulator-active-discharge = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
onkey {
|
||||
compatible = "st,stpmic1-onkey";
|
||||
interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
|
||||
interrupt-names = "onkey-falling", "onkey-rising";
|
||||
power-off-time-sec = <10>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
watchdog {
|
||||
compatible = "st,stpmic1-wdt";
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&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_regulators {
|
||||
vdd-supply = <&vdd>;
|
||||
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
||||
};
|
||||
|
||||
&rng1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rtc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdmmc1 {
|
||||
pinctrl-names = "default", "opendrain", "sleep";
|
||||
pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_a>;
|
||||
pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_dir_pins_a>;
|
||||
pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_a>;
|
||||
cd-gpios = <&gpiog 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
|
||||
disable-wp;
|
||||
st,sig-dir;
|
||||
st,neg-edge;
|
||||
st,use-ckin;
|
||||
bus-width = <4>;
|
||||
vmmc-supply = <&vdd_sd>;
|
||||
vqmmc-supply = <&sd_switch>;
|
||||
sd-uhs-sdr12;
|
||||
sd-uhs-sdr25;
|
||||
sd-uhs-sdr50;
|
||||
sd-uhs-ddr50;
|
||||
sd-uhs-sdr104;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&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>;
|
||||
vqmmc-supply = <&vdd>;
|
||||
mmc-ddr-3_3v;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sram {
|
||||
dma_pool: dma_pool@0 {
|
||||
reg = <0x50000 0x10000>;
|
||||
pool;
|
||||
};
|
||||
};
|
||||
|
||||
&timers6 {
|
||||
status = "okay";
|
||||
/* spare dmas for other usage */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
timer@5 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&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";
|
||||
};
|
||||
|
||||
&usbotg_hs {
|
||||
vbus-supply = <&vbus_otg>;
|
||||
};
|
||||
|
||||
&usbphyc_port0 {
|
||||
phy-supply = <&vdd_usb>;
|
||||
};
|
||||
|
||||
&usbphyc_port1 {
|
||||
phy-supply = <&vdd_usb>;
|
||||
};
|
||||
680
arch/arm/dts/stm32mp15xx-evx.dtsi
Normal file
680
arch/arm/dts/stm32mp15xx-evx.dtsi
Normal file
@ -0,0 +1,680 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2017 - All Rights Reserved
|
||||
* Author: Ludovic Barre <ludovic.barre@st.com> for STMicroelectronics.
|
||||
*/
|
||||
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/soc/stm32-hdp.h>
|
||||
|
||||
/ {
|
||||
clocks {
|
||||
clk_ext_camera: clk-ext-camera {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <24000000>;
|
||||
};
|
||||
};
|
||||
|
||||
joystick {
|
||||
compatible = "gpio-keys";
|
||||
#size-cells = <0>;
|
||||
pinctrl-0 = <&joystick_pins>;
|
||||
pinctrl-names = "default";
|
||||
button-0 {
|
||||
label = "JoySel";
|
||||
linux,code = <KEY_ENTER>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <0 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
button-1 {
|
||||
label = "JoyDown";
|
||||
linux,code = <KEY_DOWN>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <1 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
button-2 {
|
||||
label = "JoyLeft";
|
||||
linux,code = <KEY_LEFT>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <2 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
button-3 {
|
||||
label = "JoyRight";
|
||||
linux,code = <KEY_RIGHT>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <3 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
button-4 {
|
||||
label = "JoyUp";
|
||||
linux,code = <KEY_UP>;
|
||||
interrupt-parent = <&stmfx_pinctrl>;
|
||||
interrupts = <4 IRQ_TYPE_EDGE_RISING>;
|
||||
};
|
||||
};
|
||||
|
||||
panel_backlight: panel-backlight {
|
||||
compatible = "gpio-backlight";
|
||||
gpios = <&gpiod 13 GPIO_ACTIVE_LOW>;
|
||||
default-on;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
spdif_out: spdif-out {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "linux,spdif-dit";
|
||||
status = "okay";
|
||||
|
||||
spdif_out_port: port {
|
||||
spdif_out_endpoint: endpoint {
|
||||
remote-endpoint = <&sai4a_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
spdif_in: spdif-in {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "linux,spdif-dir";
|
||||
status = "okay";
|
||||
|
||||
spdif_in_port: port {
|
||||
spdif_in_endpoint: endpoint {
|
||||
remote-endpoint = <&spdifrx_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sound {
|
||||
compatible = "audio-graph-card";
|
||||
label = "STM32MP1-EV";
|
||||
routing =
|
||||
"AIF1CLK" , "MCLK1",
|
||||
"AIF2CLK" , "MCLK1",
|
||||
"IN1LN" , "MICBIAS2",
|
||||
"DMIC2DAT" , "MICBIAS1",
|
||||
"DMIC1DAT" , "MICBIAS1";
|
||||
dais = <&sai2a_port &sai2b_port &sai4a_port &spdifrx_port
|
||||
&dfsdm0_port &dfsdm1_port &dfsdm2_port &dfsdm3_port>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
dmic0: dmic-0 {
|
||||
compatible = "dmic-codec";
|
||||
#sound-dai-cells = <1>;
|
||||
sound-name-prefix = "dmic0";
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
dmic0_endpoint: endpoint {
|
||||
remote-endpoint = <&dfsdm_endpoint0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dmic1: dmic-1 {
|
||||
compatible = "dmic-codec";
|
||||
#sound-dai-cells = <1>;
|
||||
sound-name-prefix = "dmic1";
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
dmic1_endpoint: endpoint {
|
||||
remote-endpoint = <&dfsdm_endpoint1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dmic2: dmic-2 {
|
||||
compatible = "dmic-codec";
|
||||
#sound-dai-cells = <1>;
|
||||
sound-name-prefix = "dmic2";
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
dmic2_endpoint: endpoint {
|
||||
remote-endpoint = <&dfsdm_endpoint2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dmic3: dmic-3 {
|
||||
compatible = "dmic-codec";
|
||||
#sound-dai-cells = <1>;
|
||||
sound-name-prefix = "dmic3";
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
dmic3_endpoint: endpoint {
|
||||
remote-endpoint = <&dfsdm_endpoint3>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
&cec {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&cec_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&dcmi {
|
||||
status = "okay";
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&dcmi_pins_a>;
|
||||
pinctrl-1 = <&dcmi_sleep_pins_a>;
|
||||
|
||||
port {
|
||||
dcmi_0: endpoint {
|
||||
remote-endpoint = <&ov5640_0>;
|
||||
bus-width = <8>;
|
||||
hsync-active = <0>;
|
||||
vsync-active = <0>;
|
||||
pclk-sample = <1>;
|
||||
pclk-max-frequency = <77000000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&dfsdm {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&dfsdm_clkout_pins_a
|
||||
&dfsdm_data1_pins_a &dfsdm_data3_pins_a>;
|
||||
pinctrl-1 = <&dfsdm_clkout_sleep_pins_a
|
||||
&dfsdm_data1_sleep_pins_a &dfsdm_data3_sleep_pins_a>;
|
||||
spi-max-frequency = <2048000>;
|
||||
|
||||
clocks = <&rcc DFSDM_K>, <&rcc ADFSDM_K>;
|
||||
clock-names = "dfsdm", "audio";
|
||||
status = "okay";
|
||||
|
||||
dfsdm0: filter@0 {
|
||||
compatible = "st,stm32-dfsdm-dmic";
|
||||
st,adc-channels = <3>;
|
||||
st,adc-channel-names = "dmic_u1";
|
||||
st,adc-channel-types = "SPI_R";
|
||||
st,adc-channel-clk-src = "CLKOUT";
|
||||
st,filter-order = <3>;
|
||||
status = "okay";
|
||||
|
||||
asoc_pdm0: dfsdm-dai {
|
||||
compatible = "st,stm32h7-dfsdm-dai";
|
||||
#sound-dai-cells = <0>;
|
||||
io-channels = <&dfsdm0 0>;
|
||||
status = "okay";
|
||||
|
||||
dfsdm0_port: port {
|
||||
dfsdm_endpoint0: endpoint {
|
||||
remote-endpoint = <&dmic0_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dfsdm1: filter@1 {
|
||||
compatible = "st,stm32-dfsdm-dmic";
|
||||
st,adc-channels = <1>;
|
||||
st,adc-channel-names = "dmic_u2";
|
||||
st,adc-channel-types = "SPI_F";
|
||||
st,adc-channel-clk-src = "CLKOUT";
|
||||
st,filter-order = <3>;
|
||||
status = "okay";
|
||||
|
||||
asoc_pdm1: dfsdm-dai {
|
||||
compatible = "st,stm32h7-dfsdm-dai";
|
||||
#sound-dai-cells = <0>;
|
||||
io-channels = <&dfsdm1 0>;
|
||||
status = "okay";
|
||||
|
||||
dfsdm1_port: port {
|
||||
dfsdm_endpoint1: endpoint {
|
||||
remote-endpoint = <&dmic1_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dfsdm2: filter@2 {
|
||||
compatible = "st,stm32-dfsdm-dmic";
|
||||
st,adc-channels = <3>;
|
||||
st,adc-channel-names = "dmic_u3";
|
||||
st,adc-channel-types = "SPI_F";
|
||||
st,adc-channel-clk-src = "CLKOUT";
|
||||
st,filter-order = <3>;
|
||||
status = "okay";
|
||||
|
||||
asoc_pdm2: dfsdm-dai {
|
||||
compatible = "st,stm32h7-dfsdm-dai";
|
||||
#sound-dai-cells = <0>;
|
||||
io-channels = <&dfsdm2 0>;
|
||||
status = "okay";
|
||||
|
||||
dfsdm2_port: port {
|
||||
dfsdm_endpoint2: endpoint {
|
||||
remote-endpoint = <&dmic2_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dfsdm3: filter@3 {
|
||||
compatible = "st,stm32-dfsdm-dmic";
|
||||
st,adc-channels = <1>;
|
||||
st,adc-channel-names = "dmic_u4";
|
||||
st,adc-channel-types = "SPI_R";
|
||||
st,adc-channel-clk-src = "CLKOUT";
|
||||
st,filter-order = <3>;
|
||||
status = "okay";
|
||||
|
||||
asoc_pdm3: dfsdm-dai {
|
||||
compatible = "st,stm32h7-dfsdm-dai";
|
||||
#sound-dai-cells = <0>;
|
||||
io-channels = <&dfsdm3 0>;
|
||||
status = "okay";
|
||||
|
||||
dfsdm3_port: port {
|
||||
dfsdm_endpoint3: endpoint {
|
||||
remote-endpoint = <&dmic3_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ðernet0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <ðernet0_rgmii_pins_a>;
|
||||
pinctrl-1 = <ðernet0_rgmii_pins_sleep_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
phy-mode = "rgmii-id";
|
||||
max-speed = <1000>;
|
||||
phy-handle = <&phy0>;
|
||||
|
||||
mdio0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "snps,dwmac-mdio";
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&fmc {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&fmc_pins_a>;
|
||||
pinctrl-1 = <&fmc_sleep_pins_a>;
|
||||
status = "okay";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
nand@0 {
|
||||
reg = <0>;
|
||||
nand-on-flash-bbt;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&hdp {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&hdp0_pins_a &hdp6_pins_a &hdp7_pins_a>;
|
||||
pinctrl-1 = <&hdp0_pins_sleep_a &hdp6_pins_sleep_a &hdp7_pins_sleep_a>;
|
||||
status = "disabled";
|
||||
|
||||
muxing-hdp = <(STM32_HDP(0, HDP0_GPOVAL_0) |
|
||||
STM32_HDP(6, HDP6_GPOVAL_6) |
|
||||
STM32_HDP(7, HDP7_GPOVAL_7))>;
|
||||
};
|
||||
|
||||
&i2c2 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2c2_pins_a>;
|
||||
pinctrl-1 = <&i2c2_pins_sleep_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
status = "okay";
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
|
||||
wm8994: wm8994@1b {
|
||||
compatible = "wlf,wm8994";
|
||||
#sound-dai-cells = <0>;
|
||||
reg = <0x1b>;
|
||||
status = "okay";
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
DBVDD-supply = <&vdd>;
|
||||
SPKVDD1-supply = <&vdd>;
|
||||
SPKVDD2-supply = <&vdd>;
|
||||
AVDD2-supply = <&v1v8>;
|
||||
CPVDD-supply = <&v1v8>;
|
||||
|
||||
wlf,ldoena-always-driven;
|
||||
|
||||
clocks = <&sai2a>;
|
||||
clock-names = "MCLK1";
|
||||
|
||||
wlf,gpio-cfg = <0x8101 0xa100 0xa100 0xa100 0xa101 0xa101 0xa100 0xa101 0xa101 0xa101 0xa101>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
wm8994_tx_port: port@0 {
|
||||
reg = <0>;
|
||||
wm8994_tx_endpoint: endpoint {
|
||||
remote-endpoint = <&sai2a_endpoint>;
|
||||
};
|
||||
};
|
||||
|
||||
wm8994_rx_port: port@1 {
|
||||
reg = <1>;
|
||||
wm8994_rx_endpoint: endpoint {
|
||||
remote-endpoint = <&sai2b_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ov5640: camera@3c {
|
||||
compatible = "ovti,ov5640";
|
||||
reg = <0x3c>;
|
||||
clocks = <&clk_ext_camera>;
|
||||
clock-names = "xclk";
|
||||
DOVDD-supply = <&v2v8>;
|
||||
powerdown-gpios = <&stmfx_pinctrl 18 (GPIO_ACTIVE_HIGH | GPIO_PUSH_PULL)>;
|
||||
reset-gpios = <&stmfx_pinctrl 19 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
|
||||
rotation = <180>;
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
ov5640_0: endpoint {
|
||||
remote-endpoint = <&dcmi_0>;
|
||||
bus-width = <8>;
|
||||
data-shift = <2>; /* lines 9:2 are used */
|
||||
hsync-active = <0>;
|
||||
vsync-active = <0>;
|
||||
pclk-sample = <1>;
|
||||
pclk-max-frequency = <77000000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
stmfx: stmfx@42 {
|
||||
compatible = "st,stmfx-0300";
|
||||
reg = <0x42>;
|
||||
interrupts = <8 IRQ_TYPE_EDGE_RISING>;
|
||||
interrupt-parent = <&gpioi>;
|
||||
vdd-supply = <&v3v3>;
|
||||
|
||||
stmfx_pinctrl: stmfx-pin-controller {
|
||||
compatible = "st,stmfx-0300-pinctrl";
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-ranges = <&stmfx_pinctrl 0 0 24>;
|
||||
|
||||
goodix_pins: goodix {
|
||||
pins = "gpio14";
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
joystick_pins: joystick {
|
||||
pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4";
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c4 {
|
||||
pmic: stpmic@33 {
|
||||
regulators {
|
||||
v1v8: ldo6 {
|
||||
regulator-enable-ramp-delay = <300000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c5 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&i2c5_pins_a>;
|
||||
pinctrl-1 = <&i2c5_pins_sleep_a>;
|
||||
i2c-scl-rising-time-ns = <185>;
|
||||
i2c-scl-falling-time-ns = <20>;
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
<dc {
|
||||
status = "okay";
|
||||
|
||||
port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
ltdc_ep0_out: endpoint@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&dsi_in>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&qspi {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a &qspi_bk2_pins_a>;
|
||||
pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a &qspi_bk2_sleep_pins_a>;
|
||||
reg = <0x58003000 0x1000>, <0x70000000 0x4000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
flash0: mx66l51235l@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-rx-bus-width = <4>;
|
||||
spi-max-frequency = <108000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
|
||||
flash1: mx66l51235l@1 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <1>;
|
||||
spi-rx-bus-width = <4>;
|
||||
spi-max-frequency = <108000000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
&sai2 {
|
||||
clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sai2a_pins_a>, <&sai2b_pins_a>;
|
||||
pinctrl-1 = <&sai2a_sleep_pins_a>, <&sai2b_sleep_pins_a>;
|
||||
clock-names = "pclk", "x8k", "x11k";
|
||||
status = "okay";
|
||||
|
||||
sai2a: audio-controller@4400b004 {
|
||||
#clock-cells = <0>;
|
||||
dma-names = "tx";
|
||||
clocks = <&rcc SAI2_K>;
|
||||
clock-names = "sai_ck";
|
||||
status = "okay";
|
||||
|
||||
sai2a_port: port {
|
||||
sai2a_endpoint: endpoint {
|
||||
remote-endpoint = <&wm8994_tx_endpoint>;
|
||||
format = "i2s";
|
||||
mclk-fs = <256>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sai2b: audio-controller@4400b024 {
|
||||
dma-names = "rx";
|
||||
clocks = <&rcc SAI2_K>, <&sai2a>;
|
||||
clock-names = "sai_ck", "MCLK";
|
||||
status = "okay";
|
||||
|
||||
sai2b_port: port {
|
||||
sai2b_endpoint: endpoint {
|
||||
remote-endpoint = <&wm8994_rx_endpoint>;
|
||||
format = "i2s";
|
||||
mclk-fs = <256>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&sai4 {
|
||||
clocks = <&rcc SAI4>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
|
||||
clock-names = "pclk", "x8k", "x11k";
|
||||
status = "okay";
|
||||
|
||||
sai4a: audio-controller@50027004 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&sai4a_pins_a>;
|
||||
pinctrl-1 = <&sai4a_sleep_pins_a>;
|
||||
dma-names = "tx";
|
||||
clocks = <&rcc SAI4_K>;
|
||||
clock-names = "sai_ck";
|
||||
st,iec60958;
|
||||
status = "okay";
|
||||
|
||||
sai4a_port: port {
|
||||
sai4a_endpoint: endpoint {
|
||||
remote-endpoint = <&spdif_out_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc3 {
|
||||
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>;
|
||||
vmmc-supply = <&v3v3>;
|
||||
broken-cd;
|
||||
st,neg-edge;
|
||||
bus-width = <4>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&spdifrx {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&spdifrx_pins_a>;
|
||||
pinctrl-1 = <&spdifrx_sleep_pins_a>;
|
||||
status = "okay";
|
||||
|
||||
spdifrx_port: port {
|
||||
spdifrx_endpoint: endpoint {
|
||||
remote-endpoint = <&spdif_in_endpoint>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <&spi1_pins_a>;
|
||||
pinctrl-1 = <&spi1_sleep_pins_a>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&timers2 {
|
||||
/* spare dmas for other usage (un-delete to enable pwm capture) */
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm2_pins_a>;
|
||||
pinctrl-1 = <&pwm2_sleep_pins_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
status = "okay";
|
||||
};
|
||||
timer@1 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&timers8 {
|
||||
/delete-property/dmas;
|
||||
/delete-property/dma-names;
|
||||
status = "disabled";
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm8_pins_a>;
|
||||
pinctrl-1 = <&pwm8_sleep_pins_a>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
status = "okay";
|
||||
};
|
||||
timer@7 {
|
||||
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";
|
||||
};
|
||||
};
|
||||
|
||||
&usart3 {
|
||||
pinctrl-names = "default", "sleep", "idle";
|
||||
pinctrl-0 = <&usart3_pins_a>;
|
||||
pinctrl-1 = <&usart3_sleep_pins_a>;
|
||||
pinctrl-2 = <&usart3_idle_pins_a>;
|
||||
uart-has-rtscts;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&usbh_ehci {
|
||||
phys = <&usbphyc_port0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbotg_hs {
|
||||
pinctrl-0 = <&usbotg_hs_pins_a>;
|
||||
pinctrl-names = "default";
|
||||
phys = <&usbphyc_port1 0>;
|
||||
phy-names = "usb2-phy";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbphyc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbphyc_port0 {
|
||||
st,phy-tuning = <&usb_phy_tuning>;
|
||||
};
|
||||
|
||||
&usbphyc_port1 {
|
||||
st,phy-tuning = <&usb_phy_tuning>;
|
||||
};
|
||||
85
arch/arm/dts/stm32mp15xxaa-pinctrl.dtsi
Normal file
85
arch/arm/dts/stm32mp15xxaa-pinctrl.dtsi
Normal file
@ -0,0 +1,85 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
st,package = <STM32MP_PKG_AA>;
|
||||
|
||||
gpioa: gpio@50002000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 0 16>;
|
||||
};
|
||||
|
||||
gpiob: gpio@50003000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 16 16>;
|
||||
};
|
||||
|
||||
gpioc: gpio@50004000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 32 16>;
|
||||
};
|
||||
|
||||
gpiod: gpio@50005000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 48 16>;
|
||||
};
|
||||
|
||||
gpioe: gpio@50006000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 64 16>;
|
||||
};
|
||||
|
||||
gpiof: gpio@50007000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 80 16>;
|
||||
};
|
||||
|
||||
gpiog: gpio@50008000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 96 16>;
|
||||
};
|
||||
|
||||
gpioh: gpio@50009000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 112 16>;
|
||||
};
|
||||
|
||||
gpioi: gpio@5000a000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 128 16>;
|
||||
};
|
||||
|
||||
gpioj: gpio@5000b000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 144 16>;
|
||||
};
|
||||
|
||||
gpiok: gpio@5000c000 {
|
||||
status = "okay";
|
||||
ngpios = <8>;
|
||||
gpio-ranges = <&pinctrl 0 160 8>;
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl_z {
|
||||
st,package = <STM32MP_PKG_AA>;
|
||||
|
||||
gpioz: gpio@54004000 {
|
||||
status = "okay";
|
||||
ngpios = <8>;
|
||||
gpio-ranges = <&pinctrl_z 0 400 8>;
|
||||
};
|
||||
};
|
||||
57
arch/arm/dts/stm32mp15xxab-pinctrl.dtsi
Normal file
57
arch/arm/dts/stm32mp15xxab-pinctrl.dtsi
Normal file
@ -0,0 +1,57 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
st,package = <STM32MP_PKG_AB>;
|
||||
|
||||
gpioa: gpio@50002000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 0 16>;
|
||||
};
|
||||
|
||||
gpiob: gpio@50003000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 16 16>;
|
||||
};
|
||||
|
||||
gpioc: gpio@50004000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 32 16>;
|
||||
};
|
||||
|
||||
gpiod: gpio@50005000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 48 16>;
|
||||
};
|
||||
|
||||
gpioe: gpio@50006000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 64 16>;
|
||||
};
|
||||
|
||||
gpiof: gpio@50007000 {
|
||||
status = "okay";
|
||||
ngpios = <6>;
|
||||
gpio-ranges = <&pinctrl 6 86 6>;
|
||||
};
|
||||
|
||||
gpiog: gpio@50008000 {
|
||||
status = "okay";
|
||||
ngpios = <10>;
|
||||
gpio-ranges = <&pinctrl 6 102 10>;
|
||||
};
|
||||
|
||||
gpioh: gpio@50009000 {
|
||||
status = "okay";
|
||||
ngpios = <2>;
|
||||
gpio-ranges = <&pinctrl 0 112 2>;
|
||||
};
|
||||
};
|
||||
73
arch/arm/dts/stm32mp15xxac-pinctrl.dtsi
Normal file
73
arch/arm/dts/stm32mp15xxac-pinctrl.dtsi
Normal file
@ -0,0 +1,73 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
st,package = <STM32MP_PKG_AC>;
|
||||
|
||||
gpioa: gpio@50002000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 0 16>;
|
||||
};
|
||||
|
||||
gpiob: gpio@50003000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 16 16>;
|
||||
};
|
||||
|
||||
gpioc: gpio@50004000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 32 16>;
|
||||
};
|
||||
|
||||
gpiod: gpio@50005000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 48 16>;
|
||||
};
|
||||
|
||||
gpioe: gpio@50006000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 64 16>;
|
||||
};
|
||||
|
||||
gpiof: gpio@50007000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 80 16>;
|
||||
};
|
||||
|
||||
gpiog: gpio@50008000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 96 16>;
|
||||
};
|
||||
|
||||
gpioh: gpio@50009000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 112 16>;
|
||||
};
|
||||
|
||||
gpioi: gpio@5000a000 {
|
||||
status = "okay";
|
||||
ngpios = <12>;
|
||||
gpio-ranges = <&pinctrl 0 128 12>;
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl_z {
|
||||
st,package = <STM32MP_PKG_AC>;
|
||||
|
||||
gpioz: gpio@54004000 {
|
||||
status = "okay";
|
||||
ngpios = <8>;
|
||||
gpio-ranges = <&pinctrl_z 0 400 8>;
|
||||
};
|
||||
};
|
||||
57
arch/arm/dts/stm32mp15xxad-pinctrl.dtsi
Normal file
57
arch/arm/dts/stm32mp15xxad-pinctrl.dtsi
Normal file
@ -0,0 +1,57 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
|
||||
/*
|
||||
* Copyright (C) STMicroelectronics 2019 - All Rights Reserved
|
||||
* Author: Alexandre Torgue <alexandre.torgue@st.com>
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
st,package = <STM32MP_PKG_AD>;
|
||||
|
||||
gpioa: gpio@50002000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 0 16>;
|
||||
};
|
||||
|
||||
gpiob: gpio@50003000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 16 16>;
|
||||
};
|
||||
|
||||
gpioc: gpio@50004000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 32 16>;
|
||||
};
|
||||
|
||||
gpiod: gpio@50005000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 48 16>;
|
||||
};
|
||||
|
||||
gpioe: gpio@50006000 {
|
||||
status = "okay";
|
||||
ngpios = <16>;
|
||||
gpio-ranges = <&pinctrl 0 64 16>;
|
||||
};
|
||||
|
||||
gpiof: gpio@50007000 {
|
||||
status = "okay";
|
||||
ngpios = <6>;
|
||||
gpio-ranges = <&pinctrl 6 86 6>;
|
||||
};
|
||||
|
||||
gpiog: gpio@50008000 {
|
||||
status = "okay";
|
||||
ngpios = <10>;
|
||||
gpio-ranges = <&pinctrl 6 102 10>;
|
||||
};
|
||||
|
||||
gpioh: gpio@50009000 {
|
||||
status = "okay";
|
||||
ngpios = <2>;
|
||||
gpio-ranges = <&pinctrl 0 112 2>;
|
||||
};
|
||||
};
|
||||
@ -74,6 +74,9 @@ void arch_lmb_reserve(struct lmb *lmb)
|
||||
gd->bd->bi_dram[bank].size - 1;
|
||||
if (sp > bank_end)
|
||||
continue;
|
||||
if (bank_end > gd->ram_top)
|
||||
bank_end = gd->ram_top - 1;
|
||||
|
||||
lmb_reserve(lmb, sp, bank_end - sp + 1);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -127,8 +127,7 @@ ENTRY(_main)
|
||||
ldr r0, [r9, #GD_START_ADDR_SP] /* sp = gd->start_addr_sp */
|
||||
bic r0, r0, #7 /* 8-byte alignment for ABI compliance */
|
||||
mov sp, r0
|
||||
ldr r9, [r9, #GD_BD] /* r9 = gd->bd */
|
||||
sub r9, r9, #GD_SIZE /* new GD is below bd */
|
||||
ldr r9, [r9, #GD_NEW_GD] /* r9 <- gd->new_gd */
|
||||
|
||||
adr lr, here
|
||||
ldr r0, [r9, #GD_RELOC_OFF] /* r0 = gd->reloc_off */
|
||||
|
||||
@ -33,8 +33,8 @@ config SYS_MALLOC_LEN
|
||||
config ENV_SIZE
|
||||
default 0x2000
|
||||
|
||||
config TARGET_STM32MP1
|
||||
bool "Support stm32mp1xx"
|
||||
config STM32MP15x
|
||||
bool "Support STMicroelectronics STM32MP15x Soc"
|
||||
select ARCH_SUPPORT_PSCI if !STM32MP1_TRUSTED
|
||||
select CPU_V7A
|
||||
select CPU_V7_HAS_NONSEC if !STM32MP1_TRUSTED
|
||||
@ -45,19 +45,47 @@ config TARGET_STM32MP1
|
||||
select STM32_RESET
|
||||
select STM32_SERIAL
|
||||
select SYS_ARCH_TIMER
|
||||
imply CMD_NVEDIT_INFO
|
||||
imply SYSRESET_PSCI if STM32MP1_TRUSTED
|
||||
imply SYSRESET_SYSCON if !STM32MP1_TRUSTED
|
||||
help
|
||||
support of STMicroelectronics SOC STM32MP15x family
|
||||
STM32MP157, STM32MP153 or STM32MP151
|
||||
STMicroelectronics MPU with core ARMv7
|
||||
dual core A7 for STM32MP157/3, monocore for STM32MP151
|
||||
target all the STMicroelectronics board with SOC STM32MP1 family
|
||||
|
||||
choice
|
||||
prompt "STM32MP15x board select"
|
||||
optional
|
||||
|
||||
config TARGET_ST_STM32MP15x
|
||||
bool "STMicroelectronics STM32MP15x boards"
|
||||
select STM32MP15x
|
||||
imply BOOTCOUNT_LIMIT
|
||||
imply BOOTSTAGE
|
||||
imply CMD_BOOTCOUNT
|
||||
imply CMD_BOOTSTAGE
|
||||
imply CMD_CLS if CMD_BMP
|
||||
imply DISABLE_CONSOLE
|
||||
imply PRE_CONSOLE_BUFFER
|
||||
imply SILENT_CONSOLE
|
||||
imply SYSRESET_PSCI if STM32MP1_TRUSTED
|
||||
imply SYSRESET_SYSCON if !STM32MP1_TRUSTED
|
||||
imply VERSION_VARIABLE
|
||||
help
|
||||
target STMicroelectronics SOC STM32MP1 family
|
||||
STM32MP157, STM32MP153 or STM32MP151
|
||||
STMicroelectronics MPU with core ARMv7
|
||||
dual core A7 for STM32MP157/3, monocore for STM32MP151
|
||||
target the STMicroelectronics board with SOC STM32MP15x
|
||||
managed by board/st/stm32mp1:
|
||||
Evalulation board (EV1) or Discovery board (DK1 and DK2).
|
||||
The difference between board are managed with devicetree
|
||||
|
||||
config TARGET_DH_STM32MP1_PDK2
|
||||
bool "DH STM32MP1 PDK2"
|
||||
select STM32MP15x
|
||||
imply BOOTCOUNT_LIMIT
|
||||
imply CMD_BOOTCOUNT
|
||||
help
|
||||
Target the DH PDK2 development kit with STM32MP15x SoM.
|
||||
|
||||
endchoice
|
||||
|
||||
config STM32MP1_TRUSTED
|
||||
bool "Support trusted boot with TF-A"
|
||||
@ -69,23 +97,8 @@ config STM32MP1_TRUSTED
|
||||
BootRom => TF-A.stm32 (clock & DDR) => U-Boot.stm32
|
||||
TF-A monitor provides proprietary SMC to manage secure devices
|
||||
|
||||
config STM32MP1_OPTEE
|
||||
bool "Support trusted boot with TF-A and OP-TEE"
|
||||
depends on STM32MP1_TRUSTED
|
||||
default n
|
||||
help
|
||||
Say Y here to enable boot with TF-A and OP-TEE
|
||||
Trusted boot chain is :
|
||||
BootRom => TF-A.stm32 (clock & DDR) => OP-TEE => U-Boot.stm32
|
||||
OP-TEE monitor provides ST SMC to access to secure resources
|
||||
|
||||
config SYS_TEXT_BASE
|
||||
prompt "U-Boot base address"
|
||||
default 0xC0100000
|
||||
help
|
||||
configure the U-Boot base address
|
||||
when DDR driver is used:
|
||||
DDR + 1MB (0xC0100000)
|
||||
|
||||
config NR_DRAM_BANKS
|
||||
default 1
|
||||
@ -100,11 +113,28 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
|
||||
|
||||
config STM32_ETZPC
|
||||
bool "STM32 Extended TrustZone Protection"
|
||||
depends on TARGET_STM32MP1
|
||||
depends on STM32MP15x
|
||||
default y
|
||||
help
|
||||
Say y to enable STM32 Extended TrustZone Protection
|
||||
|
||||
config CMD_STM32PROG
|
||||
bool "command stm32prog for STM32CudeProgrammer"
|
||||
select DFU
|
||||
select DFU_RAM
|
||||
select DFU_VIRT
|
||||
select PARTITION_TYPE_GUID
|
||||
imply CMD_GPT if MMC
|
||||
imply CMD_MTD if MTD
|
||||
imply DFU_MMC if MMC
|
||||
imply DFU_MTD if MTD
|
||||
help
|
||||
activate a specific command stm32prog for STM32MP soc family
|
||||
witch update the device with the tools STM32CubeProgrammer,
|
||||
using UART with STM32 protocol or USB with DFU protocol
|
||||
NB: access to not volatile memory (NOR/NAND/SD/eMMC) is based
|
||||
on U-Boot DFU framework
|
||||
|
||||
config CMD_STM32KEY
|
||||
bool "command stm32key to fuse public key hash"
|
||||
default y
|
||||
@ -147,5 +177,6 @@ config DEBUG_UART_CLOCK
|
||||
endif
|
||||
|
||||
source "board/st/stm32mp1/Kconfig"
|
||||
source "board/dhelectronics/dh_stm32mp1/Kconfig"
|
||||
|
||||
endif
|
||||
|
||||
@ -6,13 +6,15 @@
|
||||
obj-y += cpu.o
|
||||
obj-y += dram_init.o
|
||||
obj-y += syscon.o
|
||||
obj-y += bsec.o
|
||||
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
obj-y += spl.o
|
||||
else
|
||||
obj-y += bsec.o
|
||||
obj-$(CONFIG_CMD_STM32PROG) += cmd_stm32prog/
|
||||
obj-$(CONFIG_CMD_STM32KEY) += cmd_stm32key.o
|
||||
obj-$(CONFIG_ARMV7_PSCI) += psci.o
|
||||
obj-$(CONFIG_STM32MP1_TRUSTED) += boot_params.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_$(SPL_)DM_REGULATOR) += pwr_regulator.o
|
||||
|
||||
45
arch/arm/mach-stm32mp/boot_params.c
Normal file
45
arch/arm/mach-stm32mp/boot_params.c
Normal file
@ -0,0 +1,45 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2019, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/sections.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
/*
|
||||
* Force data-section, as .bss will not be valid
|
||||
* when save_boot_params is invoked.
|
||||
*/
|
||||
static unsigned long nt_fw_dtb __section(".data");
|
||||
|
||||
/*
|
||||
* Save the FDT address provided by TF-A in r2 at boot time
|
||||
* This function is called from start.S
|
||||
*/
|
||||
void save_boot_params(unsigned long r0, unsigned long r1, unsigned long r2,
|
||||
unsigned long r3)
|
||||
{
|
||||
nt_fw_dtb = r2;
|
||||
|
||||
save_boot_params_ret();
|
||||
}
|
||||
|
||||
/*
|
||||
* Use the saved FDT address provided by TF-A at boot time (NT_FW_CONFIG =
|
||||
* Non Trusted Firmware configuration file) when the pointer is valid
|
||||
*/
|
||||
void *board_fdt_blob_setup(void)
|
||||
{
|
||||
debug("%s: nt_fw_dtb=%lx\n", __func__, nt_fw_dtb);
|
||||
|
||||
/* use external device tree only if address is valid */
|
||||
if (nt_fw_dtb >= STM32_DDR_BASE) {
|
||||
if (fdt_magic(nt_fw_dtb) == FDT_MAGIC)
|
||||
return (void *)nt_fw_dtb;
|
||||
debug("%s: DTB not found.\n", __func__);
|
||||
}
|
||||
debug("%s: fall back to builtin DTB, %p\n", __func__, &_end);
|
||||
|
||||
return (void *)&_end;
|
||||
}
|
||||
@ -7,13 +7,12 @@
|
||||
#include <dm.h>
|
||||
#include <misc.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/bsec.h>
|
||||
#include <asm/arch/stm32mp1_smc.h>
|
||||
#include <linux/arm-smccc.h>
|
||||
#include <linux/iopoll.h>
|
||||
|
||||
#define BSEC_OTP_MAX_VALUE 95
|
||||
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
#define BSEC_TIMEOUT_US 10000
|
||||
|
||||
/* BSEC REGISTER OFFSET (base relative) */
|
||||
@ -22,11 +21,13 @@
|
||||
#define BSEC_OTP_WRDATA_OFF 0x008
|
||||
#define BSEC_OTP_STATUS_OFF 0x00C
|
||||
#define BSEC_OTP_LOCK_OFF 0x010
|
||||
#define BSEC_DENABLE_OFF 0x014
|
||||
#define BSEC_DISTURBED_OFF 0x01C
|
||||
#define BSEC_ERROR_OFF 0x034
|
||||
#define BSEC_SPLOCK_OFF 0x064 /* Program safmem sticky lock */
|
||||
#define BSEC_SWLOCK_OFF 0x07C /* write in OTP sticky lock */
|
||||
#define BSEC_SRLOCK_OFF 0x094 /* shadowing sticky lock */
|
||||
#define BSEC_WRLOCK_OFF 0x04C /* OTP write permananet lock */
|
||||
#define BSEC_SPLOCK_OFF 0x064 /* OTP write sticky lock */
|
||||
#define BSEC_SWLOCK_OFF 0x07C /* shadow write sticky lock */
|
||||
#define BSEC_SRLOCK_OFF 0x094 /* shadow read sticky lock */
|
||||
#define BSEC_OTP_DATA_OFF 0x200
|
||||
|
||||
/* BSEC_CONFIGURATION Register MASK */
|
||||
@ -46,12 +47,33 @@
|
||||
#define BSEC_MODE_PROGFAIL_MASK 0x10
|
||||
#define BSEC_MODE_PWR_MASK 0x20
|
||||
|
||||
/* DENABLE Register */
|
||||
#define BSEC_DENABLE_DBGSWENABLE BIT(10)
|
||||
|
||||
/*
|
||||
* OTP Lock services definition
|
||||
* Value must corresponding to the bit number in the register
|
||||
*/
|
||||
#define BSEC_LOCK_PROGRAM 0x04
|
||||
|
||||
/**
|
||||
* bsec_lock() - manage lock for each type SR/SP/SW
|
||||
* @address: address of bsec IP register
|
||||
* @otp: otp number (0 - BSEC_OTP_MAX_VALUE)
|
||||
* Return: true if locked else false
|
||||
*/
|
||||
static bool bsec_read_lock(u32 address, u32 otp)
|
||||
{
|
||||
u32 bit;
|
||||
u32 bank;
|
||||
|
||||
bit = 1 << (otp & OTP_LOCK_MASK);
|
||||
bank = ((otp >> OTP_LOCK_BANK_SHIFT) & OTP_LOCK_MASK) * sizeof(u32);
|
||||
|
||||
return !!(readl(address + bank) & bit);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
/**
|
||||
* bsec_check_error() - Check status of one otp
|
||||
* @base: base address of bsec IP
|
||||
@ -74,23 +96,6 @@ static u32 bsec_check_error(u32 base, u32 otp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* bsec_lock() - manage lock for each type SR/SP/SW
|
||||
* @address: address of bsec IP register
|
||||
* @otp: otp number (0 - BSEC_OTP_MAX_VALUE)
|
||||
* Return: true if locked else false
|
||||
*/
|
||||
static bool bsec_read_lock(u32 address, u32 otp)
|
||||
{
|
||||
u32 bit;
|
||||
u32 bank;
|
||||
|
||||
bit = 1 << (otp & OTP_LOCK_MASK);
|
||||
bank = ((otp >> OTP_LOCK_BANK_SHIFT) & OTP_LOCK_MASK) * sizeof(u32);
|
||||
|
||||
return !!(readl(address + bank) & bit);
|
||||
}
|
||||
|
||||
/**
|
||||
* bsec_read_SR_lock() - read SR lock (Shadowing)
|
||||
* @base: base address of bsec IP
|
||||
@ -324,6 +329,16 @@ static int stm32mp_bsec_read_shadow(struct udevice *dev, u32 *val, u32 otp)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int stm32mp_bsec_read_lock(struct udevice *dev, u32 *val, u32 otp)
|
||||
{
|
||||
struct stm32mp_bsec_platdata *plat = dev_get_platdata(dev);
|
||||
|
||||
/* return OTP permanent write lock status */
|
||||
*val = bsec_read_lock(plat->base + BSEC_WRLOCK_OFF, otp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int stm32mp_bsec_write_otp(struct udevice *dev, u32 val, u32 otp)
|
||||
{
|
||||
#ifdef CONFIG_STM32MP1_TRUSTED
|
||||
@ -350,22 +365,41 @@ static int stm32mp_bsec_write_shadow(struct udevice *dev, u32 val, u32 otp)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int stm32mp_bsec_write_lock(struct udevice *dev, u32 val, u32 otp)
|
||||
{
|
||||
#ifdef CONFIG_STM32MP1_TRUSTED
|
||||
if (val == 1)
|
||||
return stm32_smc_exec(STM32_SMC_BSEC,
|
||||
STM32_SMC_WRLOCK_OTP,
|
||||
otp, 0);
|
||||
if (val == 0)
|
||||
return 0; /* nothing to do */
|
||||
|
||||
return -EINVAL;
|
||||
#else
|
||||
return -ENOTSUPP;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int stm32mp_bsec_read(struct udevice *dev, int offset,
|
||||
void *buf, int size)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
bool shadow = true;
|
||||
bool shadow = true, lock = false;
|
||||
int nb_otp = size / sizeof(u32);
|
||||
int otp;
|
||||
unsigned int offs = offset;
|
||||
|
||||
if (offs >= STM32_BSEC_OTP_OFFSET) {
|
||||
if (offs >= STM32_BSEC_LOCK_OFFSET) {
|
||||
offs -= STM32_BSEC_LOCK_OFFSET;
|
||||
lock = true;
|
||||
} else if (offs >= STM32_BSEC_OTP_OFFSET) {
|
||||
offs -= STM32_BSEC_OTP_OFFSET;
|
||||
shadow = false;
|
||||
}
|
||||
|
||||
if (offs < 0 || (offs % 4) || (size % 4))
|
||||
if ((offs % 4) || (size % 4))
|
||||
return -EINVAL;
|
||||
|
||||
otp = offs / sizeof(u32);
|
||||
@ -373,7 +407,9 @@ static int stm32mp_bsec_read(struct udevice *dev, int offset,
|
||||
for (i = otp; i < (otp + nb_otp) && i <= BSEC_OTP_MAX_VALUE; i++) {
|
||||
u32 *addr = &((u32 *)buf)[i - otp];
|
||||
|
||||
if (shadow)
|
||||
if (lock)
|
||||
ret = stm32mp_bsec_read_lock(dev, addr, i);
|
||||
else if (shadow)
|
||||
ret = stm32mp_bsec_read_shadow(dev, addr, i);
|
||||
else
|
||||
ret = stm32mp_bsec_read_otp(dev, addr, i);
|
||||
@ -392,17 +428,20 @@ static int stm32mp_bsec_write(struct udevice *dev, int offset,
|
||||
{
|
||||
int ret = 0;
|
||||
int i;
|
||||
bool shadow = true;
|
||||
bool shadow = true, lock = false;
|
||||
int nb_otp = size / sizeof(u32);
|
||||
int otp;
|
||||
unsigned int offs = offset;
|
||||
|
||||
if (offs >= STM32_BSEC_OTP_OFFSET) {
|
||||
if (offs >= STM32_BSEC_LOCK_OFFSET) {
|
||||
offs -= STM32_BSEC_LOCK_OFFSET;
|
||||
lock = true;
|
||||
} else if (offs >= STM32_BSEC_OTP_OFFSET) {
|
||||
offs -= STM32_BSEC_OTP_OFFSET;
|
||||
shadow = false;
|
||||
}
|
||||
|
||||
if (offs < 0 || (offs % 4) || (size % 4))
|
||||
if ((offs % 4) || (size % 4))
|
||||
return -EINVAL;
|
||||
|
||||
otp = offs / sizeof(u32);
|
||||
@ -410,7 +449,9 @@ static int stm32mp_bsec_write(struct udevice *dev, int offset,
|
||||
for (i = otp; i < otp + nb_otp && i <= BSEC_OTP_MAX_VALUE; i++) {
|
||||
u32 *val = &((u32 *)buf)[i - otp];
|
||||
|
||||
if (shadow)
|
||||
if (lock)
|
||||
ret = stm32mp_bsec_write_lock(dev, *val, i);
|
||||
else if (shadow)
|
||||
ret = stm32mp_bsec_write_shadow(dev, *val, i);
|
||||
else
|
||||
ret = stm32mp_bsec_write_otp(dev, *val, i);
|
||||
@ -437,7 +478,7 @@ static int stm32mp_bsec_ofdata_to_platdata(struct udevice *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
#if !defined(CONFIG_STM32MP1_TRUSTED) && !defined(CONFIG_SPL_BUILD)
|
||||
static int stm32mp_bsec_probe(struct udevice *dev)
|
||||
{
|
||||
int otp;
|
||||
@ -464,7 +505,27 @@ U_BOOT_DRIVER(stm32mp_bsec) = {
|
||||
.ofdata_to_platdata = stm32mp_bsec_ofdata_to_platdata,
|
||||
.platdata_auto_alloc_size = sizeof(struct stm32mp_bsec_platdata),
|
||||
.ops = &stm32mp_bsec_ops,
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
#if !defined(CONFIG_STM32MP1_TRUSTED) && !defined(CONFIG_SPL_BUILD)
|
||||
.probe = stm32mp_bsec_probe,
|
||||
#endif
|
||||
};
|
||||
|
||||
bool bsec_dbgswenable(void)
|
||||
{
|
||||
struct udevice *dev;
|
||||
struct stm32mp_bsec_platdata *plat;
|
||||
int ret;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||
DM_GET_DRIVER(stm32mp_bsec), &dev);
|
||||
if (ret || !dev) {
|
||||
pr_debug("bsec driver not available\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
plat = dev_get_platdata(dev);
|
||||
if (readl(plat->base + BSEC_DENABLE_OFF) & BSEC_DENABLE_DBGSWENABLE)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
9
arch/arm/mach-stm32mp/cmd_stm32prog/Makefile
Normal file
9
arch/arm/mach-stm32mp/cmd_stm32prog/Makefile
Normal file
@ -0,0 +1,9 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2020, STMicroelectronics - All Rights Reserved
|
||||
#
|
||||
|
||||
obj-y += cmd_stm32prog.o
|
||||
obj-y += stm32prog.o
|
||||
obj-y += stm32prog_serial.o
|
||||
obj-y += stm32prog_usb.o
|
||||
191
arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
Normal file
191
arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
Normal file
@ -0,0 +1,191 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2020, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <dfu.h>
|
||||
#include <image.h>
|
||||
#include <asm/arch/stm32prog.h>
|
||||
#include "stm32prog.h"
|
||||
|
||||
struct stm32prog_data *stm32prog_data;
|
||||
|
||||
static void enable_vidconsole(void)
|
||||
{
|
||||
#ifdef CONFIG_DM_VIDEO
|
||||
char *stdname;
|
||||
char buf[64];
|
||||
|
||||
stdname = env_get("stdout");
|
||||
if (!stdname || !strstr(stdname, "vidconsole")) {
|
||||
if (!stdname)
|
||||
snprintf(buf, sizeof(buf), "serial,vidconsole");
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s,vidconsole", stdname);
|
||||
env_set("stdout", buf);
|
||||
}
|
||||
|
||||
stdname = env_get("stderr");
|
||||
if (!stdname || !strstr(stdname, "vidconsole")) {
|
||||
if (!stdname)
|
||||
snprintf(buf, sizeof(buf), "serial,vidconsole");
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s,vidconsole", stdname);
|
||||
env_set("stderr", buf);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static int do_stm32prog(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
ulong addr, size;
|
||||
int dev, ret;
|
||||
enum stm32prog_link_t link = LINK_UNDEFINED;
|
||||
bool reset = false;
|
||||
struct image_header_s header;
|
||||
struct stm32prog_data *data;
|
||||
u32 uimage, dtb;
|
||||
|
||||
if (argc < 3 || argc > 5)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (!strcmp(argv[1], "usb"))
|
||||
link = LINK_USB;
|
||||
else if (!strcmp(argv[1], "serial"))
|
||||
link = LINK_SERIAL;
|
||||
|
||||
if (link == LINK_UNDEFINED) {
|
||||
pr_err("not supported link=%s\n", argv[1]);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
dev = (int)simple_strtoul(argv[2], NULL, 10);
|
||||
|
||||
addr = STM32_DDR_BASE;
|
||||
size = 0;
|
||||
if (argc > 3) {
|
||||
addr = simple_strtoul(argv[3], NULL, 16);
|
||||
if (!addr)
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
if (argc > 4)
|
||||
size = simple_strtoul(argv[4], NULL, 16);
|
||||
|
||||
/* check STM32IMAGE presence */
|
||||
if (size == 0 &&
|
||||
!stm32prog_header_check((struct raw_header_s *)addr, &header)) {
|
||||
size = header.image_length + BL_HEADER_SIZE;
|
||||
|
||||
/* uImage detected in STM32IMAGE, execute the script */
|
||||
if (IMAGE_FORMAT_LEGACY ==
|
||||
genimg_get_format((void *)(addr + BL_HEADER_SIZE)))
|
||||
return source(addr + BL_HEADER_SIZE, "script@1");
|
||||
}
|
||||
|
||||
enable_vidconsole();
|
||||
|
||||
data = (struct stm32prog_data *)malloc(sizeof(*data));
|
||||
|
||||
if (!data) {
|
||||
pr_err("Alloc failed.");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
stm32prog_data = data;
|
||||
|
||||
ret = stm32prog_init(data, addr, size);
|
||||
if (ret)
|
||||
printf("Invalid or missing layout file.");
|
||||
|
||||
/* prepare DFU for device read/write */
|
||||
ret = stm32prog_dfu_init(data);
|
||||
if (ret)
|
||||
goto cleanup;
|
||||
|
||||
switch (link) {
|
||||
case LINK_SERIAL:
|
||||
ret = stm32prog_serial_init(data, dev);
|
||||
if (ret)
|
||||
goto cleanup;
|
||||
reset = stm32prog_serial_loop(data);
|
||||
break;
|
||||
case LINK_USB:
|
||||
reset = stm32prog_usb_loop(data, dev);
|
||||
break;
|
||||
default:
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
uimage = data->uimage;
|
||||
dtb = data->dtb;
|
||||
|
||||
stm32prog_clean(data);
|
||||
free(stm32prog_data);
|
||||
stm32prog_data = NULL;
|
||||
|
||||
puts("Download done\n");
|
||||
|
||||
if (uimage) {
|
||||
char boot_addr_start[20];
|
||||
char dtb_addr[20];
|
||||
char *bootm_argv[5] = {
|
||||
"bootm", boot_addr_start, "-", dtb_addr, NULL
|
||||
};
|
||||
if (!dtb)
|
||||
bootm_argv[3] = env_get("fdtcontroladdr");
|
||||
else
|
||||
snprintf(dtb_addr, sizeof(dtb_addr) - 1,
|
||||
"0x%x", dtb);
|
||||
|
||||
snprintf(boot_addr_start, sizeof(boot_addr_start) - 1,
|
||||
"0x%x", uimage);
|
||||
printf("Booting kernel at %s - %s...\n\n\n",
|
||||
boot_addr_start, bootm_argv[3]);
|
||||
/* Try bootm for legacy and FIT format image */
|
||||
if (genimg_get_format((void *)uimage) != IMAGE_FORMAT_INVALID)
|
||||
do_bootm(cmdtp, 0, 4, bootm_argv);
|
||||
else if CONFIG_IS_ENABLED(CMD_BOOTZ)
|
||||
do_bootz(cmdtp, 0, 4, bootm_argv);
|
||||
}
|
||||
|
||||
if (reset) {
|
||||
puts("Reset...\n");
|
||||
run_command("reset", 0);
|
||||
}
|
||||
|
||||
return CMD_RET_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
stm32prog_clean(data);
|
||||
free(stm32prog_data);
|
||||
stm32prog_data = NULL;
|
||||
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(stm32prog, 5, 0, do_stm32prog,
|
||||
"<link> <dev> [<addr>] [<size>]\n"
|
||||
"start communication with tools STM32Cubeprogrammer on <link> with Flashlayout at <addr>",
|
||||
"<link> = serial|usb\n"
|
||||
"<dev> = device instance\n"
|
||||
"<addr> = address of flashlayout\n"
|
||||
"<size> = size of flashlayout\n"
|
||||
);
|
||||
|
||||
bool stm32prog_get_tee_partitions(void)
|
||||
{
|
||||
if (stm32prog_data)
|
||||
return stm32prog_data->tee_detected;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool stm32prog_get_fsbl_nor(void)
|
||||
{
|
||||
if (stm32prog_data)
|
||||
return stm32prog_data->fsbl_nor_detected;
|
||||
|
||||
return false;
|
||||
}
|
||||
1743
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
Normal file
1743
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
Normal file
File diff suppressed because it is too large
Load Diff
185
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
Normal file
185
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
Normal file
@ -0,0 +1,185 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2020, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#ifndef _STM32PROG_H_
|
||||
#define _STM32PROG_H_
|
||||
|
||||
/* - phase defines ------------------------------------------------*/
|
||||
#define PHASE_FLASHLAYOUT 0x00
|
||||
#define PHASE_FIRST_USER 0x10
|
||||
#define PHASE_LAST_USER 0xF0
|
||||
#define PHASE_CMD 0xF1
|
||||
#define PHASE_OTP 0xF2
|
||||
#define PHASE_PMIC 0xF4
|
||||
#define PHASE_END 0xFE
|
||||
#define PHASE_RESET 0xFF
|
||||
#define PHASE_DO_RESET 0x1FF
|
||||
|
||||
#define DEFAULT_ADDRESS 0xFFFFFFFF
|
||||
|
||||
#define OTP_SIZE 1024
|
||||
#define PMIC_SIZE 8
|
||||
|
||||
enum stm32prog_target {
|
||||
STM32PROG_NONE,
|
||||
STM32PROG_MMC,
|
||||
STM32PROG_NAND,
|
||||
STM32PROG_NOR,
|
||||
STM32PROG_SPI_NAND,
|
||||
STM32PROG_RAM
|
||||
};
|
||||
|
||||
enum stm32prog_link_t {
|
||||
LINK_SERIAL,
|
||||
LINK_USB,
|
||||
LINK_UNDEFINED,
|
||||
};
|
||||
|
||||
struct image_header_s {
|
||||
bool present;
|
||||
u32 image_checksum;
|
||||
u32 image_length;
|
||||
};
|
||||
|
||||
struct raw_header_s {
|
||||
u32 magic_number;
|
||||
u32 image_signature[64 / 4];
|
||||
u32 image_checksum;
|
||||
u32 header_version;
|
||||
u32 image_length;
|
||||
u32 image_entry_point;
|
||||
u32 reserved1;
|
||||
u32 load_address;
|
||||
u32 reserved2;
|
||||
u32 version_number;
|
||||
u32 option_flags;
|
||||
u32 ecdsa_algorithm;
|
||||
u32 ecdsa_public_key[64 / 4];
|
||||
u32 padding[83 / 4];
|
||||
u32 binary_type;
|
||||
};
|
||||
|
||||
#define BL_HEADER_SIZE sizeof(struct raw_header_s)
|
||||
|
||||
/* partition type in flashlayout file */
|
||||
enum stm32prog_part_type {
|
||||
PART_BINARY,
|
||||
PART_SYSTEM,
|
||||
PART_FILESYSTEM,
|
||||
RAW_IMAGE
|
||||
};
|
||||
|
||||
/* device information */
|
||||
struct stm32prog_dev_t {
|
||||
enum stm32prog_target target;
|
||||
char dev_id;
|
||||
u32 erase_size;
|
||||
struct mmc *mmc;
|
||||
struct mtd_info *mtd;
|
||||
/* list of partition for this device / ordered in offset */
|
||||
struct list_head part_list;
|
||||
bool full_update;
|
||||
};
|
||||
|
||||
/* partition information build from FlashLayout and device */
|
||||
struct stm32prog_part_t {
|
||||
/* FlashLayout information */
|
||||
int option;
|
||||
int id;
|
||||
enum stm32prog_part_type part_type;
|
||||
enum stm32prog_target target;
|
||||
char dev_id;
|
||||
|
||||
/* partition name
|
||||
* (16 char in gpt, + 1 for null terminated string
|
||||
*/
|
||||
char name[16 + 1];
|
||||
u64 addr;
|
||||
u64 size;
|
||||
enum stm32prog_part_type bin_nb; /* SSBL repeatition */
|
||||
|
||||
/* information on associated device */
|
||||
struct stm32prog_dev_t *dev; /* pointer to device */
|
||||
s16 part_id; /* partition id in device */
|
||||
int alt_id; /* alt id in usb/dfu */
|
||||
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
#define STM32PROG_MAX_DEV 5
|
||||
struct stm32prog_data {
|
||||
/* Layout information */
|
||||
int dev_nb; /* device number*/
|
||||
struct stm32prog_dev_t dev[STM32PROG_MAX_DEV]; /* array of device */
|
||||
int part_nb; /* nb of partition */
|
||||
struct stm32prog_part_t *part_array; /* array of partition */
|
||||
bool tee_detected;
|
||||
bool fsbl_nor_detected;
|
||||
|
||||
/* command internal information */
|
||||
unsigned int phase;
|
||||
u32 offset;
|
||||
char error[255];
|
||||
struct stm32prog_part_t *cur_part;
|
||||
u32 *otp_part;
|
||||
u8 pmic_part[PMIC_SIZE];
|
||||
|
||||
/* STM32 header information */
|
||||
struct raw_header_s *header_data;
|
||||
struct image_header_s header;
|
||||
|
||||
/* SERIAL information */
|
||||
u32 cursor;
|
||||
u32 packet_number;
|
||||
u32 checksum;
|
||||
u8 *buffer; /* size = USART_RAM_BUFFER_SIZE*/
|
||||
int dfu_seq;
|
||||
u8 read_phase;
|
||||
|
||||
/* bootm information */
|
||||
u32 uimage;
|
||||
u32 dtb;
|
||||
};
|
||||
|
||||
extern struct stm32prog_data *stm32prog_data;
|
||||
|
||||
/* OTP access */
|
||||
int stm32prog_otp_write(struct stm32prog_data *data, u32 offset,
|
||||
u8 *buffer, long *size);
|
||||
int stm32prog_otp_read(struct stm32prog_data *data, u32 offset,
|
||||
u8 *buffer, long *size);
|
||||
int stm32prog_otp_start(struct stm32prog_data *data);
|
||||
|
||||
/* PMIC access */
|
||||
int stm32prog_pmic_write(struct stm32prog_data *data, u32 offset,
|
||||
u8 *buffer, long *size);
|
||||
int stm32prog_pmic_read(struct stm32prog_data *data, u32 offset,
|
||||
u8 *buffer, long *size);
|
||||
int stm32prog_pmic_start(struct stm32prog_data *data);
|
||||
|
||||
/* generic part*/
|
||||
u8 stm32prog_header_check(struct raw_header_s *raw_header,
|
||||
struct image_header_s *header);
|
||||
int stm32prog_dfu_init(struct stm32prog_data *data);
|
||||
void stm32prog_next_phase(struct stm32prog_data *data);
|
||||
void stm32prog_do_reset(struct stm32prog_data *data);
|
||||
|
||||
char *stm32prog_get_error(struct stm32prog_data *data);
|
||||
|
||||
#define stm32prog_err(args...) {\
|
||||
if (data->phase != PHASE_RESET) { \
|
||||
sprintf(data->error, args); \
|
||||
data->phase = PHASE_RESET; \
|
||||
pr_err("Error: %s\n", data->error); } \
|
||||
}
|
||||
|
||||
/* Main function */
|
||||
int stm32prog_init(struct stm32prog_data *data, ulong addr, ulong size);
|
||||
int stm32prog_serial_init(struct stm32prog_data *data, int link_dev);
|
||||
bool stm32prog_serial_loop(struct stm32prog_data *data);
|
||||
bool stm32prog_usb_loop(struct stm32prog_data *data, int dev);
|
||||
void stm32prog_clean(struct stm32prog_data *data);
|
||||
|
||||
#endif
|
||||
993
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c
Normal file
993
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c
Normal file
@ -0,0 +1,993 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2020, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <console.h>
|
||||
#include <dfu.h>
|
||||
#include <malloc.h>
|
||||
#include <serial.h>
|
||||
#include <watchdog.h>
|
||||
#include <dm/lists.h>
|
||||
#include <dm/device-internal.h>
|
||||
#include "stm32prog.h"
|
||||
|
||||
/* - configuration part -----------------------------*/
|
||||
#define USART_BL_VERSION 0x40 /* USART bootloader version V4.0*/
|
||||
#define UBOOT_BL_VERSION 0x03 /* bootloader version V0.3*/
|
||||
#define DEVICE_ID_BYTE1 0x05 /* MSB byte of device ID*/
|
||||
#define DEVICE_ID_BYTE2 0x00 /* LSB byte of device ID*/
|
||||
#define USART_RAM_BUFFER_SIZE 256 /* Size of USART_RAM_Buf buffer*/
|
||||
|
||||
/* - Commands -----------------------------*/
|
||||
#define GET_CMD_COMMAND 0x00 /* Get CMD command*/
|
||||
#define GET_VER_COMMAND 0x01 /* Get Version command*/
|
||||
#define GET_ID_COMMAND 0x02 /* Get ID command*/
|
||||
#define GET_PHASE_COMMAND 0x03 /* Get Phase command*/
|
||||
#define RM_COMMAND 0x11 /* Read Memory command*/
|
||||
#define READ_PART_COMMAND 0x12 /* Read Partition command*/
|
||||
#define START_COMMAND 0x21 /* START command (Go)*/
|
||||
#define DOWNLOAD_COMMAND 0x31 /* Download command*/
|
||||
/* existing command for other STM32 but not used */
|
||||
/* ERASE 0x43 */
|
||||
/* EXTENDED_ERASE 0x44 */
|
||||
/* WRITE_UNPROTECTED 0x73 */
|
||||
/* READOUT_PROTECT 0x82 */
|
||||
/* READOUT_UNPROTECT 0x92 */
|
||||
|
||||
/* - miscellaneous defines ----------------------------------------*/
|
||||
#define INIT_BYTE 0x7F /*Init Byte ID*/
|
||||
#define ACK_BYTE 0x79 /*Acknowlede Byte ID*/
|
||||
#define NACK_BYTE 0x1F /*No Acknowlede Byte ID*/
|
||||
#define ABORT_BYTE 0x5F /*ABORT*/
|
||||
|
||||
struct udevice *down_serial_dev;
|
||||
|
||||
const u8 cmd_id[] = {
|
||||
GET_CMD_COMMAND,
|
||||
GET_VER_COMMAND,
|
||||
GET_ID_COMMAND,
|
||||
GET_PHASE_COMMAND,
|
||||
RM_COMMAND,
|
||||
READ_PART_COMMAND,
|
||||
START_COMMAND,
|
||||
DOWNLOAD_COMMAND
|
||||
};
|
||||
|
||||
#define NB_CMD sizeof(cmd_id)
|
||||
|
||||
/* DFU support for serial *********************************************/
|
||||
static struct dfu_entity *stm32prog_get_entity(struct stm32prog_data *data)
|
||||
{
|
||||
int alt_id;
|
||||
|
||||
if (!data->cur_part)
|
||||
if (data->phase == PHASE_FLASHLAYOUT)
|
||||
alt_id = 0;
|
||||
else
|
||||
return NULL;
|
||||
else
|
||||
alt_id = data->cur_part->alt_id;
|
||||
|
||||
return dfu_get_entity(alt_id);
|
||||
}
|
||||
|
||||
static int stm32prog_write(struct stm32prog_data *data, u8 *buffer,
|
||||
u32 buffer_size)
|
||||
{
|
||||
struct dfu_entity *dfu_entity;
|
||||
u8 ret = 0;
|
||||
|
||||
dfu_entity = stm32prog_get_entity(data);
|
||||
if (!dfu_entity)
|
||||
return -ENODEV;
|
||||
|
||||
ret = dfu_write(dfu_entity,
|
||||
buffer,
|
||||
buffer_size,
|
||||
data->dfu_seq);
|
||||
|
||||
if (ret) {
|
||||
stm32prog_err("DFU write failed [%d] cnt: %d",
|
||||
ret, data->dfu_seq);
|
||||
}
|
||||
data->dfu_seq++;
|
||||
/* handle rollover as in driver/dfu/dfu.c */
|
||||
data->dfu_seq &= 0xffff;
|
||||
if (buffer_size == 0)
|
||||
data->dfu_seq = 0; /* flush done */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int stm32prog_read(struct stm32prog_data *data, u8 phase, u32 offset,
|
||||
u8 *buffer, u32 buffer_size)
|
||||
{
|
||||
struct dfu_entity *dfu_entity;
|
||||
struct stm32prog_part_t *part;
|
||||
u32 size;
|
||||
int ret, i;
|
||||
|
||||
if (data->dfu_seq) {
|
||||
stm32prog_err("DFU write pending for phase %d, seq %d",
|
||||
data->phase, data->dfu_seq);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (phase == PHASE_FLASHLAYOUT || phase > PHASE_LAST_USER) {
|
||||
stm32prog_err("read failed : phase %d is invalid", phase);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (data->read_phase <= PHASE_LAST_USER &&
|
||||
phase != data->read_phase) {
|
||||
/* clear previous read session */
|
||||
dfu_entity = dfu_get_entity(data->read_phase - 1);
|
||||
if (dfu_entity)
|
||||
dfu_transaction_cleanup(dfu_entity);
|
||||
}
|
||||
|
||||
dfu_entity = NULL;
|
||||
/* found partition for the expected phase */
|
||||
for (i = 0; i < data->part_nb; i++) {
|
||||
part = &data->part_array[i];
|
||||
if (part->id == phase)
|
||||
dfu_entity = dfu_get_entity(part->alt_id);
|
||||
}
|
||||
if (!dfu_entity) {
|
||||
stm32prog_err("read failed : phase %d is unknown", phase);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* clear pending read before to force offset */
|
||||
if (dfu_entity->inited &&
|
||||
(data->read_phase != phase || data->offset != offset))
|
||||
dfu_transaction_cleanup(dfu_entity);
|
||||
|
||||
/* initiate before to force offset */
|
||||
if (!dfu_entity->inited) {
|
||||
ret = dfu_transaction_initiate(dfu_entity, true);
|
||||
if (ret < 0) {
|
||||
stm32prog_err("DFU read init failed [%d] phase = %d offset = 0x%08x",
|
||||
ret, phase, offset);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
/* force new offset */
|
||||
if (dfu_entity->offset != offset)
|
||||
dfu_entity->offset = offset;
|
||||
data->offset = offset;
|
||||
data->read_phase = phase;
|
||||
pr_debug("\nSTM32 download read %s offset=0x%x\n",
|
||||
dfu_entity->name, offset);
|
||||
ret = dfu_read(dfu_entity, buffer, buffer_size,
|
||||
dfu_entity->i_blk_seq_num);
|
||||
if (ret < 0) {
|
||||
stm32prog_err("DFU read failed [%d] phase = %d offset = 0x%08x",
|
||||
ret, phase, offset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
size = ret;
|
||||
|
||||
if (size < buffer_size) {
|
||||
data->offset = 0;
|
||||
data->read_phase = PHASE_END;
|
||||
memset(buffer + size, 0, buffer_size - size);
|
||||
} else {
|
||||
data->offset += size;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* UART access ***************************************************/
|
||||
int stm32prog_serial_init(struct stm32prog_data *data, int link_dev)
|
||||
{
|
||||
struct udevice *dev = NULL;
|
||||
int node;
|
||||
char alias[10];
|
||||
const char *path;
|
||||
struct dm_serial_ops *ops;
|
||||
/* no parity, 8 bits, 1 stop */
|
||||
u32 serial_config = SERIAL_DEFAULT_CONFIG;
|
||||
|
||||
down_serial_dev = NULL;
|
||||
|
||||
sprintf(alias, "serial%d", link_dev);
|
||||
path = fdt_get_alias(gd->fdt_blob, alias);
|
||||
if (!path) {
|
||||
pr_err("%s alias not found", alias);
|
||||
return -ENODEV;
|
||||
}
|
||||
node = fdt_path_offset(gd->fdt_blob, path);
|
||||
if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node,
|
||||
&dev)) {
|
||||
down_serial_dev = dev;
|
||||
} else if (node > 0 &&
|
||||
!lists_bind_fdt(gd->dm_root, offset_to_ofnode(node),
|
||||
&dev, false)) {
|
||||
if (!device_probe(dev))
|
||||
down_serial_dev = dev;
|
||||
}
|
||||
if (!down_serial_dev) {
|
||||
pr_err("%s = %s device not found", alias, path);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* force silent console on uart only when used */
|
||||
if (gd->cur_serial_dev == down_serial_dev)
|
||||
gd->flags |= GD_FLG_DISABLE_CONSOLE | GD_FLG_SILENT;
|
||||
else
|
||||
gd->flags &= ~(GD_FLG_DISABLE_CONSOLE | GD_FLG_SILENT);
|
||||
|
||||
ops = serial_get_ops(down_serial_dev);
|
||||
|
||||
if (!ops) {
|
||||
pr_err("%s = %s missing ops", alias, path);
|
||||
return -ENODEV;
|
||||
}
|
||||
if (!ops->setconfig) {
|
||||
pr_err("%s = %s missing setconfig", alias, path);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
clrsetbits_le32(&serial_config, SERIAL_PAR_MASK, SERIAL_PAR_EVEN);
|
||||
|
||||
data->buffer = memalign(CONFIG_SYS_CACHELINE_SIZE,
|
||||
USART_RAM_BUFFER_SIZE);
|
||||
|
||||
return ops->setconfig(down_serial_dev, serial_config);
|
||||
}
|
||||
|
||||
static void stm32prog_serial_flush(void)
|
||||
{
|
||||
struct dm_serial_ops *ops = serial_get_ops(down_serial_dev);
|
||||
int err;
|
||||
|
||||
do {
|
||||
err = ops->getc(down_serial_dev);
|
||||
} while (err != -EAGAIN);
|
||||
}
|
||||
|
||||
static int stm32prog_serial_getc_err(void)
|
||||
{
|
||||
struct dm_serial_ops *ops = serial_get_ops(down_serial_dev);
|
||||
int err;
|
||||
|
||||
do {
|
||||
err = ops->getc(down_serial_dev);
|
||||
if (err == -EAGAIN) {
|
||||
ctrlc();
|
||||
WATCHDOG_RESET();
|
||||
}
|
||||
} while ((err == -EAGAIN) && (!had_ctrlc()));
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static u8 stm32prog_serial_getc(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = stm32prog_serial_getc_err();
|
||||
|
||||
return err >= 0 ? err : 0;
|
||||
}
|
||||
|
||||
static bool stm32prog_serial_get_buffer(u8 *buffer, u32 *count)
|
||||
{
|
||||
struct dm_serial_ops *ops = serial_get_ops(down_serial_dev);
|
||||
int err;
|
||||
|
||||
do {
|
||||
err = ops->getc(down_serial_dev);
|
||||
if (err >= 0) {
|
||||
*buffer++ = err;
|
||||
*count -= 1;
|
||||
} else if (err == -EAGAIN) {
|
||||
ctrlc();
|
||||
WATCHDOG_RESET();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} while (*count && !had_ctrlc());
|
||||
|
||||
return !!(err < 0);
|
||||
}
|
||||
|
||||
static void stm32prog_serial_putc(u8 w_byte)
|
||||
{
|
||||
struct dm_serial_ops *ops = serial_get_ops(down_serial_dev);
|
||||
int err;
|
||||
|
||||
do {
|
||||
err = ops->putc(down_serial_dev, w_byte);
|
||||
} while (err == -EAGAIN);
|
||||
}
|
||||
|
||||
/* Helper function ************************************************/
|
||||
|
||||
static u8 stm32prog_header(struct stm32prog_data *data)
|
||||
{
|
||||
u8 ret;
|
||||
u8 boot = 0;
|
||||
struct dfu_entity *dfu_entity;
|
||||
u64 size = 0;
|
||||
|
||||
dfu_entity = stm32prog_get_entity(data);
|
||||
if (!dfu_entity)
|
||||
return -ENODEV;
|
||||
|
||||
printf("\nSTM32 download write %s\n", dfu_entity->name);
|
||||
|
||||
/* force cleanup to avoid issue with previous read */
|
||||
dfu_transaction_cleanup(dfu_entity);
|
||||
|
||||
ret = stm32prog_header_check(data->header_data,
|
||||
&data->header);
|
||||
|
||||
/* no header : max size is partition size */
|
||||
if (ret) {
|
||||
dfu_entity->get_medium_size(dfu_entity, &size);
|
||||
data->header.image_length = size;
|
||||
}
|
||||
|
||||
/**** Flash the header if necessary for boot partition */
|
||||
if (data->phase < PHASE_FIRST_USER)
|
||||
boot = 1;
|
||||
|
||||
/* write header if boot partition */
|
||||
if (boot) {
|
||||
if (ret) {
|
||||
stm32prog_err("invalid header (error %d)", ret);
|
||||
} else {
|
||||
ret = stm32prog_write(data,
|
||||
(u8 *)data->header_data,
|
||||
BL_HEADER_SIZE);
|
||||
}
|
||||
} else {
|
||||
if (ret)
|
||||
printf(" partition without checksum\n");
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
free(data->header_data);
|
||||
data->header_data = NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static u8 stm32prog_start(struct stm32prog_data *data, u32 address)
|
||||
{
|
||||
u8 ret = 0;
|
||||
struct dfu_entity *dfu_entity;
|
||||
|
||||
if (address < 0x100) {
|
||||
if (address == PHASE_OTP)
|
||||
return stm32prog_otp_start(data);
|
||||
|
||||
if (address == PHASE_PMIC)
|
||||
return stm32prog_pmic_start(data);
|
||||
|
||||
if (address == PHASE_RESET || address == PHASE_END) {
|
||||
data->cur_part = NULL;
|
||||
data->dfu_seq = 0;
|
||||
data->phase = address;
|
||||
return 0;
|
||||
}
|
||||
if (address != data->phase) {
|
||||
stm32prog_err("invalid received phase id %d, current phase is %d",
|
||||
(u8)address, (u8)data->phase);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
/* check the last loaded partition */
|
||||
if (address == DEFAULT_ADDRESS || address == data->phase) {
|
||||
switch (data->phase) {
|
||||
case PHASE_END:
|
||||
case PHASE_RESET:
|
||||
case PHASE_DO_RESET:
|
||||
data->cur_part = NULL;
|
||||
data->phase = PHASE_DO_RESET;
|
||||
return 0;
|
||||
}
|
||||
dfu_entity = stm32prog_get_entity(data);
|
||||
if (!dfu_entity)
|
||||
return -ENODEV;
|
||||
|
||||
if (data->dfu_seq) {
|
||||
ret = dfu_flush(dfu_entity, NULL, 0, data->dfu_seq);
|
||||
data->dfu_seq = 0;
|
||||
if (ret) {
|
||||
stm32prog_err("DFU flush failed [%d]", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
printf("\n received length = 0x%x\n", data->cursor);
|
||||
if (data->header.present) {
|
||||
if (data->cursor !=
|
||||
(data->header.image_length + BL_HEADER_SIZE)) {
|
||||
stm32prog_err("transmission interrupted (length=0x%x expected=0x%x)",
|
||||
data->cursor,
|
||||
data->header.image_length +
|
||||
BL_HEADER_SIZE);
|
||||
return -EIO;
|
||||
}
|
||||
if (data->header.image_checksum != data->checksum) {
|
||||
stm32prog_err("invalid checksum received (0x%x expected 0x%x)",
|
||||
data->checksum,
|
||||
data->header.image_checksum);
|
||||
return -EIO;
|
||||
}
|
||||
printf("\n checksum OK (0x%x)\n", data->checksum);
|
||||
}
|
||||
|
||||
/* update DFU with received flashlayout */
|
||||
if (data->phase == PHASE_FLASHLAYOUT)
|
||||
stm32prog_dfu_init(data);
|
||||
} else {
|
||||
void (*entry)(void) = (void *)address;
|
||||
|
||||
printf("## Starting application at 0x%x ...\n", address);
|
||||
(*entry)();
|
||||
printf("## Application terminated\n");
|
||||
ret = -ENOEXEC;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_address() - Get address if it is valid
|
||||
*
|
||||
* @tmp_xor: Current xor value to update
|
||||
* @return The address area
|
||||
*/
|
||||
static u32 get_address(u8 *tmp_xor)
|
||||
{
|
||||
u32 address = 0x0;
|
||||
u8 data;
|
||||
|
||||
data = stm32prog_serial_getc();
|
||||
*tmp_xor ^= data;
|
||||
address |= ((u32)data) << 24;
|
||||
|
||||
data = stm32prog_serial_getc();
|
||||
address |= ((u32)data) << 16;
|
||||
*tmp_xor ^= data;
|
||||
|
||||
data = stm32prog_serial_getc();
|
||||
address |= ((u32)data) << 8;
|
||||
*tmp_xor ^= data;
|
||||
|
||||
data = stm32prog_serial_getc();
|
||||
address |= ((u32)data);
|
||||
*tmp_xor ^= data;
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
static void stm32prog_serial_result(u8 result)
|
||||
{
|
||||
/* always flush fifo before to send result */
|
||||
stm32prog_serial_flush();
|
||||
stm32prog_serial_putc(result);
|
||||
}
|
||||
|
||||
/* Command -----------------------------------------------*/
|
||||
/**
|
||||
* get_cmd_command() - Respond to Get command
|
||||
*
|
||||
* @data: Current command context
|
||||
*/
|
||||
static void get_cmd_command(struct stm32prog_data *data)
|
||||
{
|
||||
u32 counter = 0x0;
|
||||
|
||||
stm32prog_serial_putc(NB_CMD);
|
||||
stm32prog_serial_putc(USART_BL_VERSION);
|
||||
|
||||
for (counter = 0; counter < NB_CMD; counter++)
|
||||
stm32prog_serial_putc(cmd_id[counter]);
|
||||
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
}
|
||||
|
||||
/**
|
||||
* get_version_command() - Respond to Get Version command
|
||||
*
|
||||
* @data: Current command context
|
||||
*/
|
||||
static void get_version_command(struct stm32prog_data *data)
|
||||
{
|
||||
stm32prog_serial_putc(UBOOT_BL_VERSION);
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
}
|
||||
|
||||
/**
|
||||
* get_id_command() - Respond to Get ID command
|
||||
*
|
||||
* @data: Current command context
|
||||
*/
|
||||
static void get_id_command(struct stm32prog_data *data)
|
||||
{
|
||||
/* Send Device IDCode */
|
||||
stm32prog_serial_putc(0x1);
|
||||
stm32prog_serial_putc(DEVICE_ID_BYTE1);
|
||||
stm32prog_serial_putc(DEVICE_ID_BYTE2);
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
}
|
||||
|
||||
/**
|
||||
* get_phase_command() - Respond to Get phase
|
||||
*
|
||||
* @data: Current command context
|
||||
*/
|
||||
static void get_phase_command(struct stm32prog_data *data)
|
||||
{
|
||||
char *err_msg = NULL;
|
||||
u8 i, length = 0;
|
||||
u32 destination = DEFAULT_ADDRESS; /* destination address */
|
||||
int phase = data->phase;
|
||||
|
||||
if (phase == PHASE_RESET || phase == PHASE_DO_RESET) {
|
||||
err_msg = stm32prog_get_error(data);
|
||||
length = strlen(err_msg);
|
||||
}
|
||||
if (phase == PHASE_FLASHLAYOUT)
|
||||
destination = STM32_DDR_BASE;
|
||||
|
||||
stm32prog_serial_putc(length + 5); /* Total length */
|
||||
stm32prog_serial_putc(phase & 0xFF); /* partition ID */
|
||||
stm32prog_serial_putc(destination); /* byte 1 of address */
|
||||
stm32prog_serial_putc(destination >> 8); /* byte 2 of address */
|
||||
stm32prog_serial_putc(destination >> 16); /* byte 3 of address */
|
||||
stm32prog_serial_putc(destination >> 24); /* byte 4 of address */
|
||||
|
||||
stm32prog_serial_putc(length); /* Information length */
|
||||
for (i = 0; i < length; i++)
|
||||
stm32prog_serial_putc(err_msg[i]);
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
|
||||
if (phase == PHASE_RESET)
|
||||
stm32prog_do_reset(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* read_memory_command() - Read data from memory
|
||||
*
|
||||
* @data: Current command context
|
||||
*/
|
||||
static void read_memory_command(struct stm32prog_data *data)
|
||||
{
|
||||
u32 address = 0x0;
|
||||
u8 rcv_data = 0x0, tmp_xor = 0x0;
|
||||
u32 counter = 0x0;
|
||||
|
||||
/* Read memory address */
|
||||
address = get_address(&tmp_xor);
|
||||
|
||||
/* If address memory is not received correctly */
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
if (rcv_data != tmp_xor) {
|
||||
stm32prog_serial_result(NACK_BYTE);
|
||||
return;
|
||||
}
|
||||
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
|
||||
/* Read the number of bytes to be received:
|
||||
* Max NbrOfData = Data + 1 = 256
|
||||
*/
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
tmp_xor = ~rcv_data;
|
||||
if (stm32prog_serial_getc() != tmp_xor) {
|
||||
stm32prog_serial_result(NACK_BYTE);
|
||||
return;
|
||||
}
|
||||
|
||||
/* If checksum is correct send ACK */
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
|
||||
/* Send data to the host:
|
||||
* Number of data to read = data + 1
|
||||
*/
|
||||
for (counter = (rcv_data + 1); counter != 0; counter--)
|
||||
stm32prog_serial_putc(*(u8 *)(address++));
|
||||
}
|
||||
|
||||
/**
|
||||
* start_command() - Respond to start command
|
||||
*
|
||||
* Jump to user application in RAM or partition check
|
||||
*
|
||||
* @data: Current command context
|
||||
*/
|
||||
static void start_command(struct stm32prog_data *data)
|
||||
{
|
||||
u32 address = 0;
|
||||
u8 tmp_xor = 0x0;
|
||||
u8 ret, rcv_data;
|
||||
|
||||
/* Read memory address */
|
||||
address = get_address(&tmp_xor);
|
||||
|
||||
/* If address memory is not received correctly */
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
if (rcv_data != tmp_xor) {
|
||||
stm32prog_serial_result(NACK_BYTE);
|
||||
return;
|
||||
}
|
||||
/* validate partition */
|
||||
ret = stm32prog_start(data,
|
||||
address);
|
||||
|
||||
if (ret)
|
||||
stm32prog_serial_result(ABORT_BYTE);
|
||||
else
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
}
|
||||
|
||||
/**
|
||||
* download_command() - Respond to download command
|
||||
*
|
||||
* Write data to not volatile memory, Flash
|
||||
*
|
||||
* @data: Current command context
|
||||
*/
|
||||
static void download_command(struct stm32prog_data *data)
|
||||
{
|
||||
u32 address = 0x0;
|
||||
u8 my_xor = 0x0;
|
||||
u8 rcv_xor;
|
||||
u32 counter = 0x0, codesize = 0x0;
|
||||
u8 *ramaddress = 0;
|
||||
u8 rcv_data = 0x0;
|
||||
struct image_header_s *image_header = &data->header;
|
||||
u32 cursor = data->cursor;
|
||||
long size = 0;
|
||||
u8 operation;
|
||||
u32 packet_number;
|
||||
u32 result = ACK_BYTE;
|
||||
u8 ret;
|
||||
unsigned int i;
|
||||
bool error;
|
||||
int rcv;
|
||||
|
||||
address = get_address(&my_xor);
|
||||
|
||||
/* If address memory is not received correctly */
|
||||
rcv_xor = stm32prog_serial_getc();
|
||||
if (rcv_xor != my_xor) {
|
||||
result = NACK_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* If address valid send ACK */
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
|
||||
/* get packet number and operation type */
|
||||
operation = (u8)((u32)address >> 24);
|
||||
packet_number = ((u32)(((u32)address << 8))) >> 8;
|
||||
|
||||
switch (operation) {
|
||||
/* supported operation */
|
||||
case PHASE_FLASHLAYOUT:
|
||||
case PHASE_OTP:
|
||||
case PHASE_PMIC:
|
||||
break;
|
||||
default:
|
||||
result = NACK_BYTE;
|
||||
goto end;
|
||||
}
|
||||
/* check the packet number */
|
||||
if (packet_number == 0) {
|
||||
/* erase: re-initialize the image_header struct */
|
||||
data->packet_number = 0;
|
||||
if (data->header_data)
|
||||
memset(data->header_data, 0, BL_HEADER_SIZE);
|
||||
else
|
||||
data->header_data = calloc(1, BL_HEADER_SIZE);
|
||||
cursor = 0;
|
||||
data->cursor = 0;
|
||||
data->checksum = 0;
|
||||
/*idx = cursor;*/
|
||||
} else {
|
||||
data->packet_number++;
|
||||
}
|
||||
|
||||
/* Check with the number of current packet if the device receive
|
||||
* the true packet
|
||||
*/
|
||||
if (packet_number != data->packet_number) {
|
||||
data->packet_number--;
|
||||
result = NACK_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/*-- Read number of bytes to be written and data -----------*/
|
||||
|
||||
/* Read the number of bytes to be written:
|
||||
* Max NbrOfData = data + 1 <= 256
|
||||
*/
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
|
||||
/* NbrOfData to write = data + 1 */
|
||||
codesize = rcv_data + 0x01;
|
||||
|
||||
if (codesize > USART_RAM_BUFFER_SIZE) {
|
||||
result = NACK_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Checksum Initialization */
|
||||
my_xor = rcv_data;
|
||||
|
||||
/* UART receive data and send to Buffer */
|
||||
counter = codesize;
|
||||
error = stm32prog_serial_get_buffer(data->buffer, &counter);
|
||||
|
||||
/* read checksum */
|
||||
if (!error) {
|
||||
rcv = stm32prog_serial_getc_err();
|
||||
error = !!(rcv < 0);
|
||||
rcv_xor = rcv;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
printf("transmission error on packet %d, byte %d\n",
|
||||
packet_number, codesize - counter);
|
||||
/* waiting end of packet before flush & NACK */
|
||||
mdelay(30);
|
||||
data->packet_number--;
|
||||
result = NACK_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Compute Checksum */
|
||||
ramaddress = data->buffer;
|
||||
for (counter = codesize; counter != 0; counter--)
|
||||
my_xor ^= *(ramaddress++);
|
||||
|
||||
/* If Checksum is incorrect */
|
||||
if (rcv_xor != my_xor) {
|
||||
printf("checksum error on packet %d\n",
|
||||
packet_number);
|
||||
/* wait to be sure that all data are received
|
||||
* in the FIFO before flush
|
||||
*/
|
||||
mdelay(30);
|
||||
data->packet_number--;
|
||||
result = NACK_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Update current position in buffer */
|
||||
data->cursor += codesize;
|
||||
|
||||
if (operation == PHASE_OTP) {
|
||||
size = data->cursor - cursor;
|
||||
/* no header for OTP */
|
||||
if (stm32prog_otp_write(data, cursor,
|
||||
data->buffer, &size))
|
||||
result = ABORT_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (operation == PHASE_PMIC) {
|
||||
size = data->cursor - cursor;
|
||||
/* no header for PMIC */
|
||||
if (stm32prog_pmic_write(data, cursor,
|
||||
data->buffer, &size))
|
||||
result = ABORT_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (cursor < BL_HEADER_SIZE) {
|
||||
/* size = portion of header in this chunck */
|
||||
if (data->cursor >= BL_HEADER_SIZE)
|
||||
size = BL_HEADER_SIZE - cursor;
|
||||
else
|
||||
size = data->cursor - cursor;
|
||||
memcpy((void *)((u32)(data->header_data) + cursor),
|
||||
data->buffer, size);
|
||||
cursor += size;
|
||||
|
||||
if (cursor == BL_HEADER_SIZE) {
|
||||
/* Check and Write the header */
|
||||
if (stm32prog_header(data)) {
|
||||
result = ABORT_BYTE;
|
||||
goto end;
|
||||
}
|
||||
} else {
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (image_header->present) {
|
||||
if (data->cursor <= BL_HEADER_SIZE)
|
||||
goto end;
|
||||
/* compute checksum on payload */
|
||||
for (i = (unsigned long)size; i < codesize; i++)
|
||||
data->checksum += data->buffer[i];
|
||||
|
||||
if (data->cursor >
|
||||
image_header->image_length + BL_HEADER_SIZE) {
|
||||
pr_err("expected size exceeded\n");
|
||||
result = ABORT_BYTE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* write data (payload) */
|
||||
ret = stm32prog_write(data,
|
||||
&data->buffer[size],
|
||||
codesize - size);
|
||||
} else {
|
||||
/* write all */
|
||||
ret = stm32prog_write(data,
|
||||
data->buffer,
|
||||
codesize);
|
||||
}
|
||||
if (ret)
|
||||
result = ABORT_BYTE;
|
||||
|
||||
end:
|
||||
stm32prog_serial_result(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* read_partition() - Respond to read command
|
||||
*
|
||||
* Read data from not volatile memory, Flash
|
||||
*
|
||||
* @data: Current command context
|
||||
*/
|
||||
static void read_partition_command(struct stm32prog_data *data)
|
||||
{
|
||||
u32 i, part_id, codesize, offset = 0, rcv_data;
|
||||
long size;
|
||||
u8 tmp_xor;
|
||||
int res;
|
||||
u8 buffer[256];
|
||||
|
||||
part_id = stm32prog_serial_getc();
|
||||
tmp_xor = part_id;
|
||||
|
||||
offset = get_address(&tmp_xor);
|
||||
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
if (rcv_data != tmp_xor) {
|
||||
pr_debug("1st checksum received = %x, computed %x\n",
|
||||
rcv_data, tmp_xor);
|
||||
goto error;
|
||||
}
|
||||
stm32prog_serial_putc(ACK_BYTE);
|
||||
|
||||
/* NbrOfData to read = data + 1 */
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
codesize = rcv_data + 0x01;
|
||||
tmp_xor = rcv_data;
|
||||
|
||||
rcv_data = stm32prog_serial_getc();
|
||||
if ((rcv_data ^ tmp_xor) != 0xFF) {
|
||||
pr_debug("2nd checksum received = %x, computed %x\n",
|
||||
rcv_data, tmp_xor);
|
||||
goto error;
|
||||
}
|
||||
|
||||
pr_debug("%s : %x\n", __func__, part_id);
|
||||
rcv_data = 0;
|
||||
switch (part_id) {
|
||||
case PHASE_OTP:
|
||||
size = codesize;
|
||||
if (!stm32prog_otp_read(data, offset, buffer, &size))
|
||||
rcv_data = size;
|
||||
break;
|
||||
case PHASE_PMIC:
|
||||
size = codesize;
|
||||
if (!stm32prog_pmic_read(data, offset, buffer, &size))
|
||||
rcv_data = size;
|
||||
break;
|
||||
default:
|
||||
res = stm32prog_read(data, part_id, offset,
|
||||
buffer, codesize);
|
||||
if (res > 0)
|
||||
rcv_data = res;
|
||||
break;
|
||||
}
|
||||
if (rcv_data > 0) {
|
||||
stm32prog_serial_putc(ACK_BYTE);
|
||||
/*----------- Send data to the host -----------*/
|
||||
for (i = 0; i < rcv_data; i++)
|
||||
stm32prog_serial_putc(buffer[i]);
|
||||
/*----------- Send filler to the host -----------*/
|
||||
for (; i < codesize; i++)
|
||||
stm32prog_serial_putc(0x0);
|
||||
return;
|
||||
}
|
||||
stm32prog_serial_result(ABORT_BYTE);
|
||||
return;
|
||||
|
||||
error:
|
||||
stm32prog_serial_result(NACK_BYTE);
|
||||
}
|
||||
|
||||
/* MAIN function = SERIAL LOOP ***********************************************/
|
||||
|
||||
/**
|
||||
* stm32prog_serial_loop() - USART bootloader Loop routine
|
||||
*
|
||||
* @data: Current command context
|
||||
* @return true if reset is needed after loop
|
||||
*/
|
||||
bool stm32prog_serial_loop(struct stm32prog_data *data)
|
||||
{
|
||||
u32 counter = 0x0;
|
||||
u8 command = 0x0;
|
||||
u8 found;
|
||||
int phase = data->phase;
|
||||
|
||||
/* element of cmd_func need to aligned with cmd_id[]*/
|
||||
void (*cmd_func[NB_CMD])(struct stm32prog_data *) = {
|
||||
/* GET_CMD_COMMAND */ get_cmd_command,
|
||||
/* GET_VER_COMMAND */ get_version_command,
|
||||
/* GET_ID_COMMAND */ get_id_command,
|
||||
/* GET_PHASE_COMMAND */ get_phase_command,
|
||||
/* RM_COMMAND */ read_memory_command,
|
||||
/* READ_PART_COMMAND */ read_partition_command,
|
||||
/* START_COMMAND */ start_command,
|
||||
/* DOWNLOAD_COMMAND */ download_command
|
||||
};
|
||||
|
||||
/* flush and NACK pending command received during u-boot init
|
||||
* request command reemit
|
||||
*/
|
||||
stm32prog_serial_result(NACK_BYTE);
|
||||
|
||||
clear_ctrlc(); /* forget any previous Control C */
|
||||
while (!had_ctrlc()) {
|
||||
phase = data->phase;
|
||||
|
||||
if (phase == PHASE_DO_RESET)
|
||||
return true;
|
||||
|
||||
/* Get the user command: read first byte */
|
||||
command = stm32prog_serial_getc();
|
||||
|
||||
if (command == INIT_BYTE) {
|
||||
puts("\nConnected\n");
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
continue;
|
||||
}
|
||||
|
||||
found = 0;
|
||||
for (counter = 0; counter < NB_CMD; counter++)
|
||||
if (cmd_id[counter] == command) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
if (found)
|
||||
if ((command ^ stm32prog_serial_getc()) != 0xFF)
|
||||
found = 0;
|
||||
if (!found) {
|
||||
/* wait to be sure that all data are received
|
||||
* in the FIFO before flush (CMD and XOR)
|
||||
*/
|
||||
mdelay(3);
|
||||
stm32prog_serial_result(NACK_BYTE);
|
||||
} else {
|
||||
stm32prog_serial_result(ACK_BYTE);
|
||||
cmd_func[counter](data);
|
||||
}
|
||||
WATCHDOG_RESET();
|
||||
}
|
||||
|
||||
/* clean device */
|
||||
if (gd->cur_serial_dev == down_serial_dev) {
|
||||
/* restore console on uart */
|
||||
gd->flags &= ~(GD_FLG_DISABLE_CONSOLE | GD_FLG_SILENT);
|
||||
}
|
||||
down_serial_dev = NULL;
|
||||
|
||||
return false; /* no reset after ctrlc */
|
||||
}
|
||||
232
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c
Normal file
232
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c
Normal file
@ -0,0 +1,232 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2020, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dfu.h>
|
||||
#include <g_dnl.h>
|
||||
#include <usb.h>
|
||||
#include <asm/arch/stm32prog.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include "stm32prog.h"
|
||||
|
||||
static int stm32prog_set_phase(struct stm32prog_data *data, u8 phase,
|
||||
u32 offset)
|
||||
{
|
||||
struct stm32prog_part_t *part;
|
||||
int i;
|
||||
|
||||
if (phase == data->phase) {
|
||||
data->offset = offset;
|
||||
data->dfu_seq = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* found partition for phase */
|
||||
for (i = 0; i < data->part_nb; i++) {
|
||||
part = &data->part_array[i];
|
||||
if (part->id == phase) {
|
||||
data->cur_part = part;
|
||||
data->phase = phase;
|
||||
data->offset = offset;
|
||||
data->dfu_seq = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int stm32prog_cmd_write(u64 offset, void *buf, long *len)
|
||||
{
|
||||
u8 phase;
|
||||
u32 address;
|
||||
u8 *pt = buf;
|
||||
void (*entry)(void);
|
||||
int ret;
|
||||
|
||||
if (*len < 5) {
|
||||
pr_err("size not allowed\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (offset) {
|
||||
pr_err("invalid offset\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
phase = pt[0];
|
||||
address = (pt[1] << 24) | (pt[2] << 16) | (pt[3] << 8) | pt[4];
|
||||
if (phase == PHASE_RESET) {
|
||||
entry = (void *)address;
|
||||
printf("## Starting application at 0x%x ...\n", address);
|
||||
(*entry)();
|
||||
printf("## Application terminated\n");
|
||||
return 0;
|
||||
}
|
||||
/* set phase and offset */
|
||||
ret = stm32prog_set_phase(stm32prog_data, phase, address);
|
||||
if (ret)
|
||||
pr_err("failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define PHASE_MIN_SIZE 9
|
||||
static int stm32prog_cmd_read(u64 offset, void *buf, long *len)
|
||||
{
|
||||
u32 destination = DEFAULT_ADDRESS; /* destination address */
|
||||
u32 dfu_offset;
|
||||
u8 *pt_buf = buf;
|
||||
int phase;
|
||||
char *err_msg;
|
||||
int length;
|
||||
|
||||
if (*len < PHASE_MIN_SIZE) {
|
||||
pr_err("request exceeds allowed area\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (offset) {
|
||||
*len = 0; /* EOF for second request */
|
||||
return 0;
|
||||
}
|
||||
phase = stm32prog_data->phase;
|
||||
if (phase == PHASE_FLASHLAYOUT)
|
||||
destination = STM32_DDR_BASE;
|
||||
dfu_offset = stm32prog_data->offset;
|
||||
|
||||
/* mandatory header, size = PHASE_MIN_SIZE */
|
||||
*pt_buf++ = (u8)(phase & 0xFF);
|
||||
*pt_buf++ = (u8)(destination);
|
||||
*pt_buf++ = (u8)(destination >> 8);
|
||||
*pt_buf++ = (u8)(destination >> 16);
|
||||
*pt_buf++ = (u8)(destination >> 24);
|
||||
*pt_buf++ = (u8)(dfu_offset);
|
||||
*pt_buf++ = (u8)(dfu_offset >> 8);
|
||||
*pt_buf++ = (u8)(dfu_offset >> 16);
|
||||
*pt_buf++ = (u8)(dfu_offset >> 24);
|
||||
|
||||
if (phase == PHASE_RESET || phase == PHASE_DO_RESET) {
|
||||
err_msg = stm32prog_get_error(stm32prog_data);
|
||||
length = strlen(err_msg);
|
||||
if (length + PHASE_MIN_SIZE > *len)
|
||||
length = *len - PHASE_MIN_SIZE;
|
||||
|
||||
memcpy(pt_buf, err_msg, length);
|
||||
*len = PHASE_MIN_SIZE + length;
|
||||
stm32prog_do_reset(stm32prog_data);
|
||||
} else if (phase == PHASE_FLASHLAYOUT) {
|
||||
*pt_buf++ = stm32prog_data->part_nb ? 1 : 0;
|
||||
*len = PHASE_MIN_SIZE + 1;
|
||||
} else {
|
||||
*len = PHASE_MIN_SIZE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int stm32prog_write_medium_virt(struct dfu_entity *dfu, u64 offset,
|
||||
void *buf, long *len)
|
||||
{
|
||||
if (dfu->dev_type != DFU_DEV_VIRT)
|
||||
return -EINVAL;
|
||||
|
||||
switch (dfu->data.virt.dev_num) {
|
||||
case PHASE_CMD:
|
||||
return stm32prog_cmd_write(offset, buf, len);
|
||||
|
||||
case PHASE_OTP:
|
||||
return stm32prog_otp_write(stm32prog_data, (u32)offset,
|
||||
buf, len);
|
||||
|
||||
case PHASE_PMIC:
|
||||
return stm32prog_pmic_write(stm32prog_data, (u32)offset,
|
||||
buf, len);
|
||||
}
|
||||
*len = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int stm32prog_read_medium_virt(struct dfu_entity *dfu, u64 offset,
|
||||
void *buf, long *len)
|
||||
{
|
||||
if (dfu->dev_type != DFU_DEV_VIRT)
|
||||
return -EINVAL;
|
||||
|
||||
switch (dfu->data.virt.dev_num) {
|
||||
case PHASE_CMD:
|
||||
return stm32prog_cmd_read(offset, buf, len);
|
||||
|
||||
case PHASE_OTP:
|
||||
return stm32prog_otp_read(stm32prog_data, (u32)offset,
|
||||
buf, len);
|
||||
|
||||
case PHASE_PMIC:
|
||||
return stm32prog_pmic_read(stm32prog_data, (u32)offset,
|
||||
buf, len);
|
||||
}
|
||||
*len = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int stm32prog_get_medium_size_virt(struct dfu_entity *dfu, u64 *size)
|
||||
{
|
||||
if (dfu->dev_type != DFU_DEV_VIRT) {
|
||||
*size = 0;
|
||||
pr_debug("%s, invalid dev_type = %d\n",
|
||||
__func__, dfu->dev_type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (dfu->data.virt.dev_num) {
|
||||
case PHASE_CMD:
|
||||
*size = 512;
|
||||
break;
|
||||
case PHASE_OTP:
|
||||
*size = OTP_SIZE;
|
||||
break;
|
||||
case PHASE_PMIC:
|
||||
*size = PMIC_SIZE;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool stm32prog_usb_loop(struct stm32prog_data *data, int dev)
|
||||
{
|
||||
int ret;
|
||||
bool result;
|
||||
/* USB download gadget for STM32 Programmer */
|
||||
char product[128];
|
||||
char name[SOC_NAME_SIZE];
|
||||
|
||||
get_soc_name(name);
|
||||
snprintf(product, sizeof(product),
|
||||
"USB download gadget@Device ID /0x%03X, @Revision ID /0x%04X, @Name /%s,",
|
||||
get_cpu_dev(), get_cpu_rev(), name);
|
||||
g_dnl_set_product(product);
|
||||
|
||||
if (stm32prog_data->phase == PHASE_FLASHLAYOUT) {
|
||||
ret = run_usb_dnl_gadget(dev, "usb_dnl_dfu");
|
||||
if (ret || stm32prog_data->phase == PHASE_DO_RESET)
|
||||
return ret;
|
||||
/* prepare the second enumeration with the FlashLayout */
|
||||
if (stm32prog_data->phase == PHASE_FLASHLAYOUT)
|
||||
stm32prog_dfu_init(data);
|
||||
/* found next selected partition */
|
||||
stm32prog_next_phase(data);
|
||||
}
|
||||
|
||||
ret = run_usb_dnl_gadget(dev, "usb_dnl_dfu");
|
||||
|
||||
result = !!(ret) || (stm32prog_data->phase == PHASE_DO_RESET);
|
||||
|
||||
g_dnl_set_product(NULL);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int g_dnl_get_board_bcd_device_number(int gcnum)
|
||||
{
|
||||
pr_debug("%s\n", __func__);
|
||||
return 0x200;
|
||||
}
|
||||
@ -9,6 +9,7 @@
|
||||
#include <env.h>
|
||||
#include <misc.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/bsec.h>
|
||||
#include <asm/arch/stm32.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <dm/device.h>
|
||||
@ -35,7 +36,9 @@
|
||||
#define TAMP_CR1 (STM32_TAMP_BASE + 0x00)
|
||||
|
||||
#define PWR_CR1 (STM32_PWR_BASE + 0x00)
|
||||
#define PWR_MCUCR (STM32_PWR_BASE + 0x14)
|
||||
#define PWR_CR1_DBP BIT(8)
|
||||
#define PWR_MCUCR_SBF BIT(6)
|
||||
|
||||
/* DBGMCU register */
|
||||
#define DBGMCU_IDC (STM32_DBGMCU_BASE + 0x00)
|
||||
@ -59,12 +62,6 @@
|
||||
#define BOOTROM_INSTANCE_MASK GENMASK(31, 16)
|
||||
#define BOOTROM_INSTANCE_SHIFT 16
|
||||
|
||||
/* BSEC OTP index */
|
||||
#define BSEC_OTP_RPN 1
|
||||
#define BSEC_OTP_SERIAL 13
|
||||
#define BSEC_OTP_PKG 16
|
||||
#define BSEC_OTP_MAC 57
|
||||
|
||||
/* Device Part Number (RPN) = OTP_DATA1 lower 8 bits */
|
||||
#define RPN_SHIFT 0
|
||||
#define RPN_MASK GENMASK(7, 0)
|
||||
@ -149,7 +146,12 @@ static void dbgmcu_init(void)
|
||||
{
|
||||
setbits_le32(RCC_DBGCFGR, RCC_DBGCFGR_DBGCKEN);
|
||||
|
||||
/* Freeze IWDG2 if Cortex-A7 is in debug mode */
|
||||
/*
|
||||
* Freeze IWDG2 if Cortex-A7 is in debug mode
|
||||
* done in TF-A for TRUSTED boot and
|
||||
* DBGMCU access is controlled by BSEC_DENABLE.DBGSWENABLE
|
||||
*/
|
||||
if (!CONFIG_IS_ENABLED(STM32MP1_TRUSTED) && bsec_dbgswenable())
|
||||
setbits_le32(DBGMCU_APB4FZ1, DBGMCU_APB4FZ1_IWDG2);
|
||||
}
|
||||
#endif /* !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) */
|
||||
@ -206,6 +208,11 @@ int arch_cpu_init(void)
|
||||
security_init();
|
||||
update_bootmode();
|
||||
#endif
|
||||
/* Reset Coprocessor state unless it wakes up from Standby power mode */
|
||||
if (!(readl(PWR_MCUCR) & PWR_MCUCR_SBF)) {
|
||||
writel(TAMP_COPRO_STATE_OFF, TAMP_COPRO_STATE);
|
||||
writel(0, TAMP_COPRO_RSC_TBL_ADDRESS);
|
||||
}
|
||||
#endif
|
||||
|
||||
boot_mode = get_bootmode();
|
||||
@ -230,11 +237,24 @@ void enable_caches(void)
|
||||
|
||||
static u32 read_idc(void)
|
||||
{
|
||||
/* DBGMCU access is controlled by BSEC_DENABLE.DBGSWENABLE */
|
||||
if (bsec_dbgswenable()) {
|
||||
setbits_le32(RCC_DBGCFGR, RCC_DBGCFGR_DBGCKEN);
|
||||
|
||||
return readl(DBGMCU_IDC);
|
||||
}
|
||||
|
||||
if (CONFIG_IS_ENABLED(STM32MP15x))
|
||||
return CPU_DEV_STM32MP15; /* STM32MP15x and unknown revision */
|
||||
else
|
||||
return 0x0;
|
||||
}
|
||||
|
||||
u32 get_cpu_dev(void)
|
||||
{
|
||||
return (read_idc() & DBGMCU_IDC_DEV_ID_MASK) >> DBGMCU_IDC_DEV_ID_SHIFT;
|
||||
}
|
||||
|
||||
u32 get_cpu_rev(void)
|
||||
{
|
||||
return (read_idc() & DBGMCU_IDC_REV_ID_MASK) >> DBGMCU_IDC_REV_ID_SHIFT;
|
||||
@ -265,11 +285,7 @@ static u32 get_cpu_rpn(void)
|
||||
|
||||
u32 get_cpu_type(void)
|
||||
{
|
||||
u32 id;
|
||||
|
||||
id = (read_idc() & DBGMCU_IDC_DEV_ID_MASK) >> DBGMCU_IDC_DEV_ID_SHIFT;
|
||||
|
||||
return (id << 16) | get_cpu_rpn();
|
||||
return (get_cpu_dev() << 16) | get_cpu_rpn();
|
||||
}
|
||||
|
||||
/* Get Package options from OTP */
|
||||
@ -278,25 +294,42 @@ u32 get_cpu_package(void)
|
||||
return get_otp(BSEC_OTP_PKG, PKG_SHIFT, PKG_MASK);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DISPLAY_CPUINFO)
|
||||
int print_cpuinfo(void)
|
||||
void get_soc_name(char name[SOC_NAME_SIZE])
|
||||
{
|
||||
char *cpu_s, *cpu_r, *pkg;
|
||||
|
||||
/* MPUs Part Numbers */
|
||||
switch (get_cpu_type()) {
|
||||
case CPU_STM32MP157Fxx:
|
||||
cpu_s = "157F";
|
||||
break;
|
||||
case CPU_STM32MP157Dxx:
|
||||
cpu_s = "157D";
|
||||
break;
|
||||
case CPU_STM32MP157Cxx:
|
||||
cpu_s = "157C";
|
||||
break;
|
||||
case CPU_STM32MP157Axx:
|
||||
cpu_s = "157A";
|
||||
break;
|
||||
case CPU_STM32MP153Fxx:
|
||||
cpu_s = "153F";
|
||||
break;
|
||||
case CPU_STM32MP153Dxx:
|
||||
cpu_s = "153D";
|
||||
break;
|
||||
case CPU_STM32MP153Cxx:
|
||||
cpu_s = "153C";
|
||||
break;
|
||||
case CPU_STM32MP153Axx:
|
||||
cpu_s = "153A";
|
||||
break;
|
||||
case CPU_STM32MP151Fxx:
|
||||
cpu_s = "151F";
|
||||
break;
|
||||
case CPU_STM32MP151Dxx:
|
||||
cpu_s = "151D";
|
||||
break;
|
||||
case CPU_STM32MP151Cxx:
|
||||
cpu_s = "151C";
|
||||
break;
|
||||
@ -335,12 +368,24 @@ int print_cpuinfo(void)
|
||||
case CPU_REVB:
|
||||
cpu_r = "B";
|
||||
break;
|
||||
case CPU_REVZ:
|
||||
cpu_r = "Z";
|
||||
break;
|
||||
default:
|
||||
cpu_r = "?";
|
||||
break;
|
||||
}
|
||||
|
||||
printf("CPU: STM32MP%s%s Rev.%s\n", cpu_s, pkg, cpu_r);
|
||||
snprintf(name, SOC_NAME_SIZE, "STM32MP%s%s Rev.%s", cpu_s, pkg, cpu_r);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DISPLAY_CPUINFO)
|
||||
int print_cpuinfo(void)
|
||||
{
|
||||
char name[SOC_NAME_SIZE];
|
||||
|
||||
get_soc_name(name);
|
||||
printf("CPU: %s\n", name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -405,6 +450,10 @@ static void setup_boot_mode(void)
|
||||
env_set("boot_device", "nand");
|
||||
env_set("boot_instance", "0");
|
||||
break;
|
||||
case BOOT_FLASH_SPINAND:
|
||||
env_set("boot_device", "spi-nand");
|
||||
env_set("boot_instance", "0");
|
||||
break;
|
||||
case BOOT_FLASH_NOR:
|
||||
env_set("boot_device", "nor");
|
||||
env_set("boot_instance", "0");
|
||||
@ -449,7 +498,7 @@ static void setup_boot_mode(void)
|
||||
* If there is no MAC address in the environment, then it will be initialized
|
||||
* (silently) from the value in the OTP.
|
||||
*/
|
||||
static int setup_mac_address(void)
|
||||
__weak int setup_mac_address(void)
|
||||
{
|
||||
#if defined(CONFIG_NET)
|
||||
int ret;
|
||||
@ -481,8 +530,9 @@ static int setup_mac_address(void)
|
||||
return -EINVAL;
|
||||
}
|
||||
pr_debug("OTP MAC address = %pM\n", enetaddr);
|
||||
ret = !eth_env_set_enetaddr("ethaddr", enetaddr);
|
||||
if (!ret)
|
||||
|
||||
ret = eth_env_set_enetaddr("ethaddr", enetaddr);
|
||||
if (ret)
|
||||
pr_err("Failed to set mac address %pM from OTP: %d\n",
|
||||
enetaddr, ret);
|
||||
#endif
|
||||
@ -492,13 +542,13 @@ static int setup_mac_address(void)
|
||||
|
||||
static int setup_serial_number(void)
|
||||
{
|
||||
char *serial_env;
|
||||
char serial_string[25];
|
||||
u32 otp[3] = {0, 0, 0 };
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
|
||||
if (env_get("serial#"))
|
||||
return 0;
|
||||
serial_env = env_get("serial#");
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||
DM_GET_DRIVER(stm32mp_bsec),
|
||||
@ -512,6 +562,15 @@ static int setup_serial_number(void)
|
||||
return ret;
|
||||
|
||||
sprintf(serial_string, "%08X%08X%08X", otp[0], otp[1], otp[2]);
|
||||
|
||||
if (serial_env) {
|
||||
if (!strcmp(serial_string, serial_env))
|
||||
return 0;
|
||||
/* For invalid enviromnent (serial# change), reset to default */
|
||||
env_set_default("serial number mismatch", 0);
|
||||
}
|
||||
|
||||
/* save serial number */
|
||||
env_set("serial#", serial_string);
|
||||
|
||||
return 0;
|
||||
@ -519,9 +578,9 @@ static int setup_serial_number(void)
|
||||
|
||||
int arch_misc_init(void)
|
||||
{
|
||||
setup_serial_number();
|
||||
setup_boot_mode();
|
||||
setup_mac_address();
|
||||
setup_serial_number();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <lmb.h>
|
||||
#include <ram.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
@ -31,3 +32,20 @@ int dram_init(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ulong board_get_usable_ram_top(ulong total_size)
|
||||
{
|
||||
phys_addr_t reg;
|
||||
struct lmb lmb;
|
||||
|
||||
/* found enough not-reserved memory to relocated U-Boot */
|
||||
lmb_init(&lmb);
|
||||
lmb_add(&lmb, gd->ram_base, gd->ram_size);
|
||||
boot_fdt_add_mem_rsv_regions(&lmb, (void *)gd->fdt_blob);
|
||||
reg = lmb_alloc(&lmb, CONFIG_SYS_MALLOC_LEN + total_size, SZ_4K);
|
||||
|
||||
if (reg)
|
||||
return ALIGN(reg + CONFIG_SYS_MALLOC_LEN + total_size, SZ_4K);
|
||||
|
||||
return gd->ram_top;
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <fdt_support.h>
|
||||
#include <tee.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <dt-bindings/pinctrl/stm32-pinfunc.h>
|
||||
#include <linux/io.h>
|
||||
@ -23,6 +24,12 @@
|
||||
|
||||
#define ETZPC_RESERVED 0xffffffff
|
||||
|
||||
#define STM32_FDCAN_BASE 0x4400e000
|
||||
#define STM32_CRYP2_BASE 0x4c005000
|
||||
#define STM32_CRYP1_BASE 0x54001000
|
||||
#define STM32_GPU_BASE 0x59000000
|
||||
#define STM32_DSI_BASE 0x5a000000
|
||||
|
||||
static const u32 stm32mp1_ip_addr[] = {
|
||||
0x5c008000, /* 00 stgenc */
|
||||
0x54000000, /* 01 bkpsram */
|
||||
@ -33,7 +40,7 @@ static const u32 stm32mp1_ip_addr[] = {
|
||||
ETZPC_RESERVED, /* 06 reserved */
|
||||
0x54003000, /* 07 rng1 */
|
||||
0x54002000, /* 08 hash1 */
|
||||
0x54001000, /* 09 cryp1 */
|
||||
STM32_CRYP1_BASE, /* 09 cryp1 */
|
||||
0x5a003000, /* 0A ddrctrl */
|
||||
0x5a004000, /* 0B ddrphyc */
|
||||
0x5c009000, /* 0C i2c6 */
|
||||
@ -86,7 +93,7 @@ static const u32 stm32mp1_ip_addr[] = {
|
||||
0x4400b000, /* 3B sai2 */
|
||||
0x4400c000, /* 3C sai3 */
|
||||
0x4400d000, /* 3D dfsdm */
|
||||
0x4400e000, /* 3E tt_fdcan */
|
||||
STM32_FDCAN_BASE, /* 3E tt_fdcan */
|
||||
ETZPC_RESERVED, /* 3F reserved */
|
||||
0x50021000, /* 40 lptim2 */
|
||||
0x50022000, /* 41 lptim3 */
|
||||
@ -99,7 +106,7 @@ static const u32 stm32mp1_ip_addr[] = {
|
||||
0x48003000, /* 48 adc */
|
||||
0x4c002000, /* 49 hash2 */
|
||||
0x4c003000, /* 4A rng2 */
|
||||
0x4c005000, /* 4B cryp2 */
|
||||
STM32_CRYP2_BASE, /* 4B cryp2 */
|
||||
ETZPC_RESERVED, /* 4C reserved */
|
||||
ETZPC_RESERVED, /* 4D reserved */
|
||||
ETZPC_RESERVED, /* 4E reserved */
|
||||
@ -126,11 +133,13 @@ static const u32 stm32mp1_ip_addr[] = {
|
||||
static bool fdt_disable_subnode_by_address(void *fdt, int offset, u32 addr)
|
||||
{
|
||||
int node;
|
||||
fdt_addr_t regs;
|
||||
|
||||
for (node = fdt_first_subnode(fdt, offset);
|
||||
node >= 0;
|
||||
node = fdt_next_subnode(fdt, node)) {
|
||||
if (addr == (u32)fdt_getprop(fdt, node, "reg", 0)) {
|
||||
regs = fdtdec_get_addr(fdt, node, "reg");
|
||||
if (addr == regs) {
|
||||
if (fdtdec_get_is_enabled(fdt, node)) {
|
||||
fdt_status_disabled(fdt, node);
|
||||
|
||||
@ -143,11 +152,11 @@ static bool fdt_disable_subnode_by_address(void *fdt, int offset, u32 addr)
|
||||
return false;
|
||||
}
|
||||
|
||||
static int stm32_fdt_fixup_etzpc(void *fdt)
|
||||
static int stm32_fdt_fixup_etzpc(void *fdt, int soc_node)
|
||||
{
|
||||
const u32 *array;
|
||||
int array_size, i;
|
||||
int soc_node, offset, shift;
|
||||
int offset, shift;
|
||||
u32 addr, status, decprot[ETZPC_DECPROT_NB];
|
||||
|
||||
array = stm32mp1_ip_addr;
|
||||
@ -156,10 +165,6 @@ static int stm32_fdt_fixup_etzpc(void *fdt)
|
||||
for (i = 0; i < ETZPC_DECPROT_NB; i++)
|
||||
decprot[i] = readl(ETZPC_DECPROT(i));
|
||||
|
||||
soc_node = fdt_path_offset(fdt, "/soc");
|
||||
if (soc_node < 0)
|
||||
return soc_node;
|
||||
|
||||
for (i = 0; i < array_size; i++) {
|
||||
offset = i / NB_PROT_PER_REG;
|
||||
shift = (i % NB_PROT_PER_REG) * DECPROT_NB_BITS;
|
||||
@ -180,6 +185,60 @@ static int stm32_fdt_fixup_etzpc(void *fdt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* deactivate all the cpu except core 0 */
|
||||
static void stm32_fdt_fixup_cpu(void *blob, char *name)
|
||||
{
|
||||
int off;
|
||||
u32 reg;
|
||||
|
||||
off = fdt_path_offset(blob, "/cpus");
|
||||
if (off < 0) {
|
||||
printf("%s: couldn't find /cpus node\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
|
||||
while (off != -FDT_ERR_NOTFOUND) {
|
||||
reg = fdtdec_get_addr(blob, off, "reg");
|
||||
if (reg != 0) {
|
||||
fdt_del_node(blob, off);
|
||||
printf("FDT: cpu %d node remove for %s\n", reg, name);
|
||||
/* after delete we can't trust the offsets anymore */
|
||||
off = -1;
|
||||
}
|
||||
off = fdt_node_offset_by_prop_value(blob, off,
|
||||
"device_type", "cpu", 4);
|
||||
}
|
||||
}
|
||||
|
||||
static void stm32_fdt_disable(void *fdt, int offset, u32 addr,
|
||||
const char *string, const char *name)
|
||||
{
|
||||
if (fdt_disable_subnode_by_address(fdt, offset, addr))
|
||||
printf("FDT: %s@%08x node disabled for %s\n",
|
||||
string, addr, name);
|
||||
}
|
||||
|
||||
static void stm32_fdt_disable_optee(void *blob)
|
||||
{
|
||||
int off, node;
|
||||
|
||||
off = fdt_node_offset_by_compatible(blob, -1, "linaro,optee-tz");
|
||||
if (off >= 0 && fdtdec_get_is_enabled(blob, off))
|
||||
fdt_status_disabled(blob, off);
|
||||
|
||||
/* Disabled "optee@..." reserved-memory node */
|
||||
off = fdt_path_offset(blob, "/reserved-memory/");
|
||||
if (off < 0)
|
||||
return;
|
||||
for (node = fdt_first_subnode(blob, off);
|
||||
node >= 0;
|
||||
node = fdt_next_subnode(blob, node)) {
|
||||
if (!strncmp(fdt_get_name(blob, node, NULL), "optee@", 6))
|
||||
fdt_status_disabled(blob, node);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is called right before the kernel is booted. "blob" is the
|
||||
* device tree that will be passed to the kernel.
|
||||
@ -187,14 +246,59 @@ static int stm32_fdt_fixup_etzpc(void *fdt)
|
||||
int ft_system_setup(void *blob, bd_t *bd)
|
||||
{
|
||||
int ret = 0;
|
||||
u32 pkg;
|
||||
int soc;
|
||||
u32 pkg, cpu;
|
||||
char name[SOC_NAME_SIZE];
|
||||
|
||||
soc = fdt_path_offset(blob, "/soc");
|
||||
if (soc < 0)
|
||||
return soc;
|
||||
|
||||
if (CONFIG_IS_ENABLED(STM32_ETZPC)) {
|
||||
ret = stm32_fdt_fixup_etzpc(blob);
|
||||
ret = stm32_fdt_fixup_etzpc(blob, soc);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* MPUs Part Numbers and name*/
|
||||
cpu = get_cpu_type();
|
||||
get_soc_name(name);
|
||||
|
||||
switch (cpu) {
|
||||
case CPU_STM32MP151Fxx:
|
||||
case CPU_STM32MP151Dxx:
|
||||
case CPU_STM32MP151Cxx:
|
||||
case CPU_STM32MP151Axx:
|
||||
stm32_fdt_fixup_cpu(blob, name);
|
||||
/* after cpu delete we can't trust the soc offsets anymore */
|
||||
soc = fdt_path_offset(blob, "/soc");
|
||||
stm32_fdt_disable(blob, soc, STM32_FDCAN_BASE, "can", name);
|
||||
/* fall through */
|
||||
case CPU_STM32MP153Fxx:
|
||||
case CPU_STM32MP153Dxx:
|
||||
case CPU_STM32MP153Cxx:
|
||||
case CPU_STM32MP153Axx:
|
||||
stm32_fdt_disable(blob, soc, STM32_GPU_BASE, "gpu", name);
|
||||
stm32_fdt_disable(blob, soc, STM32_DSI_BASE, "dsi", name);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (cpu) {
|
||||
case CPU_STM32MP157Dxx:
|
||||
case CPU_STM32MP157Axx:
|
||||
case CPU_STM32MP153Dxx:
|
||||
case CPU_STM32MP153Axx:
|
||||
case CPU_STM32MP151Dxx:
|
||||
case CPU_STM32MP151Axx:
|
||||
stm32_fdt_disable(blob, soc, STM32_CRYP1_BASE, "cryp", name);
|
||||
stm32_fdt_disable(blob, soc, STM32_CRYP2_BASE, "cryp", name);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (get_cpu_package()) {
|
||||
case PKG_AA_LBGA448:
|
||||
pkg = STM32MP_PKG_AA;
|
||||
@ -219,5 +323,9 @@ int ft_system_setup(void *blob, bd_t *bd)
|
||||
"st,package", pkg, false);
|
||||
}
|
||||
|
||||
if (!CONFIG_IS_ENABLED(OPTEE) ||
|
||||
!tee_find_device(NULL, NULL, NULL, NULL))
|
||||
stm32_fdt_disable_optee(blob);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
7
arch/arm/mach-stm32mp/include/mach/bsec.h
Normal file
7
arch/arm/mach-stm32mp/include/mach/bsec.h
Normal file
@ -0,0 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2020, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
/* check self hosted debug status = BSEC_DENABLE.DBGSWENABLE */
|
||||
bool bsec_dbgswenable(void);
|
||||
@ -9,8 +9,10 @@
|
||||
/* DDR power initializations */
|
||||
enum ddr_type {
|
||||
STM32MP_DDR3,
|
||||
STM32MP_LPDDR2,
|
||||
STM32MP_LPDDR3,
|
||||
STM32MP_LPDDR2_16,
|
||||
STM32MP_LPDDR2_32,
|
||||
STM32MP_LPDDR3_16,
|
||||
STM32MP_LPDDR3_32,
|
||||
};
|
||||
|
||||
int board_ddr_power_init(enum ddr_type ddr_type);
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
/* enumerated used to identify the SYSCON driver instance */
|
||||
enum {
|
||||
STM32MP_SYSCON_UNKNOWN,
|
||||
STM32MP_SYSCON_PWR,
|
||||
STM32MP_SYSCON_SYSCFG,
|
||||
};
|
||||
|
||||
@ -80,15 +79,29 @@ enum boot_device {
|
||||
|
||||
BOOT_SERIAL_USB = 0x60,
|
||||
BOOT_SERIAL_USB_OTG = 0x62,
|
||||
|
||||
BOOT_FLASH_SPINAND = 0x70,
|
||||
BOOT_FLASH_SPINAND_1 = 0x71,
|
||||
};
|
||||
|
||||
/* TAMP registers */
|
||||
#define TAMP_BACKUP_REGISTER(x) (STM32_TAMP_BASE + 0x100 + 4 * x)
|
||||
/* secure access */
|
||||
#define TAMP_BACKUP_MAGIC_NUMBER TAMP_BACKUP_REGISTER(4)
|
||||
#define TAMP_BACKUP_BRANCH_ADDRESS TAMP_BACKUP_REGISTER(5)
|
||||
/* non secure access */
|
||||
#define TAMP_COPRO_RSC_TBL_ADDRESS TAMP_BACKUP_REGISTER(17)
|
||||
#define TAMP_COPRO_STATE TAMP_BACKUP_REGISTER(18)
|
||||
#define TAMP_BOOT_CONTEXT TAMP_BACKUP_REGISTER(20)
|
||||
#define TAMP_BOOTCOUNT TAMP_BACKUP_REGISTER(21)
|
||||
|
||||
#define TAMP_COPRO_STATE_OFF 0
|
||||
#define TAMP_COPRO_STATE_INIT 1
|
||||
#define TAMP_COPRO_STATE_CRUN 2
|
||||
#define TAMP_COPRO_STATE_CSTOP 3
|
||||
#define TAMP_COPRO_STATE_STANDBY 4
|
||||
#define TAMP_COPRO_STATE_CRASH 5
|
||||
|
||||
#define TAMP_BOOT_MODE_MASK GENMASK(15, 8)
|
||||
#define TAMP_BOOT_MODE_SHIFT 8
|
||||
#define TAMP_BOOT_DEVICE_MASK GENMASK(7, 4)
|
||||
@ -111,7 +124,14 @@ enum forced_boot_mode {
|
||||
#define STM32_BSEC_SHADOW(id) (STM32_BSEC_SHADOW_OFFSET + (id) * 4)
|
||||
#define STM32_BSEC_OTP_OFFSET 0x80000000
|
||||
#define STM32_BSEC_OTP(id) (STM32_BSEC_OTP_OFFSET + (id) * 4)
|
||||
#define STM32_BSEC_LOCK_OFFSET 0xC0000000
|
||||
#define STM32_BSEC_LOCK(id) (STM32_BSEC_LOCK_OFFSET + (id) * 4)
|
||||
|
||||
/* BSEC OTP index */
|
||||
#define BSEC_OTP_RPN 1
|
||||
#define BSEC_OTP_SERIAL 13
|
||||
#define BSEC_OTP_PKG 16
|
||||
#define BSEC_OTP_MAC 57
|
||||
#define BSEC_OTP_BOARD 59
|
||||
|
||||
#endif /* __ASSEMBLY__*/
|
||||
|
||||
@ -18,8 +18,16 @@
|
||||
#define STM32_SMC_VERSION 0x82000000
|
||||
|
||||
/* Secure Service access from Non-secure */
|
||||
#define STM32_SMC_RCC 0x82001000
|
||||
#define STM32_SMC_PWR 0x82001001
|
||||
#define STM32_SMC_RTC 0x82001002
|
||||
#define STM32_SMC_BSEC 0x82001003
|
||||
|
||||
/* Register access service use for RCC/RTC/PWR */
|
||||
#define STM32_SMC_REG_WRITE 0x1
|
||||
#define STM32_SMC_REG_SET 0x2
|
||||
#define STM32_SMC_REG_CLEAR 0x3
|
||||
|
||||
/* Service for BSEC */
|
||||
#define STM32_SMC_READ_SHADOW 0x01
|
||||
#define STM32_SMC_PROG_OTP 0x02
|
||||
@ -27,6 +35,7 @@
|
||||
#define STM32_SMC_READ_OTP 0x04
|
||||
#define STM32_SMC_READ_ALL 0x05
|
||||
#define STM32_SMC_WRITE_ALL 0x06
|
||||
#define STM32_SMC_WRLOCK_OTP 0x07
|
||||
|
||||
/* SMC error codes */
|
||||
#define STM32_SMC_OK 0x0
|
||||
@ -45,8 +54,8 @@ static inline u32 stm32_smc(u32 svc, u8 op, u32 data1, u32 data2, u32 *result)
|
||||
arm_smccc_smc(svc, op, data1, data2, 0, 0, 0, 0, &res);
|
||||
|
||||
if (res.a0) {
|
||||
pr_err("%s: Failed to exec in secure mode (err = %ld)\n",
|
||||
__func__, res.a0);
|
||||
pr_err("%s: Failed to exec svc=%x op=%x in secure mode (err = %ld)\n",
|
||||
__func__, svc, op, res.a0);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (result)
|
||||
|
||||
16
arch/arm/mach-stm32mp/include/mach/stm32prog.h
Normal file
16
arch/arm/mach-stm32mp/include/mach/stm32prog.h
Normal file
@ -0,0 +1,16 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2020, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#define STM32PROG_VIRT_FIRST_DEV_NUM 0xF1
|
||||
|
||||
int stm32prog_write_medium_virt(struct dfu_entity *dfu, u64 offset,
|
||||
void *buf, long *len);
|
||||
int stm32prog_read_medium_virt(struct dfu_entity *dfu, u64 offset,
|
||||
void *buf, long *len);
|
||||
int stm32prog_get_medium_size_virt(struct dfu_entity *dfu, u64 *size);
|
||||
|
||||
bool stm32prog_get_tee_partitions(void);
|
||||
|
||||
bool stm32prog_get_fsbl_nor(void);
|
||||
@ -3,19 +3,31 @@
|
||||
* Copyright (C) 2015-2017, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
/* ID = Device Version (bit31:16) + Device Part Number (RPN) (bit15:0)*/
|
||||
/* ID = Device Version (bit31:16) + Device Part Number (RPN) (bit7:0) */
|
||||
#define CPU_STM32MP157Cxx 0x05000000
|
||||
#define CPU_STM32MP157Axx 0x05000001
|
||||
#define CPU_STM32MP153Cxx 0x05000024
|
||||
#define CPU_STM32MP153Axx 0x05000025
|
||||
#define CPU_STM32MP151Cxx 0x0500002E
|
||||
#define CPU_STM32MP151Axx 0x0500002F
|
||||
#define CPU_STM32MP157Fxx 0x05000080
|
||||
#define CPU_STM32MP157Dxx 0x05000081
|
||||
#define CPU_STM32MP153Fxx 0x050000A4
|
||||
#define CPU_STM32MP153Dxx 0x050000A5
|
||||
#define CPU_STM32MP151Fxx 0x050000AE
|
||||
#define CPU_STM32MP151Dxx 0x050000AF
|
||||
|
||||
/* return CPU_STMP32MP...Xxx constants */
|
||||
u32 get_cpu_type(void);
|
||||
|
||||
#define CPU_DEV_STM32MP15 0x500
|
||||
|
||||
/* return CPU_DEV constants */
|
||||
u32 get_cpu_dev(void);
|
||||
|
||||
#define CPU_REVA 0x1000
|
||||
#define CPU_REVB 0x2000
|
||||
#define CPU_REVZ 0x2001
|
||||
|
||||
/* return CPU_REV constants */
|
||||
u32 get_cpu_rev(void);
|
||||
@ -28,5 +40,15 @@ u32 get_cpu_package(void);
|
||||
#define PKG_AC_TFBGA361 2
|
||||
#define PKG_AD_TFBGA257 1
|
||||
|
||||
/* Get SOC name */
|
||||
#define SOC_NAME_SIZE 20
|
||||
void get_soc_name(char name[SOC_NAME_SIZE]);
|
||||
|
||||
/* return boot mode */
|
||||
u32 get_bootmode(void);
|
||||
|
||||
int setup_mac_address(void);
|
||||
|
||||
/* board power management : configure vddcore according OPP */
|
||||
void board_vddcore_init(u32 voltage_mv);
|
||||
int board_vddcore_set(void);
|
||||
|
||||
@ -30,6 +30,22 @@ u8 psci_state[STM32MP1_PSCI_NR_CPUS] __secure_data = {
|
||||
PSCI_AFFINITY_LEVEL_ON,
|
||||
PSCI_AFFINITY_LEVEL_OFF};
|
||||
|
||||
static u32 __secure_data cntfrq;
|
||||
|
||||
static u32 __secure cp15_read_cntfrq(void)
|
||||
{
|
||||
u32 frq;
|
||||
|
||||
asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (frq));
|
||||
|
||||
return frq;
|
||||
}
|
||||
|
||||
static void __secure cp15_write_cntfrq(u32 frq)
|
||||
{
|
||||
asm volatile ("mcr p15, 0, %0, c14, c0, 0" : : "r" (frq));
|
||||
}
|
||||
|
||||
static inline void psci_set_state(int cpu, u8 state)
|
||||
{
|
||||
psci_state[cpu] = state;
|
||||
@ -63,6 +79,9 @@ void __secure psci_arch_cpu_entry(void)
|
||||
|
||||
psci_set_state(cpu, PSCI_AFFINITY_LEVEL_ON);
|
||||
|
||||
/* write the saved cntfrq */
|
||||
cp15_write_cntfrq(cntfrq);
|
||||
|
||||
/* reset magic in TAMP register */
|
||||
writel(0xFFFFFFFF, TAMP_BACKUP_MAGIC_NUMBER);
|
||||
}
|
||||
@ -130,6 +149,9 @@ s32 __secure psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc,
|
||||
if (psci_state[cpu] == PSCI_AFFINITY_LEVEL_ON)
|
||||
return ARM_PSCI_RET_ALREADY_ON;
|
||||
|
||||
/* read and save cntfrq of current cpu to write on target cpu */
|
||||
cntfrq = cp15_read_cntfrq();
|
||||
|
||||
/* reset magic in TAMP register */
|
||||
if (readl(TAMP_BACKUP_MAGIC_NUMBER))
|
||||
writel(0xFFFFFFFF, TAMP_BACKUP_MAGIC_NUMBER);
|
||||
|
||||
@ -6,8 +6,9 @@
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <errno.h>
|
||||
#include <regmap.h>
|
||||
#include <syscon.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/stm32mp1_smc.h>
|
||||
#include <power/pmic.h>
|
||||
#include <power/regulator.h>
|
||||
|
||||
@ -26,19 +27,28 @@ struct stm32mp_pwr_reg_info {
|
||||
};
|
||||
|
||||
struct stm32mp_pwr_priv {
|
||||
struct regmap *regmap;
|
||||
fdt_addr_t base;
|
||||
};
|
||||
|
||||
static int stm32mp_pwr_write(struct udevice *dev, uint reg,
|
||||
const uint8_t *buff, int len)
|
||||
{
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
struct stm32mp_pwr_priv *priv = dev_get_priv(dev);
|
||||
#endif
|
||||
u32 val = *(u32 *)buff;
|
||||
|
||||
if (len != 4)
|
||||
return -EINVAL;
|
||||
|
||||
return regmap_write(priv->regmap, STM32MP_PWR_CR3, val);
|
||||
#ifdef CONFIG_STM32MP1_TRUSTED
|
||||
return stm32_smc_exec(STM32_SMC_PWR, STM32_SMC_REG_WRITE,
|
||||
STM32MP_PWR_CR3, val);
|
||||
#else /* CONFIG_STM32MP1_TRUSTED */
|
||||
writel(val, priv->base + STM32MP_PWR_CR3);
|
||||
|
||||
return 0;
|
||||
#endif /* CONFIG_STM32MP1_TRUSTED */
|
||||
}
|
||||
|
||||
static int stm32mp_pwr_read(struct udevice *dev, uint reg, uint8_t *buff,
|
||||
@ -49,21 +59,18 @@ static int stm32mp_pwr_read(struct udevice *dev, uint reg, uint8_t *buff,
|
||||
if (len != 4)
|
||||
return -EINVAL;
|
||||
|
||||
return regmap_read(priv->regmap, STM32MP_PWR_CR3, (u32 *)buff);
|
||||
*(u32 *)buff = readl(priv->base + STM32MP_PWR_CR3);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int stm32mp_pwr_ofdata_to_platdata(struct udevice *dev)
|
||||
{
|
||||
struct stm32mp_pwr_priv *priv = dev_get_priv(dev);
|
||||
struct regmap *regmap;
|
||||
|
||||
regmap = syscon_get_regmap_by_driver_data(STM32MP_SYSCON_PWR);
|
||||
if (IS_ERR(regmap)) {
|
||||
pr_err("%s: unable to find regmap (%ld)\n", __func__,
|
||||
PTR_ERR(regmap));
|
||||
return PTR_ERR(regmap);
|
||||
}
|
||||
priv->regmap = regmap;
|
||||
priv->base = dev_read_addr(dev);
|
||||
if (priv->base == FDT_ADDR_T_NONE)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -38,6 +38,8 @@ u32 spl_boot_device(void)
|
||||
return BOOT_DEVICE_NAND;
|
||||
case BOOT_FLASH_NOR_QSPI:
|
||||
return BOOT_DEVICE_SPI;
|
||||
case BOOT_FLASH_SPINAND_1:
|
||||
return BOOT_DEVICE_NONE; /* SPINAND not supported in SPL */
|
||||
}
|
||||
|
||||
return BOOT_DEVICE_MMC1;
|
||||
@ -75,40 +77,47 @@ void spl_display_print(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
__weak int board_vddcore_set(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void board_init_f(ulong dummy)
|
||||
{
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
int ret, clk, reset, pinctrl, power;
|
||||
|
||||
arch_cpu_init();
|
||||
|
||||
ret = spl_early_init();
|
||||
if (ret) {
|
||||
debug("spl_early_init() failed: %d\n", ret);
|
||||
debug("%s: spl_early_init() failed: %d\n", __func__, ret);
|
||||
hang();
|
||||
}
|
||||
|
||||
ret = uclass_get_device(UCLASS_CLK, 0, &dev);
|
||||
if (ret) {
|
||||
debug("Clock init failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
clk = uclass_get_device(UCLASS_CLK, 0, &dev);
|
||||
if (clk)
|
||||
debug("%s: Clock init failed: %d\n", __func__, clk);
|
||||
|
||||
ret = uclass_get_device(UCLASS_RESET, 0, &dev);
|
||||
if (ret) {
|
||||
debug("Reset init failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
reset = uclass_get_device(UCLASS_RESET, 0, &dev);
|
||||
if (reset)
|
||||
debug("%s: Reset init failed: %d\n", __func__, reset);
|
||||
|
||||
ret = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
|
||||
if (ret) {
|
||||
debug("%s: Cannot find pinctrl device\n", __func__);
|
||||
return;
|
||||
}
|
||||
pinctrl = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
|
||||
if (pinctrl)
|
||||
debug("%s: Cannot find pinctrl device: %d\n",
|
||||
__func__, pinctrl);
|
||||
|
||||
/* enable console uart printing */
|
||||
preloader_console_init();
|
||||
|
||||
/* change vddcore if needed after clock tree init */
|
||||
power = board_vddcore_set();
|
||||
|
||||
if (clk || reset || pinctrl || power)
|
||||
printf("%s: probe failed clk=%d reset=%d pinctrl=%d power=%d\n",
|
||||
__func__, clk, reset, pinctrl, power);
|
||||
|
||||
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
|
||||
if (ret) {
|
||||
printf("DRAM init failed: %d\n", ret);
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
#include <asm/arch/stm32.h>
|
||||
|
||||
static const struct udevice_id stm32mp_syscon_ids[] = {
|
||||
{ .compatible = "st,stm32mp1-pwr", .data = STM32MP_SYSCON_PWR },
|
||||
{ .compatible = "st,stm32mp157-syscfg",
|
||||
.data = STM32MP_SYSCON_SYSCFG },
|
||||
{ }
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
/dts-v1/;
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/gpio/sandbox-gpio.h>
|
||||
|
||||
/ {
|
||||
model = "sandbox";
|
||||
compatible = "sandbox";
|
||||
@ -13,6 +16,7 @@
|
||||
eth5 = ð_5;
|
||||
gpio1 = &gpio_a;
|
||||
gpio2 = &gpio_b;
|
||||
gpio3 = &gpio_c;
|
||||
i2c0 = "/i2c@0";
|
||||
mmc0 = "/mmc0";
|
||||
mmc1 = "/mmc1";
|
||||
@ -86,11 +90,21 @@
|
||||
ping-expect = <0>;
|
||||
ping-add = <0>;
|
||||
u-boot,dm-pre-reloc;
|
||||
test-gpios = <&gpio_a 1>, <&gpio_a 4>, <&gpio_b 5 0 3 2 1>,
|
||||
test-gpios = <&gpio_a 1>, <&gpio_a 4>,
|
||||
<&gpio_b 5 GPIO_ACTIVE_HIGH 3 2 1>,
|
||||
<0>, <&gpio_a 12>;
|
||||
test2-gpios = <&gpio_a 1>, <&gpio_a 4>, <&gpio_b 6 1 3 2 1>,
|
||||
<&gpio_b 7 2 3 2 1>, <&gpio_b 8 4 3 2 1>,
|
||||
<&gpio_b 9 0xc 3 2 1>;
|
||||
test2-gpios = <&gpio_a 1>, <&gpio_a 4>,
|
||||
<&gpio_b 6 GPIO_ACTIVE_LOW 3 2 1>,
|
||||
<&gpio_b 7 GPIO_IN 3 2 1>,
|
||||
<&gpio_b 8 GPIO_OUT 3 2 1>,
|
||||
<&gpio_b 9 (GPIO_OUT|GPIO_OUT_ACTIVE) 3 2 1>;
|
||||
test3-gpios =
|
||||
<&gpio_c 0 (GPIO_OUT|GPIO_OPEN_DRAIN)>,
|
||||
<&gpio_c 1 (GPIO_OUT|GPIO_OPEN_SOURCE)>,
|
||||
<&gpio_c 2 GPIO_OUT>,
|
||||
<&gpio_c 3 (GPIO_IN|GPIO_PULL_UP)>,
|
||||
<&gpio_c 4 (GPIO_IN|GPIO_PULL_DOWN)>,
|
||||
<&gpio_c 5 GPIO_IN>;
|
||||
int-value = <1234>;
|
||||
uint-value = <(-1234)>;
|
||||
};
|
||||
@ -274,6 +288,9 @@
|
||||
};
|
||||
};
|
||||
|
||||
pinctrl-gpio {
|
||||
compatible = "sandbox,pinctrl-gpio";
|
||||
|
||||
gpio_a: base-gpios {
|
||||
compatible = "sandbox,gpio";
|
||||
gpio-controller;
|
||||
@ -290,6 +307,15 @@
|
||||
sandbox,gpio-count = <10>;
|
||||
};
|
||||
|
||||
gpio_c: pinmux-gpios {
|
||||
compatible = "sandbox,gpio";
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-bank-name = "c";
|
||||
sandbox,gpio-count = <10>;
|
||||
};
|
||||
};
|
||||
|
||||
i2c@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
@ -851,6 +877,31 @@
|
||||
|
||||
pinctrl {
|
||||
compatible = "sandbox,pinctrl";
|
||||
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&gpios>;
|
||||
|
||||
gpios: gpios {
|
||||
gpio0 {
|
||||
pins = "GPIO0";
|
||||
bias-pull-up;
|
||||
input-disable;
|
||||
};
|
||||
gpio1 {
|
||||
pins = "GPIO1";
|
||||
output-high;
|
||||
drive-open-drain;
|
||||
};
|
||||
gpio2 {
|
||||
pins = "GPIO2";
|
||||
bias-pull-down;
|
||||
input-enable;
|
||||
};
|
||||
gpio3 {
|
||||
pins = "GPIO3";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hwspinlock@0 {
|
||||
|
||||
@ -42,26 +42,6 @@ int sandbox_gpio_get_value(struct udevice *dev, unsigned int offset);
|
||||
*/
|
||||
int sandbox_gpio_set_value(struct udevice *dev, unsigned int offset, int value);
|
||||
|
||||
/**
|
||||
* Set or reset the simulated open drain mode of a GPIO (used only in sandbox
|
||||
* test code)
|
||||
*
|
||||
* @param gp GPIO number
|
||||
* @param value value to set (0 for enabled open drain mode, non-zero for
|
||||
* disabled)
|
||||
* @return -1 on error, 0 if ok
|
||||
*/
|
||||
int sandbox_gpio_set_open_drain(struct udevice *dev, unsigned offset, int value);
|
||||
|
||||
/**
|
||||
* Return the state of the simulated open drain mode of a GPIO (used only in
|
||||
* sandbox test code)
|
||||
*
|
||||
* @param gp GPIO number
|
||||
* @return -1 on error, 0 if GPIO is input, >0 if output
|
||||
*/
|
||||
int sandbox_gpio_get_open_drain(struct udevice *dev, unsigned offset);
|
||||
|
||||
/**
|
||||
* Return the simulated direction of a GPIO (used only in sandbox test code)
|
||||
*
|
||||
@ -82,4 +62,24 @@ int sandbox_gpio_get_direction(struct udevice *dev, unsigned int offset);
|
||||
int sandbox_gpio_set_direction(struct udevice *dev, unsigned int offset,
|
||||
int output);
|
||||
|
||||
/**
|
||||
* Return the simulated flags of a GPIO (used only in sandbox test code)
|
||||
*
|
||||
* @param dev device to use
|
||||
* @param offset GPIO offset within bank
|
||||
* @return dir_flags: bitfield accesses by GPIOD_ defines
|
||||
*/
|
||||
ulong sandbox_gpio_get_dir_flags(struct udevice *dev, unsigned int offset);
|
||||
|
||||
/**
|
||||
* Set the simulated flags of a GPIO (used only in sandbox test code)
|
||||
*
|
||||
* @param dev device to use
|
||||
* @param offset GPIO offset within bank
|
||||
* @param flags dir_flags: bitfield accesses by GPIOD_ defines
|
||||
* @return -1 on error, 0 if ok
|
||||
*/
|
||||
int sandbox_gpio_set_dir_flags(struct udevice *dev, unsigned int offset,
|
||||
ulong flags);
|
||||
|
||||
#endif
|
||||
|
||||
22
board/dhelectronics/dh_stm32mp1/Kconfig
Normal file
22
board/dhelectronics/dh_stm32mp1/Kconfig
Normal file
@ -0,0 +1,22 @@
|
||||
if TARGET_DH_STM32MP1_PDK2
|
||||
|
||||
config SYS_BOARD
|
||||
default "dh_stm32mp1"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "dhelectronics"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "stm32mp1"
|
||||
|
||||
config ENV_SECT_SIZE
|
||||
default 0x10000 if ENV_IS_IN_SPI_FLASH
|
||||
|
||||
config ENV_OFFSET
|
||||
default 0x1E0000 if ENV_IS_IN_SPI_FLASH
|
||||
|
||||
config ENV_OFFSET_REDUND
|
||||
default 0x1F0000 if ENV_IS_IN_SPI_FLASH
|
||||
|
||||
source "board/st/common/Kconfig"
|
||||
endif
|
||||
7
board/dhelectronics/dh_stm32mp1/MAINTAINERS
Normal file
7
board/dhelectronics/dh_stm32mp1/MAINTAINERS
Normal file
@ -0,0 +1,7 @@
|
||||
DH_STM32MP1_PDK2 BOARD
|
||||
M: Marek Vasut <marex@denx.de>
|
||||
S: Maintained
|
||||
F: arch/arm/dts/stm32mp15xx-dhcom*
|
||||
F: board/dhelectronics/dh_stm32mp1/
|
||||
F: configs/stm32mp15_dhcom_basic_defconfig
|
||||
F: include/configs/stm32mp1.h
|
||||
13
board/dhelectronics/dh_stm32mp1/Makefile
Normal file
13
board/dhelectronics/dh_stm32mp1/Makefile
Normal file
@ -0,0 +1,13 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
#
|
||||
# Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
#
|
||||
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
obj-y += ../../st/stm32mp1/spl.o
|
||||
endif
|
||||
|
||||
obj-y += ../../st/stm32mp1/board.o board.o
|
||||
|
||||
obj-$(CONFIG_SYS_MTDPARTS_RUNTIME) += ../../st/common/stm32mp_mtdparts.o
|
||||
obj-$(CONFIG_SET_DFU_ALT_INFO) += ../../st/common/stm32mp_dfu.o
|
||||
547
board/dhelectronics/dh_stm32mp1/board.c
Normal file
547
board/dhelectronics/dh_stm32mp1/board.c
Normal file
@ -0,0 +1,547 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2018, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <adc.h>
|
||||
#include <asm/arch/stm32.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/io.h>
|
||||
#include <bootm.h>
|
||||
#include <clk.h>
|
||||
#include <config.h>
|
||||
#include <dm.h>
|
||||
#include <dm/device.h>
|
||||
#include <dm/uclass.h>
|
||||
#include <env.h>
|
||||
#include <env_internal.h>
|
||||
#include <g_dnl.h>
|
||||
#include <generic-phy.h>
|
||||
#include <i2c.h>
|
||||
#include <i2c_eeprom.h>
|
||||
#include <init.h>
|
||||
#include <led.h>
|
||||
#include <memalign.h>
|
||||
#include <misc.h>
|
||||
#include <mtd.h>
|
||||
#include <mtd_node.h>
|
||||
#include <netdev.h>
|
||||
#include <phy.h>
|
||||
#include <power/regulator.h>
|
||||
#include <remoteproc.h>
|
||||
#include <reset.h>
|
||||
#include <syscon.h>
|
||||
#include <usb.h>
|
||||
#include <usb/dwc2_udc.h>
|
||||
#include <watchdog.h>
|
||||
|
||||
/* SYSCFG registers */
|
||||
#define SYSCFG_BOOTR 0x00
|
||||
#define SYSCFG_PMCSETR 0x04
|
||||
#define SYSCFG_IOCTRLSETR 0x18
|
||||
#define SYSCFG_ICNR 0x1C
|
||||
#define SYSCFG_CMPCR 0x20
|
||||
#define SYSCFG_CMPENSETR 0x24
|
||||
#define SYSCFG_PMCCLRR 0x44
|
||||
|
||||
#define SYSCFG_BOOTR_BOOT_MASK GENMASK(2, 0)
|
||||
#define SYSCFG_BOOTR_BOOTPD_SHIFT 4
|
||||
|
||||
#define SYSCFG_IOCTRLSETR_HSLVEN_TRACE BIT(0)
|
||||
#define SYSCFG_IOCTRLSETR_HSLVEN_QUADSPI BIT(1)
|
||||
#define SYSCFG_IOCTRLSETR_HSLVEN_ETH BIT(2)
|
||||
#define SYSCFG_IOCTRLSETR_HSLVEN_SDMMC BIT(3)
|
||||
#define SYSCFG_IOCTRLSETR_HSLVEN_SPI BIT(4)
|
||||
|
||||
#define SYSCFG_CMPCR_SW_CTRL BIT(1)
|
||||
#define SYSCFG_CMPCR_READY BIT(8)
|
||||
|
||||
#define SYSCFG_CMPENSETR_MPU_EN BIT(0)
|
||||
|
||||
#define SYSCFG_PMCSETR_ETH_CLK_SEL BIT(16)
|
||||
#define SYSCFG_PMCSETR_ETH_REF_CLK_SEL BIT(17)
|
||||
|
||||
#define SYSCFG_PMCSETR_ETH_SELMII BIT(20)
|
||||
|
||||
#define SYSCFG_PMCSETR_ETH_SEL_MASK GENMASK(23, 21)
|
||||
#define SYSCFG_PMCSETR_ETH_SEL_GMII_MII 0
|
||||
#define SYSCFG_PMCSETR_ETH_SEL_RGMII BIT(21)
|
||||
#define SYSCFG_PMCSETR_ETH_SEL_RMII BIT(23)
|
||||
|
||||
/*
|
||||
* Get a global data pointer
|
||||
*/
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
int setup_mac_address(void)
|
||||
{
|
||||
struct udevice *dev;
|
||||
ofnode eeprom;
|
||||
unsigned char enetaddr[6];
|
||||
int ret;
|
||||
|
||||
ret = eth_env_get_enetaddr("ethaddr", enetaddr);
|
||||
if (ret) /* ethaddr is already set */
|
||||
return 0;
|
||||
|
||||
eeprom = ofnode_path("/soc/i2c@5c002000/eeprom@50");
|
||||
if (!ofnode_valid(eeprom)) {
|
||||
printf("Invalid hardware path to EEPROM!\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
ret = uclass_get_device_by_ofnode(UCLASS_I2C_EEPROM, eeprom, &dev);
|
||||
if (ret) {
|
||||
printf("Cannot find EEPROM!\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = i2c_eeprom_read(dev, 0xfa, enetaddr, 0x6);
|
||||
if (ret) {
|
||||
printf("Error reading configuration EEPROM!\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (is_valid_ethaddr(enetaddr))
|
||||
eth_env_set_enetaddr("ethaddr", enetaddr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int checkboard(void)
|
||||
{
|
||||
char *mode;
|
||||
const char *fdt_compat;
|
||||
int fdt_compat_len;
|
||||
|
||||
if (IS_ENABLED(CONFIG_STM32MP1_TRUSTED))
|
||||
mode = "trusted";
|
||||
else
|
||||
mode = "basic";
|
||||
|
||||
printf("Board: stm32mp1 in %s mode", mode);
|
||||
fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible",
|
||||
&fdt_compat_len);
|
||||
if (fdt_compat && fdt_compat_len)
|
||||
printf(" (%s)", fdt_compat);
|
||||
puts("\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void board_key_check(void)
|
||||
{
|
||||
#if defined(CONFIG_FASTBOOT) || defined(CONFIG_CMD_STM32PROG)
|
||||
ofnode node;
|
||||
struct gpio_desc gpio;
|
||||
enum forced_boot_mode boot_mode = BOOT_NORMAL;
|
||||
|
||||
node = ofnode_path("/config");
|
||||
if (!ofnode_valid(node)) {
|
||||
debug("%s: no /config node?\n", __func__);
|
||||
return;
|
||||
}
|
||||
#ifdef CONFIG_FASTBOOT
|
||||
if (gpio_request_by_name_nodev(node, "st,fastboot-gpios", 0,
|
||||
&gpio, GPIOD_IS_IN)) {
|
||||
debug("%s: could not find a /config/st,fastboot-gpios\n",
|
||||
__func__);
|
||||
} else {
|
||||
if (dm_gpio_get_value(&gpio)) {
|
||||
puts("Fastboot key pressed, ");
|
||||
boot_mode = BOOT_FASTBOOT;
|
||||
}
|
||||
|
||||
dm_gpio_free(NULL, &gpio);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_CMD_STM32PROG
|
||||
if (gpio_request_by_name_nodev(node, "st,stm32prog-gpios", 0,
|
||||
&gpio, GPIOD_IS_IN)) {
|
||||
debug("%s: could not find a /config/st,stm32prog-gpios\n",
|
||||
__func__);
|
||||
} else {
|
||||
if (dm_gpio_get_value(&gpio)) {
|
||||
puts("STM32Programmer key pressed, ");
|
||||
boot_mode = BOOT_STM32PROG;
|
||||
}
|
||||
dm_gpio_free(NULL, &gpio);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (boot_mode != BOOT_NORMAL) {
|
||||
puts("entering download mode...\n");
|
||||
clrsetbits_le32(TAMP_BOOT_CONTEXT,
|
||||
TAMP_BOOT_FORCED_MASK,
|
||||
boot_mode);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG)
|
||||
|
||||
#include <usb/dwc2_udc.h>
|
||||
int g_dnl_board_usb_cable_connected(void)
|
||||
{
|
||||
struct udevice *dwc2_udc_otg;
|
||||
int ret;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_USB_GADGET_GENERIC,
|
||||
DM_GET_DRIVER(dwc2_udc_otg),
|
||||
&dwc2_udc_otg);
|
||||
if (!ret)
|
||||
debug("dwc2_udc_otg init failed\n");
|
||||
|
||||
return dwc2_udc_B_session_valid(dwc2_udc_otg);
|
||||
}
|
||||
|
||||
#define STM32MP1_G_DNL_DFU_PRODUCT_NUM 0xdf11
|
||||
#define STM32MP1_G_DNL_FASTBOOT_PRODUCT_NUM 0x0afb
|
||||
|
||||
int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
|
||||
{
|
||||
if (!strcmp(name, "usb_dnl_dfu"))
|
||||
put_unaligned(STM32MP1_G_DNL_DFU_PRODUCT_NUM, &dev->idProduct);
|
||||
else if (!strcmp(name, "usb_dnl_fastboot"))
|
||||
put_unaligned(STM32MP1_G_DNL_FASTBOOT_PRODUCT_NUM,
|
||||
&dev->idProduct);
|
||||
else
|
||||
put_unaligned(CONFIG_USB_GADGET_PRODUCT_NUM, &dev->idProduct);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_USB_GADGET */
|
||||
|
||||
#ifdef CONFIG_LED
|
||||
static int get_led(struct udevice **dev, char *led_string)
|
||||
{
|
||||
char *led_name;
|
||||
int ret;
|
||||
|
||||
led_name = fdtdec_get_config_string(gd->fdt_blob, led_string);
|
||||
if (!led_name) {
|
||||
pr_debug("%s: could not find %s config string\n",
|
||||
__func__, led_string);
|
||||
return -ENOENT;
|
||||
}
|
||||
ret = led_get_by_label(led_name, dev);
|
||||
if (ret) {
|
||||
debug("%s: get=%d\n", __func__, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int setup_led(enum led_state_t cmd)
|
||||
{
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
|
||||
ret = get_led(&dev, "u-boot,boot-led");
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = led_set_state(dev, cmd);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void __maybe_unused led_error_blink(u32 nb_blink)
|
||||
{
|
||||
#ifdef CONFIG_LED
|
||||
int ret;
|
||||
struct udevice *led;
|
||||
u32 i;
|
||||
#endif
|
||||
|
||||
if (!nb_blink)
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_LED
|
||||
ret = get_led(&led, "u-boot,error-led");
|
||||
if (!ret) {
|
||||
/* make u-boot,error-led blinking */
|
||||
/* if U32_MAX and 125ms interval, for 17.02 years */
|
||||
for (i = 0; i < 2 * nb_blink; i++) {
|
||||
led_set_state(led, LEDST_TOGGLE);
|
||||
mdelay(125);
|
||||
WATCHDOG_RESET();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* infinite: the boot process must be stopped */
|
||||
if (nb_blink == U32_MAX)
|
||||
hang();
|
||||
}
|
||||
|
||||
static void sysconf_init(void)
|
||||
{
|
||||
#ifndef CONFIG_STM32MP1_TRUSTED
|
||||
u8 *syscfg;
|
||||
#ifdef CONFIG_DM_REGULATOR
|
||||
struct udevice *pwr_dev;
|
||||
struct udevice *pwr_reg;
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
u32 otp = 0;
|
||||
#endif
|
||||
u32 bootr;
|
||||
|
||||
syscfg = (u8 *)syscon_get_first_range(STM32MP_SYSCON_SYSCFG);
|
||||
|
||||
/* interconnect update : select master using the port 1 */
|
||||
/* LTDC = AXI_M9 */
|
||||
/* GPU = AXI_M8 */
|
||||
/* today information is hardcoded in U-Boot */
|
||||
writel(BIT(9), syscfg + SYSCFG_ICNR);
|
||||
|
||||
/* disable Pull-Down for boot pin connected to VDD */
|
||||
bootr = readl(syscfg + SYSCFG_BOOTR);
|
||||
bootr &= ~(SYSCFG_BOOTR_BOOT_MASK << SYSCFG_BOOTR_BOOTPD_SHIFT);
|
||||
bootr |= (bootr & SYSCFG_BOOTR_BOOT_MASK) << SYSCFG_BOOTR_BOOTPD_SHIFT;
|
||||
writel(bootr, syscfg + SYSCFG_BOOTR);
|
||||
|
||||
#ifdef CONFIG_DM_REGULATOR
|
||||
/* High Speed Low Voltage Pad mode Enable for SPI, SDMMC, ETH, QSPI
|
||||
* and TRACE. Needed above ~50MHz and conditioned by AFMUX selection.
|
||||
* The customer will have to disable this for low frequencies
|
||||
* or if AFMUX is selected but the function not used, typically for
|
||||
* TRACE. Otherwise, impact on power consumption.
|
||||
*
|
||||
* WARNING:
|
||||
* enabling High Speed mode while VDD>2.7V
|
||||
* with the OTP product_below_2v5 (OTP 18, BIT 13)
|
||||
* erroneously set to 1 can damage the IC!
|
||||
* => U-Boot set the register only if VDD < 2.7V (in DT)
|
||||
* but this value need to be consistent with board design
|
||||
*/
|
||||
ret = uclass_get_device_by_driver(UCLASS_PMIC,
|
||||
DM_GET_DRIVER(stm32mp_pwr_pmic),
|
||||
&pwr_dev);
|
||||
if (!ret) {
|
||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||
DM_GET_DRIVER(stm32mp_bsec),
|
||||
&dev);
|
||||
if (ret) {
|
||||
pr_err("Can't find stm32mp_bsec driver\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ret = misc_read(dev, STM32_BSEC_SHADOW(18), &otp, 4);
|
||||
if (ret > 0)
|
||||
otp = otp & BIT(13);
|
||||
|
||||
/* get VDD = vdd-supply */
|
||||
ret = device_get_supply_regulator(pwr_dev, "vdd-supply",
|
||||
&pwr_reg);
|
||||
|
||||
/* check if VDD is Low Voltage */
|
||||
if (!ret) {
|
||||
if (regulator_get_value(pwr_reg) < 2700000) {
|
||||
writel(SYSCFG_IOCTRLSETR_HSLVEN_TRACE |
|
||||
SYSCFG_IOCTRLSETR_HSLVEN_QUADSPI |
|
||||
SYSCFG_IOCTRLSETR_HSLVEN_ETH |
|
||||
SYSCFG_IOCTRLSETR_HSLVEN_SDMMC |
|
||||
SYSCFG_IOCTRLSETR_HSLVEN_SPI,
|
||||
syscfg + SYSCFG_IOCTRLSETR);
|
||||
|
||||
if (!otp)
|
||||
pr_err("product_below_2v5=0: HSLVEN protected by HW\n");
|
||||
} else {
|
||||
if (otp)
|
||||
pr_err("product_below_2v5=1: HSLVEN update is destructive, no update as VDD>2.7V\n");
|
||||
}
|
||||
} else {
|
||||
debug("VDD unknown");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* activate automatic I/O compensation
|
||||
* warning: need to ensure CSI enabled and ready in clock driver
|
||||
*/
|
||||
writel(SYSCFG_CMPENSETR_MPU_EN, syscfg + SYSCFG_CMPENSETR);
|
||||
|
||||
while (!(readl(syscfg + SYSCFG_CMPCR) & SYSCFG_CMPCR_READY))
|
||||
;
|
||||
clrbits_le32(syscfg + SYSCFG_CMPCR, SYSCFG_CMPCR_SW_CTRL);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* board dependent setup after realloc */
|
||||
int board_init(void)
|
||||
{
|
||||
struct udevice *dev;
|
||||
|
||||
/* address of boot parameters */
|
||||
gd->bd->bi_boot_params = STM32_DDR_BASE + 0x100;
|
||||
|
||||
/* probe all PINCTRL for hog */
|
||||
for (uclass_first_device(UCLASS_PINCTRL, &dev);
|
||||
dev;
|
||||
uclass_next_device(&dev)) {
|
||||
pr_debug("probe pincontrol = %s\n", dev->name);
|
||||
}
|
||||
|
||||
board_key_check();
|
||||
|
||||
#ifdef CONFIG_DM_REGULATOR
|
||||
regulators_enable_boot_on(_DEBUG);
|
||||
#endif
|
||||
|
||||
sysconf_init();
|
||||
|
||||
if (CONFIG_IS_ENABLED(LED))
|
||||
led_default_state();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_late_init(void)
|
||||
{
|
||||
char *boot_device;
|
||||
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
|
||||
const void *fdt_compat;
|
||||
int fdt_compat_len;
|
||||
|
||||
fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible",
|
||||
&fdt_compat_len);
|
||||
if (fdt_compat && fdt_compat_len) {
|
||||
if (strncmp(fdt_compat, "st,", 3) != 0)
|
||||
env_set("board_name", fdt_compat);
|
||||
else
|
||||
env_set("board_name", fdt_compat + 3);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Check the boot-source to disable bootdelay */
|
||||
boot_device = env_get("boot_device");
|
||||
if (!strcmp(boot_device, "serial") || !strcmp(boot_device, "usb"))
|
||||
env_set("bootdelay", "0");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void board_quiesce_devices(void)
|
||||
{
|
||||
#ifdef CONFIG_LED
|
||||
setup_led(LEDST_OFF);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* eth init function : weak called in eqos driver */
|
||||
int board_interface_eth_init(struct udevice *dev,
|
||||
phy_interface_t interface_type)
|
||||
{
|
||||
u8 *syscfg;
|
||||
u32 value;
|
||||
bool eth_clk_sel_reg = false;
|
||||
bool eth_ref_clk_sel_reg = false;
|
||||
|
||||
/* Gigabit Ethernet 125MHz clock selection. */
|
||||
eth_clk_sel_reg = dev_read_bool(dev, "st,eth_clk_sel");
|
||||
|
||||
/* Ethernet 50Mhz RMII clock selection */
|
||||
eth_ref_clk_sel_reg =
|
||||
dev_read_bool(dev, "st,eth_ref_clk_sel");
|
||||
|
||||
syscfg = (u8 *)syscon_get_first_range(STM32MP_SYSCON_SYSCFG);
|
||||
|
||||
if (!syscfg)
|
||||
return -ENODEV;
|
||||
|
||||
switch (interface_type) {
|
||||
case PHY_INTERFACE_MODE_MII:
|
||||
value = SYSCFG_PMCSETR_ETH_SEL_GMII_MII |
|
||||
SYSCFG_PMCSETR_ETH_REF_CLK_SEL;
|
||||
debug("%s: PHY_INTERFACE_MODE_MII\n", __func__);
|
||||
break;
|
||||
case PHY_INTERFACE_MODE_GMII:
|
||||
if (eth_clk_sel_reg)
|
||||
value = SYSCFG_PMCSETR_ETH_SEL_GMII_MII |
|
||||
SYSCFG_PMCSETR_ETH_CLK_SEL;
|
||||
else
|
||||
value = SYSCFG_PMCSETR_ETH_SEL_GMII_MII;
|
||||
debug("%s: PHY_INTERFACE_MODE_GMII\n", __func__);
|
||||
break;
|
||||
case PHY_INTERFACE_MODE_RMII:
|
||||
if (eth_ref_clk_sel_reg)
|
||||
value = SYSCFG_PMCSETR_ETH_SEL_RMII |
|
||||
SYSCFG_PMCSETR_ETH_REF_CLK_SEL;
|
||||
else
|
||||
value = SYSCFG_PMCSETR_ETH_SEL_RMII;
|
||||
debug("%s: PHY_INTERFACE_MODE_RMII\n", __func__);
|
||||
break;
|
||||
case PHY_INTERFACE_MODE_RGMII:
|
||||
case PHY_INTERFACE_MODE_RGMII_ID:
|
||||
case PHY_INTERFACE_MODE_RGMII_RXID:
|
||||
case PHY_INTERFACE_MODE_RGMII_TXID:
|
||||
if (eth_clk_sel_reg)
|
||||
value = SYSCFG_PMCSETR_ETH_SEL_RGMII |
|
||||
SYSCFG_PMCSETR_ETH_CLK_SEL;
|
||||
else
|
||||
value = SYSCFG_PMCSETR_ETH_SEL_RGMII;
|
||||
debug("%s: PHY_INTERFACE_MODE_RGMII\n", __func__);
|
||||
break;
|
||||
default:
|
||||
debug("%s: Do not manage %d interface\n",
|
||||
__func__, interface_type);
|
||||
/* Do not manage others interfaces */
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* clear and set ETH configuration bits */
|
||||
writel(SYSCFG_PMCSETR_ETH_SEL_MASK | SYSCFG_PMCSETR_ETH_SELMII |
|
||||
SYSCFG_PMCSETR_ETH_REF_CLK_SEL | SYSCFG_PMCSETR_ETH_CLK_SEL,
|
||||
syscfg + SYSCFG_PMCCLRR);
|
||||
writel(value, syscfg + SYSCFG_PMCSETR);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum env_location env_get_location(enum env_operation op, int prio)
|
||||
{
|
||||
if (prio)
|
||||
return ENVL_UNKNOWN;
|
||||
|
||||
#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
|
||||
return ENVL_SPI_FLASH;
|
||||
#else
|
||||
return ENVL_NOWHERE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(CONFIG_OF_BOARD_SETUP)
|
||||
int ft_board_setup(void *blob, bd_t *bd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void board_copro_image_process(ulong fw_image, size_t fw_size)
|
||||
{
|
||||
int ret, id = 0; /* Copro id fixed to 0 as only one coproc on mp1 */
|
||||
|
||||
if (!rproc_is_initialized())
|
||||
if (rproc_init()) {
|
||||
printf("Remote Processor %d initialization failed\n",
|
||||
id);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = rproc_load(id, fw_image, fw_size);
|
||||
printf("Load Remote Processor %d with data@addr=0x%08lx %u bytes:%s\n",
|
||||
id, fw_image, fw_size, ret ? " Failed!" : " Success!");
|
||||
|
||||
if (!ret) {
|
||||
rproc_start(id);
|
||||
env_set("copro_state", "booted");
|
||||
}
|
||||
}
|
||||
|
||||
U_BOOT_FIT_LOADABLE_HANDLER(IH_TYPE_COPRO, board_copro_image_process);
|
||||
71
board/st/common/Kconfig
Normal file
71
board/st/common/Kconfig
Normal file
@ -0,0 +1,71 @@
|
||||
config CMD_STBOARD
|
||||
bool "stboard - command for OTP board information"
|
||||
depends on ARCH_STM32MP
|
||||
default y if TARGET_ST_STM32MP15x
|
||||
help
|
||||
This compile the stboard command to
|
||||
read and write the board in the OTP.
|
||||
|
||||
config MTDPARTS_NAND0_BOOT
|
||||
string "mtd boot partitions for nand0"
|
||||
default "2m(fsbl),2m(ssbl1),2m(ssbl2)"
|
||||
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
|
||||
help
|
||||
This define the partitions of nand0 used to build mtparts dynamically
|
||||
for boot from nand0.
|
||||
Each partition need to be aligned with the device erase block size,
|
||||
512KB is the max size for the NAND supported by stm32mp1 platform.
|
||||
|
||||
config MTDPARTS_NAND0_TEE
|
||||
string "mtd tee partitions for nand0"
|
||||
default "512k(teeh),512k(teed),512k(teex)"
|
||||
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
|
||||
help
|
||||
This define the tee partitions added in mtparts dynamically
|
||||
when tee is supported with boot from nand0.
|
||||
Each partition need to be aligned with the device erase block size,
|
||||
512KB is the max size for the NAND supported by stm32mp1 platform.
|
||||
|
||||
config MTDPARTS_NOR0_BOOT
|
||||
string "mtd boot partitions for nor0"
|
||||
default "256k(fsbl1),256k(fsbl2),2m(ssbl),512k(u-boot-env)"
|
||||
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
|
||||
help
|
||||
This define the partitions of nand0 used to build mtparts dynamically
|
||||
for boot from nor0.
|
||||
Each partition need to be aligned with the device erase block size,
|
||||
with 256KB we support all the NOR.
|
||||
U-Boot env partition (512kB) use 2 erase block for redundancy.
|
||||
|
||||
config MTDPARTS_NOR0_TEE
|
||||
string "mtd tee partitions for nor0"
|
||||
default "256k(teeh),512k(teed),256k(teex)"
|
||||
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
|
||||
help
|
||||
This define the tee partitions added in mtparts dynamically
|
||||
when tee is supported with boot from nor0.
|
||||
|
||||
config MTDPARTS_SPINAND0_BOOT
|
||||
string "mtd boot partitions for spi-nand0"
|
||||
default "2m(fsbl),2m(ssbl1),2m(ssbl2)"
|
||||
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
|
||||
help
|
||||
This define the partitions of nand0 used to build mtparts dynamically
|
||||
for boot from spi-nand0,
|
||||
512KB is the max size for the NAND supported by stm32mp1 platform.
|
||||
|
||||
config MTDPARTS_SPINAND0_TEE
|
||||
string "mtd tee partitions for spi-nand0"
|
||||
default "512k(teeh),512k(teed),512k(teex)"
|
||||
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
|
||||
help
|
||||
This define the tee partitions added in mtparts dynamically
|
||||
when tee is supported with boot from spi-nand0,
|
||||
512KB is the max size for the NAND supported by stm32mp1 platform.
|
||||
|
||||
config DFU_ALT_RAM0
|
||||
string "dfu for ram0"
|
||||
default "uImage ram 0xc2000000 0x2000000;devicetree.dtb ram 0xc4000000 0x100000;uramdisk.image.gz ram 0xc4400000 0x10000000"
|
||||
depends on ARCH_STM32MP && SET_DFU_ALT_INFO
|
||||
help
|
||||
This defines the partitions of ram used to build dfu dynamically.
|
||||
6
board/st/common/MAINTAINERS
Normal file
6
board/st/common/MAINTAINERS
Normal file
@ -0,0 +1,6 @@
|
||||
ST BOARDS
|
||||
M: Patrick Delaunay <patrick.delaunay@st.com>
|
||||
L: uboot-stm32@st-md-mailman.stormreply.com (moderated for non-subscribers)
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-stm.git
|
||||
S: Maintained
|
||||
F: board/st/common/
|
||||
11
board/st/common/Makefile
Normal file
11
board/st/common/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
#
|
||||
# Copyright (C) 2020, STMicroelectronics - All Rights Reserved
|
||||
#
|
||||
|
||||
obj-$(CONFIG_CMD_STBOARD) += cmd_stboard.o
|
||||
|
||||
ifeq ($(CONFIG_ARCH_STM32MP),y)
|
||||
obj-$(CONFIG_SYS_MTDPARTS_RUNTIME) += stm32mp_mtdparts.o
|
||||
obj-$(CONFIG_SET_DFU_ALT_INFO) += stm32mp_dfu.o
|
||||
endif
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2019, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
#include <common.h>
|
||||
#include <console.h>
|
||||
#include <misc.h>
|
||||
@ -30,9 +31,10 @@ static bool check_stboard(u16 board)
|
||||
|
||||
static void display_stboard(u32 otp)
|
||||
{
|
||||
printf("Board: MB%04x Var%d Rev.%c-%02d\n",
|
||||
printf("Board: MB%04x Var%d.%d Rev.%c-%02d\n",
|
||||
otp >> 16,
|
||||
(otp >> 12) & 0xF,
|
||||
(otp >> 4) & 0xF,
|
||||
((otp >> 8) & 0xF) - 1 + 'A',
|
||||
otp & 0xF);
|
||||
}
|
||||
@ -41,23 +43,23 @@ static int do_stboard(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
int ret;
|
||||
u32 otp;
|
||||
u32 otp, lock;
|
||||
u8 revision;
|
||||
unsigned long board, variant, bom;
|
||||
unsigned long board, var_cpn, var_fg, bom;
|
||||
struct udevice *dev;
|
||||
int confirmed = argc == 6 && !strcmp(argv[1], "-y");
|
||||
int confirmed = argc == 7 && !strcmp(argv[1], "-y");
|
||||
|
||||
argc -= 1 + confirmed;
|
||||
argv += 1 + confirmed;
|
||||
|
||||
if (argc != 0 && argc != 4)
|
||||
if (argc != 0 && argc != 5)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||
DM_GET_DRIVER(stm32mp_bsec),
|
||||
&dev);
|
||||
|
||||
ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD),
|
||||
ret = misc_read(dev, STM32_BSEC_OTP(BSEC_OTP_BOARD),
|
||||
&otp, sizeof(otp));
|
||||
|
||||
if (ret < 0) {
|
||||
@ -65,11 +67,20 @@ static int do_stboard(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
ret = misc_read(dev, STM32_BSEC_LOCK(BSEC_OTP_BOARD),
|
||||
&lock, sizeof(lock));
|
||||
if (ret < 0) {
|
||||
puts("LOCK read error");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
if (argc == 0) {
|
||||
if (!otp)
|
||||
puts("Board : OTP board FREE\n");
|
||||
else
|
||||
display_stboard(otp);
|
||||
printf(" OTP %d %s locked !\n", BSEC_OTP_BOARD,
|
||||
lock == 1 ? "" : "NOT");
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
|
||||
@ -85,8 +96,8 @@ static int do_stboard(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (strict_strtoul(argv[1], 10, &variant) < 0 ||
|
||||
variant == 0 || variant > 15) {
|
||||
if (strict_strtoul(argv[1], 10, &var_cpn) < 0 ||
|
||||
var_cpn == 0 || var_cpn > 15) {
|
||||
printf("argument %d invalid: %s\n", 2, argv[1]);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
@ -97,13 +108,20 @@ static int do_stboard(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (strict_strtoul(argv[3], 10, &bom) < 0 ||
|
||||
if (strict_strtoul(argv[3], 10, &var_fg) < 0 ||
|
||||
var_fg > 15) {
|
||||
printf("argument %d invalid: %s\n", 4, argv[3]);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (strict_strtoul(argv[4], 10, &bom) < 0 ||
|
||||
bom == 0 || bom > 15) {
|
||||
printf("argument %d invalid: %s\n", 4, argv[3]);
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
otp = (board << 16) | (variant << 12) | (revision << 8) | bom;
|
||||
otp = (board << 16) | (var_cpn << 12) | (revision << 8) |
|
||||
(var_fg << 4) | bom;
|
||||
display_stboard(otp);
|
||||
printf("=> OTP[%d] = %08X\n", BSEC_OTP_BOARD, otp);
|
||||
|
||||
@ -124,22 +142,35 @@ static int do_stboard(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
ret = misc_write(dev, STM32_BSEC_OTP(BSEC_OTP_BOARD),
|
||||
&otp, sizeof(otp));
|
||||
|
||||
if (ret) {
|
||||
if (ret < 0) {
|
||||
puts("BOARD programming error\n");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
/* write persistent lock */
|
||||
otp = 1;
|
||||
ret = misc_write(dev, STM32_BSEC_LOCK(BSEC_OTP_BOARD),
|
||||
&otp, sizeof(otp));
|
||||
if (ret < 0) {
|
||||
puts("BOARD lock error\n");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
puts("BOARD programming done\n");
|
||||
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(stboard, 6, 0, do_stboard,
|
||||
U_BOOT_CMD(stboard, 7, 0, do_stboard,
|
||||
"read/write board reference in OTP",
|
||||
"\n"
|
||||
" Print current board information\n"
|
||||
"stboard [-y] <Board> <Variant> <Revision> <BOM>\n"
|
||||
"stboard [-y] <Board> <VarCPN> <Revision> <VarFG> <BOM>\n"
|
||||
" Write board information\n"
|
||||
" - Board: xxxx, example 1264 for MB1264\n"
|
||||
" - Variant: 1 ... 15\n"
|
||||
" - VarCPN: 1...15\n"
|
||||
" - Revision: A...O\n"
|
||||
" - VarFG: 0...15\n"
|
||||
" - BOM: 1...15\n");
|
||||
|
||||
#endif
|
||||
245
board/st/common/stm32mp_dfu.c
Normal file
245
board/st/common/stm32mp_dfu.c
Normal file
@ -0,0 +1,245 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2020, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <blk.h>
|
||||
#include <dfu.h>
|
||||
#include <env.h>
|
||||
#include <memalign.h>
|
||||
#include <misc.h>
|
||||
#include <mtd.h>
|
||||
#include <mtd_node.h>
|
||||
#include <asm/arch/stm32prog.h>
|
||||
|
||||
#define DFU_ALT_BUF_LEN SZ_1K
|
||||
|
||||
static void board_get_alt_info_mmc(struct udevice *dev, char *buf)
|
||||
{
|
||||
disk_partition_t info;
|
||||
int p, len, devnum;
|
||||
bool first = true;
|
||||
const char *name;
|
||||
struct mmc *mmc;
|
||||
struct blk_desc *desc;
|
||||
|
||||
mmc = mmc_get_mmc_dev(dev);
|
||||
if (!mmc)
|
||||
return;
|
||||
|
||||
if (mmc_init(mmc))
|
||||
return;
|
||||
|
||||
desc = mmc_get_blk_desc(mmc);
|
||||
if (!desc)
|
||||
return;
|
||||
|
||||
name = blk_get_if_type_name(desc->if_type);
|
||||
devnum = desc->devnum;
|
||||
len = strlen(buf);
|
||||
|
||||
if (buf[0] != '\0')
|
||||
len += snprintf(buf + len,
|
||||
DFU_ALT_BUF_LEN - len, "&");
|
||||
len += snprintf(buf + len, DFU_ALT_BUF_LEN - len,
|
||||
"%s %d=", name, devnum);
|
||||
|
||||
if (IS_MMC(mmc) && mmc->capacity_boot) {
|
||||
len += snprintf(buf + len, DFU_ALT_BUF_LEN - len,
|
||||
"%s%d_boot1 raw 0x0 0x%llx mmcpart 1;",
|
||||
name, devnum, mmc->capacity_boot);
|
||||
len += snprintf(buf + len, DFU_ALT_BUF_LEN - len,
|
||||
"%s%d_boot2 raw 0x0 0x%llx mmcpart 2",
|
||||
name, devnum, mmc->capacity_boot);
|
||||
first = false;
|
||||
}
|
||||
|
||||
for (p = 1; p < MAX_SEARCH_PARTITIONS; p++) {
|
||||
if (part_get_info(desc, p, &info))
|
||||
continue;
|
||||
if (!first)
|
||||
len += snprintf(buf + len, DFU_ALT_BUF_LEN - len, ";");
|
||||
first = false;
|
||||
len += snprintf(buf + len, DFU_ALT_BUF_LEN - len,
|
||||
"%s%d_%s part %d %d",
|
||||
name, devnum, info.name, devnum, p);
|
||||
}
|
||||
}
|
||||
|
||||
static void board_get_alt_info_mtd(struct mtd_info *mtd, char *buf)
|
||||
{
|
||||
struct mtd_info *part;
|
||||
bool first = true;
|
||||
const char *name;
|
||||
int len, partnum = 0;
|
||||
|
||||
name = mtd->name;
|
||||
len = strlen(buf);
|
||||
|
||||
if (buf[0] != '\0')
|
||||
len += snprintf(buf + len, DFU_ALT_BUF_LEN - len, "&");
|
||||
len += snprintf(buf + len, DFU_ALT_BUF_LEN - len,
|
||||
"mtd %s=", name);
|
||||
|
||||
len += snprintf(buf + len, DFU_ALT_BUF_LEN - len,
|
||||
"%s raw 0x0 0x%llx ",
|
||||
name, mtd->size);
|
||||
|
||||
list_for_each_entry(part, &mtd->partitions, node) {
|
||||
partnum++;
|
||||
if (!first)
|
||||
len += snprintf(buf + len, DFU_ALT_BUF_LEN - len, ";");
|
||||
first = false;
|
||||
|
||||
len += snprintf(buf + len, DFU_ALT_BUF_LEN - len,
|
||||
"%s_%s part %d",
|
||||
name, part->name, partnum);
|
||||
}
|
||||
}
|
||||
|
||||
void set_dfu_alt_info(char *interface, char *devstr)
|
||||
{
|
||||
struct udevice *dev;
|
||||
struct mtd_info *mtd;
|
||||
|
||||
ALLOC_CACHE_ALIGN_BUFFER(char, buf, DFU_ALT_BUF_LEN);
|
||||
|
||||
if (env_get("dfu_alt_info"))
|
||||
return;
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
snprintf(buf, DFU_ALT_BUF_LEN,
|
||||
"ram 0=%s", CONFIG_DFU_ALT_RAM0);
|
||||
|
||||
if (!uclass_get_device(UCLASS_MMC, 0, &dev))
|
||||
board_get_alt_info_mmc(dev, buf);
|
||||
|
||||
if (!uclass_get_device(UCLASS_MMC, 1, &dev))
|
||||
board_get_alt_info_mmc(dev, buf);
|
||||
|
||||
if (CONFIG_IS_ENABLED(MTD)) {
|
||||
/* probe all MTD devices */
|
||||
mtd_probe_devices();
|
||||
|
||||
/* probe SPI flash device on a bus */
|
||||
if (!uclass_get_device(UCLASS_SPI_FLASH, 0, &dev)) {
|
||||
mtd = get_mtd_device_nm("nor0");
|
||||
if (!IS_ERR_OR_NULL(mtd))
|
||||
board_get_alt_info_mtd(mtd, buf);
|
||||
}
|
||||
|
||||
mtd = get_mtd_device_nm("nand0");
|
||||
if (!IS_ERR_OR_NULL(mtd))
|
||||
board_get_alt_info_mtd(mtd, buf);
|
||||
|
||||
mtd = get_mtd_device_nm("spi-nand0");
|
||||
if (!IS_ERR_OR_NULL(mtd))
|
||||
board_get_alt_info_mtd(mtd, buf);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DFU_VIRT
|
||||
strncat(buf, "&virt 0=OTP", DFU_ALT_BUF_LEN);
|
||||
|
||||
if (IS_ENABLED(CONFIG_PMIC_STPMIC1))
|
||||
strncat(buf, "&virt 1=PMIC", DFU_ALT_BUF_LEN);
|
||||
#endif
|
||||
|
||||
env_set("dfu_alt_info", buf);
|
||||
puts("DFU alt info setting: done\n");
|
||||
}
|
||||
|
||||
#if CONFIG_IS_ENABLED(DFU_VIRT)
|
||||
#include <dfu.h>
|
||||
#include <power/stpmic1.h>
|
||||
|
||||
static int dfu_otp_read(u64 offset, u8 *buffer, long *size)
|
||||
{
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||
DM_GET_DRIVER(stm32mp_bsec),
|
||||
&dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = misc_read(dev, offset + STM32_BSEC_OTP_OFFSET, buffer, *size);
|
||||
if (ret >= 0) {
|
||||
*size = ret;
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dfu_pmic_read(u64 offset, u8 *buffer, long *size)
|
||||
{
|
||||
int ret;
|
||||
#ifdef CONFIG_PMIC_STPMIC1
|
||||
struct udevice *dev;
|
||||
|
||||
ret = uclass_get_device_by_driver(UCLASS_MISC,
|
||||
DM_GET_DRIVER(stpmic1_nvm),
|
||||
&dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = misc_read(dev, 0xF8 + offset, buffer, *size);
|
||||
if (ret >= 0) {
|
||||
*size = ret;
|
||||
ret = 0;
|
||||
}
|
||||
if (ret == -EACCES) {
|
||||
*size = 0;
|
||||
ret = 0;
|
||||
}
|
||||
#else
|
||||
pr_err("PMIC update not supported");
|
||||
ret = -EOPNOTSUPP;
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int dfu_read_medium_virt(struct dfu_entity *dfu, u64 offset,
|
||||
void *buf, long *len)
|
||||
{
|
||||
switch (dfu->data.virt.dev_num) {
|
||||
case 0x0:
|
||||
return dfu_otp_read(offset, buf, len);
|
||||
case 0x1:
|
||||
return dfu_pmic_read(offset, buf, len);
|
||||
}
|
||||
|
||||
if (CONFIG_IS_ENABLED(CMD_STM32PROG) &&
|
||||
dfu->data.virt.dev_num >= STM32PROG_VIRT_FIRST_DEV_NUM)
|
||||
return stm32prog_read_medium_virt(dfu, offset, buf, len);
|
||||
|
||||
*len = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dfu_write_medium_virt(struct dfu_entity *dfu, u64 offset,
|
||||
void *buf, long *len)
|
||||
{
|
||||
if (CONFIG_IS_ENABLED(CMD_STM32PROG) &&
|
||||
dfu->data.virt.dev_num >= STM32PROG_VIRT_FIRST_DEV_NUM)
|
||||
return stm32prog_write_medium_virt(dfu, offset, buf, len);
|
||||
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
int __weak dfu_get_medium_size_virt(struct dfu_entity *dfu, u64 *size)
|
||||
{
|
||||
if (CONFIG_IS_ENABLED(CMD_STM32PROG) &&
|
||||
dfu->data.virt.dev_num >= STM32PROG_VIRT_FIRST_DEV_NUM)
|
||||
return stm32prog_get_medium_size_virt(dfu, size);
|
||||
|
||||
*size = SZ_1K;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
167
board/st/common/stm32mp_mtdparts.c
Normal file
167
board/st/common/stm32mp_mtdparts.c
Normal file
@ -0,0 +1,167 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2020, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dfu.h>
|
||||
#include <dm.h>
|
||||
#include <env.h>
|
||||
#include <env_internal.h>
|
||||
#include <mtd.h>
|
||||
#include <mtd_node.h>
|
||||
#include <tee.h>
|
||||
#include <asm/arch/stm32prog.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
|
||||
#define MTDPARTS_LEN 256
|
||||
#define MTDIDS_LEN 128
|
||||
|
||||
/*
|
||||
* Get a global data pointer
|
||||
*/
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/**
|
||||
* update the variables "mtdids" and "mtdparts" with boot, tee and user strings
|
||||
*/
|
||||
static void board_set_mtdparts(const char *dev,
|
||||
char *mtdids,
|
||||
char *mtdparts,
|
||||
const char *boot,
|
||||
const char *tee,
|
||||
const char *user)
|
||||
{
|
||||
/* mtdids: "<dev>=<dev>, ...." */
|
||||
if (mtdids[0] != '\0')
|
||||
strcat(mtdids, ",");
|
||||
strcat(mtdids, dev);
|
||||
strcat(mtdids, "=");
|
||||
strcat(mtdids, dev);
|
||||
|
||||
/* mtdparts: "mtdparts=<dev>:<mtdparts_<dev>>;..." */
|
||||
if (mtdparts[0] != '\0')
|
||||
strncat(mtdparts, ";", MTDPARTS_LEN);
|
||||
else
|
||||
strcat(mtdparts, "mtdparts=");
|
||||
|
||||
strncat(mtdparts, dev, MTDPARTS_LEN);
|
||||
strncat(mtdparts, ":", MTDPARTS_LEN);
|
||||
|
||||
if (boot) {
|
||||
strncat(mtdparts, boot, MTDPARTS_LEN);
|
||||
strncat(mtdparts, ",", MTDPARTS_LEN);
|
||||
}
|
||||
|
||||
if (tee) {
|
||||
strncat(mtdparts, tee, MTDPARTS_LEN);
|
||||
strncat(mtdparts, ",", MTDPARTS_LEN);
|
||||
}
|
||||
|
||||
strncat(mtdparts, user, MTDPARTS_LEN);
|
||||
}
|
||||
|
||||
void board_mtdparts_default(const char **mtdids, const char **mtdparts)
|
||||
{
|
||||
struct mtd_info *mtd;
|
||||
struct udevice *dev;
|
||||
static char parts[3 * MTDPARTS_LEN + 1];
|
||||
static char ids[MTDIDS_LEN + 1];
|
||||
static bool mtd_initialized;
|
||||
bool tee, nor, nand, spinand, serial;
|
||||
|
||||
if (mtd_initialized) {
|
||||
*mtdids = ids;
|
||||
*mtdparts = parts;
|
||||
return;
|
||||
}
|
||||
|
||||
tee = false;
|
||||
nor = false;
|
||||
nand = false;
|
||||
spinand = false;
|
||||
serial = false;
|
||||
|
||||
switch (get_bootmode() & TAMP_BOOT_DEVICE_MASK) {
|
||||
case BOOT_SERIAL_UART:
|
||||
case BOOT_SERIAL_USB:
|
||||
serial = true;
|
||||
if (CONFIG_IS_ENABLED(CMD_STM32PROG)) {
|
||||
tee = stm32prog_get_tee_partitions();
|
||||
nor = stm32prog_get_fsbl_nor();
|
||||
}
|
||||
nand = true;
|
||||
spinand = true;
|
||||
break;
|
||||
case BOOT_FLASH_NAND:
|
||||
nand = true;
|
||||
break;
|
||||
case BOOT_FLASH_SPINAND:
|
||||
spinand = true;
|
||||
break;
|
||||
case BOOT_FLASH_NOR:
|
||||
nor = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!serial && CONFIG_IS_ENABLED(OPTEE) &&
|
||||
tee_find_device(NULL, NULL, NULL, NULL))
|
||||
tee = true;
|
||||
|
||||
memset(parts, 0, sizeof(parts));
|
||||
memset(ids, 0, sizeof(ids));
|
||||
|
||||
/* probe all MTD devices */
|
||||
for (uclass_first_device(UCLASS_MTD, &dev);
|
||||
dev;
|
||||
uclass_next_device(&dev)) {
|
||||
pr_debug("mtd device = %s\n", dev->name);
|
||||
}
|
||||
|
||||
if (nor || nand) {
|
||||
mtd = get_mtd_device_nm("nand0");
|
||||
if (!IS_ERR_OR_NULL(mtd)) {
|
||||
const char *mtd_boot = CONFIG_MTDPARTS_NAND0_BOOT;
|
||||
const char *mtd_tee = CONFIG_MTDPARTS_NAND0_TEE;
|
||||
|
||||
board_set_mtdparts("nand0", ids, parts,
|
||||
!nor ? mtd_boot : NULL,
|
||||
!nor && tee ? mtd_tee : NULL,
|
||||
"-(UBI)");
|
||||
put_mtd_device(mtd);
|
||||
}
|
||||
}
|
||||
|
||||
if (nor || spinand) {
|
||||
mtd = get_mtd_device_nm("spi-nand0");
|
||||
if (!IS_ERR_OR_NULL(mtd)) {
|
||||
const char *mtd_boot = CONFIG_MTDPARTS_SPINAND0_BOOT;
|
||||
const char *mtd_tee = CONFIG_MTDPARTS_SPINAND0_TEE;
|
||||
|
||||
board_set_mtdparts("spi-nand0", ids, parts,
|
||||
!nor ? mtd_boot : NULL,
|
||||
!nor && tee ? mtd_tee : NULL,
|
||||
"-(UBI)");
|
||||
put_mtd_device(mtd);
|
||||
}
|
||||
}
|
||||
|
||||
if (nor) {
|
||||
if (!uclass_get_device(UCLASS_SPI_FLASH, 0, &dev)) {
|
||||
const char *mtd_boot = CONFIG_MTDPARTS_NOR0_BOOT;
|
||||
const char *mtd_tee = CONFIG_MTDPARTS_NOR0_TEE;
|
||||
|
||||
board_set_mtdparts("nor0", ids, parts,
|
||||
mtd_boot,
|
||||
tee ? mtd_tee : NULL,
|
||||
"-(nor_user)");
|
||||
}
|
||||
}
|
||||
|
||||
mtd_initialized = true;
|
||||
*mtdids = ids;
|
||||
*mtdparts = parts;
|
||||
debug("%s:mtdids=%s & mtdparts=%s\n", __func__, ids, parts);
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
if TARGET_STM32MP1
|
||||
if TARGET_ST_STM32MP15x
|
||||
|
||||
config SYS_BOARD
|
||||
default "stm32mp1"
|
||||
@ -9,21 +9,5 @@ config SYS_VENDOR
|
||||
config SYS_CONFIG_NAME
|
||||
default "stm32mp1"
|
||||
|
||||
config ENV_SECT_SIZE
|
||||
default 0x40000 if ENV_IS_IN_SPI_FLASH
|
||||
|
||||
config ENV_OFFSET
|
||||
default 0x280000 if ENV_IS_IN_SPI_FLASH
|
||||
|
||||
config CMD_STBOARD
|
||||
bool "stboard - command for OTP board information"
|
||||
default y
|
||||
help
|
||||
This compile the stboard command to
|
||||
read and write the board in the OTP.
|
||||
|
||||
config TARGET_STM32MP157C_DK2
|
||||
bool "support of STMicroelectronics STM32MP157C-DK2 Discovery Board"
|
||||
default y
|
||||
|
||||
source "board/st/common/Kconfig"
|
||||
endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user