Compare commits

...

102 Commits

Author SHA1 Message Date
845f1618ea Prepare v2020.10-stm32mp-r1.1
Update version in Makefile to prepare the label v2020.10-stm32mp-r1.1

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ica62c0aaa3990d54f3b77ceb030be4dec67936b9
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/204801
2021-05-06 10:44:37 +02:00
b9f621e1d5 stm32mp: stm32prog: add timeout in stm32prog_serial_get_buffer
Handle timeout in stm32prog_serial_get_buffer to sent NACK
to STM32CubeProgrammer when the buffer is not fully received.

This patch avoids to reach the STM32CubeProgrammet timeout and
the associated unrecoverable error.

  Timeout error occured while waiting for acknowledgement.

  Error: Write Operation fails at packet number 4165 at address 0x1044FF

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I11b3c3f4cdfbecc6830d6280ba993c8ba2ba0eeb
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/204374
Reviewed-by: MPUOSTL
2021-05-06 10:42:21 +02:00
201c8ae8d9 stm32mp: stm32prog: remove all the header check for UART download
This patch removes the header check for UART download;
the check of checksum is not mandatory with even parity and chuck
checksum for each 256 received bytes and it is only done for
STM32 image (FSBL = TF-A BL2), not for FIT image.

This patch solve issue of duplicated 0x100 byte written with FIP header.

Fixes: 32619a4db6 ("stm32mp: stm32prog: add FIP header support")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Idc6a3beb93aa6eeee965d3d12d45fa8b834c4e02
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/204037
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-05-06 10:41:22 +02:00
d2c99cb7e5 Prepare v2020.10-stm32mp-r1
Update version in Makefile to prepare the label v2020.10-stm32mp-r1

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Id3812887a04d0a2bc66570c91b6892b60ba7e86c
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/191784
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-03-08 17:19:32 +01:00
96c80bc4ab stm32mp: bsec: manage clock when present in device tree
Enable the clocks during bsec probe when they are present in device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ia63be418b35e01ff4155837e0d2f5f9bc67b9158
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/190309
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
(cherry picked from commit 53ac781e75e76a16bab1e410951a7db9195418dc)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/195400
2021-03-08 17:19:32 +01:00
755a624309 video: dw_mipi_dsi: update log of dphy_enable
The DSI phy can be turned on from the DSI digital interface in
the dphy_enable() function or from a dedicated DSI phy "wrapper"
in phy_ops->init() function. If the STM32MP1 case, the wrapper
is used then the dphy_enable() "warning" traces are not relevant.

This patch moves these "warning" traces to "debug" traces so
they are still available for DSI phy based on the digital
interface in debug logging mode, but not there in normal mode
for both cases.
Note: The related Linux kernel driver uses a "debug"
message too.

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Change-Id: I39d4e96ff2fd99714af7a42d1c0d2c7d0ca8d532
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/193037
Reviewed-by: Philippe CORNU <philippe.cornu@foss.st.com>
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-03-08 17:19:32 +01:00
4074f61955 video: dw_mipi_dsi: missing device to log debug
Missing udevice to struct dw_mipi_dsi to log trace.

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Change-Id: I9e4a65f2f44df5f6184121d9ece5f919ee7bdf6a
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/193036
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Philippe CORNU <philippe.cornu@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-03-08 17:19:32 +01:00
e162f7b15a video: dw-mipi-dsi: permit configuring the escape clock rate
The Amlogic D-PHY in the Amlogic AXG SoC Family does support a frequency
higher than 10MHz for the TX Escape Clock, thus make the target rate
configurable.

This is based on the Linux commit [1] and adapted to the U-Boot driver.

[1] a328ca7e4af3 ("drm/bridge: dw-mipi-dsi: permit configuring the escape clock rate")

[Backport of commit 01c9857fa8 ("video: dw-mipi-dsi: permit configuring
 the escape clock rate")]

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Change-Id: I1d8f1c3f87174c5380a27d57e1d4c5971075849c
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/193316
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Philippe CORNU <philippe.cornu@foss.st.com>
2021-03-08 17:19:32 +01:00
f25ae3ad15 video: dw-mipi-dsi: driver-specific configuration of phy timings
The timing values for dw-dsi are often dependent on the used display and
according to Philippe Cornu will most likely also depend on the used phy
technology in the soc-specific implementation.

To solve this and allow specific implementations to define them as needed
add a new get_timing callback to phy_ops and call this from the dphy_timing
function to retrieve the necessary values for the specific mode.

This is based on the Linux commit [1] and adapted to the U-Boot driver.

[1] 25ed8aeb9c39 ("drm/bridge/synopsys: dsi: driver-specific configuration of phy timings")

[Backport of commit b53c122631 ("video: dw-mipi-dsi: driver-specific
 configuration of phy timings")]

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Change-Id: I6706565beaf9a035d91010a3aced724a9f9368f8
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/193315
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Philippe CORNU <philippe.cornu@foss.st.com>
2021-03-08 17:19:32 +01:00
3ec26bca18 video: stm32: Fix not calling dev_xxx with a device
There is no member `dev` in dw_mipi_dsi, but there is one in mipi_dsi_host,
so use that.

[backport of commit 4723fd58dc ("video: stm32: Fix not
 calling dev_xxx with a device")]

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I0bfa20c8ab26d9be26deb34a5a4fc07d32e4a947
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/193314
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Philippe CORNU <philippe.cornu@foss.st.com>
2021-03-08 17:19:32 +01:00
ab6b54a960 dwc2: change compatible st,stm32mp1-hsotg to st,stm32mp15-hsotg
The Linux kernle v5.7-rc1 introduced the compatible "st,stm32mp15-hsotg".

See Linux kernel commit d49850110434 ("dt-bindings: usb: dwc2: add
support for STM32MP15 SoCs USB OTG HS and FS")

This patch updates the supported compatible in DWC2 driver
and removes the add-on done in U-Boot, to keep the compatible
defined in SOC dtsi arch/arm/dts/stm32mp151.dtsi:

usbotg_hs: usb-otg@49000000 {
	compatible = "st,stm32mp15-hsotg", "snps,dwc2";
	reg = <0x49000000 0x10000>;
...
};

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: If6218391a7cf47afdeda5e5e6c79937b4e8ab085
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/192886
2021-03-08 17:19:32 +01:00
eac38177a5 mtd: spinand: Add WATCHDOG_RESET() in spinand_mtd_read/write()
In case of big area read/write on spi-nand, watchdog timeout may occurs.
To fix that, add WATCHDOG_RESET() in spinand_mtd_read() and
spinand_mtd_write() to insure that watchdog is reset.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I80d628cb2a521c1b6c5d3ed2294e20d48a0ad17f
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/191101
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Christophe KERELLO <christophe.kerello@st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Patrice CHOTARD <patrice.chotard@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-03-08 17:19:32 +01:00
24cfdbc039 mtd: nand: Add WATCHDOG_RESET() in nanddev_mtd_erase()
In case of big area erased on nand, watchdog timeout may occurs.
To fix that, add WATCHDOG_RESET() in nanddev_mtd_erase() to insure that
watchdog is reset.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I6a71b2154814a2cdcf2305050e1e9dffc2270a21
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/191100
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-03-08 17:19:32 +01:00
bba889da70 spi: stm32_qspi: Add WATCHDOG_RESET _stm32_qspi_read_fifo()
In case of reading large area and memory-map mode is misconfigured
(memory-map size declared lower than the real size of the memory chip)
watchdog can be triggered.

Add a WATCHDOG_RESET() in _stm32_qspi_read_fifo to fix it.

Issue reproduced with stm32mp157c-ev1 board with memory map size set to
1, with following command:
sf read 0xC0000000 0 0x4000000

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: Ia3f90df07694f322b832990ed1759c88b996624b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/191099
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Christophe KERELLO <christophe.kerello@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Patrice CHOTARD <patrice.chotard@st.com>
2021-03-08 17:19:32 +01:00
4ad26a89cc mtd: spi-nor: Add WATCHDOG_RESET() in spi_nor_core callbacks
In case of big area write/erase on spi nor, watchdog timeout may occurs.
Issue reproduced on stm32mp157c-ev1 with following commands:

sf write 0xC0000000 0 0x3000000
or
sf erase 0 0x1000000

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: Id5ecd44f4554b2191895999c359b89a4165eafe4
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/190971
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Christophe KERELLO <christophe.kerello@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Patrice CHOTARD <patrice.chotard@st.com>
2021-03-08 17:19:32 +01:00
88e2f3e3f2 dfu: dfu_mtd: set max_buf_size to erasesize also for NOR devices
For NOR, the logical DFU buffer size is the sector_size
(as it is done in mtd_sf.c) and in spi/sf_mtd.c:
  sf_mtd_info.erasesize = flash->sector_size;

For NAND, with has_pages = true, the DFU size was already limited
to erasesize.

So we can use for all the MTD devices:
  dfu->max_buf_size = mtd->erasesize

This part was initially copied from MTD command, where
data is fully available in RAM.

This patch avoids to write to many sector in dfu_mtd.c at the end
of the DFU transfert and avoids issues with USB timeout or WATCHDOG.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I5dae379041b74a89d3ed4c70ed34118b5431e5bb
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/190507
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
e3549a7636 env: sf: add support of command env erase
Add support of opts erase for env in ext4,
this opts is used by command 'env erase'.

This command only fill the env offset by 0x0 (bit flip to 0) and
the saved environment becomes invalid.

I don't use erase command here to avoid to managed the case
when the sector is larger than the env (i.e. embedded)
(CONFIG_ENV_SECT_SIZE > CONFIG_ENV_SIZE).

The SF erase will be managed in the next "env save" command.

Change-Id: I10fb7cded95e008428ff08f4f1e6f785cefc4d0f
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/188960
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-03-08 17:19:32 +01:00
4df4dd68c4 env: sf: update the use of macro ENV_SAVE_PTR
Remove CONFIG_IS_ENABLED(SAVEENV) as it is already tested in
the ENV_SAVE_PTR macro:

#define ENV_SAVE_PTR(x) (CONFIG_IS_ENABLED(SAVEENV) ? (x) : NULL)

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I108ef0bb214bf9eabfb9a39438381a9be6ba4b6a
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/188959
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
4f13edabfe env: add ENV_ERASE_PTR macro
Add ENV_ERASE_PTR macro to handle erase opts and remove the associated
ifdef.

This patch is a extension of previous commit 82b2f41357 ("env_internal.h:
add alternative ENV_SAVE_PTR macro").

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I4101043ff86264c22da77700b28bf231d66e49cb
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/188958
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
a539394615 configs: stm32mp15: increase the number of reserved memory region in lmb
For the latest kernel device tree the max number of reserved regions
in lmb library is reached: 8 with 5 reserved regions in device tree.

When a new region is added, the lmb allocation for the device tree
relocation failed and boot with ramdisk failed.

This patch avoid this issue by increasing the max number of
supported reserved memeory in lmb library.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I0fd0759810c8b211efa5597dd4333772abcde528
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/190368
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
1603a3f161 lmb: Add 2 config to define the max number of regions
Add 2 configs CONFIG_LMB_MEMORY_REGIONS and CONFIG_LMB_RESERVED_REGIONS
to change independently the max number of the regions in lmb
library.

Increase CONFIG_LMB_RESERVED_REGIONS is useful to avoid lmb errors in
bootm when the number of reserved regions (not adjacent) is reached:
+ 1 region for relocated U-Boot
+ 1 region for initrd
+ 1 region for relocated linux device tree
+ reserved memory regions present in Linux device tree.

The current limit of 8 regions is reached with only 5 reserved regions
in DT.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Icdf0b7e662fc65658e591ce0f692a5695f607256
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/190367
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
2f37c0df57 lmb: Move lmb property arrays in struct lmb
Move lmb property arrays to struct lmb and manage the array size in
a the new element 'max' of struct lmb_region. This modification allows
to update its size independently in the next patch.

see Linux kernel commit bf23c51f1f49d3960f3cd8e3d2e7f943d9c41042

Change-Id: Ib388bce4b48489235edd7596c8d0bfd139560f4f
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/190365
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-03-08 17:19:32 +01:00
5973650434 lmb: move CONFIG_LMB in Kconfig
Migrate CONFIG_LMB in Kconfig.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ifa5a03d3733bf4f5245de4d0e07f433c4889b955
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/190364
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
9af6dce609 stm32mp: stm32prog: replace alias by serial device sequence number
The command "stm32prog serial <dev>" can directly use the device sequence
number of serial uclass as this sequence number is egual to alias when it
exist; this assumption simplify the code and avoid access to gd->fdt_blob
and the device tree parsing.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ibc4bc73528497d0e4e3ff31b4baf13e2a0ee4be0
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/188439
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
01110cd0a9 stm32mp: stm32prog: reactivate console and display serial error
When serial instance is not found in device tree, the console
should be enabled and the error should be indicated.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ief81f05149ac2a0801badd2baadb49387c0e0fcb
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/188438
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
9bac53ceb9 stm32mp: stm32prog: Add CONFIG_CMD_STM32PROG_SERIAL and _USB
Add CONFIG_CMD_STM32PROG_SERIAL and CONFIG_CMD_STM32PROG_USB to
independantly select the support of UART or USBB communication for
STM32CubeProgrammer.

For serial boot over UART, user can deactivate CONFIG_CMD_STM32PROG_SERIAL
to use U-Boot console of binary loaded by UART (for board bring-up for
example).

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I60352ed0b0f59ee019230f63aaa3c45fd4438531
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/188437
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
ccf0f7f3a8 stm32mp: stm32prog: Add Kconfig file for stm32prog command
Move CONFIG_CMD_STM32PROG in a specific Kconfig file for stm32prog command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ide01d319f701d0bfc950d85df2be0aa8bb76ca03
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/188436
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
71902be420 video: stm32: remove all child of DSI bridge when its probe failed
Remove the child device of the STM32 DSI bridge when the driver probe
failed to stop futher probe request on panels used with STMicroelectronics
board (orisetech_otm8009a.c or raydium-rm68200.c driver).

This patch avoid the trace "cannot get reset GPIO" when
STM32MP157 device tree is used on stm32MP151 SOC without DSI support.

In this hw_version value is 0, as DSI bridge is absent and the panel
ofdata_to_platdata is called for each try of panel probe,
the gpio reset pin is requested but after dsi father probe failed).

For the next request, the PANEL ofdata_to_platdata failed as the gpio
is already used.

Change-Id: I7936291936df6580c70e36c7d96ed2a7c82bc577
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/186763
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Yannick FERTRE <yannick.fertre@st.com>
2021-03-08 17:19:32 +01:00
786b57af24 board: st: remove the nand MTD configuration for NOR boot in stm32mp1 board
Since commit d5d726d3cc ("configs: stm32mp1: only support SD card after
NOR in bootcmd_stm32mp"), the stm32mp1 boards only support SD card after
NOR boot device, so the MTD partitions for nand0 or spi-nand0 are useless
(no need of "UBI" partition in nand0 or spi-nand0).

This patch removes these nand MTD update for nor boot and simplify nand0
and spi-nand0 support (remove the mtd_boot variable).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Ia75490c8d9e6097d5a0a6a6caa5594fc5ebad493
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/186554
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-03-08 17:19:32 +01:00
94fbdb5ad9 ARM: dts: stm32mp1: environment at the end of partition FIP
For FIP support the U-Boot environment is now located at
the partition named "fip".

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I9c4d346221eea8e7c314b61342a0c479c79e87e1
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/185146
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
2021-03-08 17:19:32 +01:00
883351e230 stm32mp: fdt: remove stm32_fdt_disable_optee for FIP
No more call remove stm32_fdt_disable_optee when FIP is used by TF-A
as OP-TEE is added only when needed (in DT loaded by TF-A)

But for STM32IMAGE mode it it is still required, as the OP-TEE nodes are
present in U-Boot Device Tree, added under the compilation flag
CONFIG_STM32MP15x_STM32IMAGE.

See commit "ARM: dts: remove the OP-TEE nodes in U-boot device tree"

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I136532c9b7ece7f6146c65f61c7ec82fdbaa8ba5
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/190168
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
32619a4db6 stm32mp: stm32prog: add FIP header support
Add support of FIP header in command stm32prog for boot phase.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I81e79d4b32305a46b797f1ce405c200185a0647e
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/186960
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
2021-03-08 17:19:32 +01:00
a9a6ef9f26 stm32mp1: stm32prog: remove stm32prog_get_tee_partitions when FIP is used
The MTD tee partitions used to save the OP-TEE binary are needed when
TF-A doesn't use the FIP container to load binaries.

This path removes the associated code in command stm32prog.

Change-Id: I1aeda5b6cc2115de802f79656884387d7a7ca94c
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/184635
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
530378050a board: st: add tee partition only when FIP is not used
The MTD tee partitions used to save the OP-TEE binary are needed when
TF-A doesn't use the FIP container to load binaries.

This path removes the associated CONFIG and assaciated code when
CONFIG_STM32MP15x_STM32IMAGE is enabled.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I39c666f78b87b07e186e599464099a9896559de0
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/184634
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-03-08 17:19:32 +01:00
89378cad53 ARM: dts: remove the OP-TEE nodes in U-boot device tree
The nodes needed by OP-TEE are added by OP-TEE firmware when TF-A use FIP
container to load binaries:
- U-Boot (.bin file)
- U-Boot device tree
- BL31: secure monitor (SP-MIN) or secure OS (OP-TEE)

These nodes is only required in legacy mode, when TF-A load the file
u-boot.stm32 with STM32IMAGE header.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Ib0b251fb6120b1654e40dba8cb37ac128648318e
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/184633
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-03-08 17:19:32 +01:00
a276021ce2 doc: st: stm32mp1: Add FIP support for trusted boot
TF-A for STM32MP15 now supports the FIP: it is a packaging format which
includes the secure monitor, u-boot-nodtb.bin and u-boot.dtb

This FIP file is loaded by FSBL = TF-A BL2.

This patch updates the board documentation to use this FIP file and no
more u-boot.stm32 (with STM32 image header) which is no more generated.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I5b4dcc998de66f175510fed96f6930c7208b492c
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/187004
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
2021-03-08 17:19:32 +01:00
a667e88971 arm: stm32mp: add FIP and STM32IMAGE support
By default for trusted boot with TF-A, U-Boot (u-boot-nodtb)
is located in FIP container with their device tree with
secure monitor (provided by TF-A or OP-TEE).
The FIP file is loaded by TF-A BL2 and each components is
extracted at the final location.

This patch add CONFIG_STM32MP15x_STM32IMAGE to support of
STM32 image generation for SOC STM32MP15x
when FIP container is not used (u-boot.stm32 is loaded by TF-A
as done previously to keep the backward compatibility).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I75c3a4359a6e42c20360fb1774a2e371a08a6270
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/184632
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/191843
2021-03-08 17:19:32 +01:00
9e916f62f9 stm32mp1: add remoteproc TEE support for trusted config
Add CONFIG_REMOTEPROC_OPTEE=y. This only adds in the build the
device to support the management of the Cortex-M4 firmware by OPTEE.
The feature has to be enable using device tree "st,stm32mp1-m4_optee"
compatible.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Change-Id: If7dc8800c09814a49c97275b92b4842c8ac17e07
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/178826
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
(cherry picked from commit 5a79badae72df624446711535e6aa32917e3b6d4)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/179344
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
a9a416d7ef remoteproc: stm32: add support of the remote proc management by OP-TEE
Add possibility to use the OP-TEE trusted application to manage the
cortex M4 firmware for the stm32mp1 machine.
The selection is done using the DT compatibility property
"st,stm32mp1-m4_optee".

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Change-Id: I21b67e48f5abb4016cb22de3d409406983593c5c
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/178825
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
(cherry picked from commit 49de5e2be7e13863d9e0939662aec019d0585de1)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/179343
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
bdda8b06a9 remoteproc: Add remoteproc trusted application support
Add rproc-optee.c to implement the interface with the OP-TEE remoteproc
trusted application. This implementation allows to delegate the remote
proc firmware management to OP-TEE in case of firmware secured by OP-TEE.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Change-Id: I48ac13a4499d292f67cf9b7f1865a0867611ebe8
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/178824
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
(cherry picked from commit 6c09605a80bb9aaec5c9c9483dcec43d27c08658)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/179342
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-08 17:19:32 +01:00
6b2a718e81 arm: cache: cp15: don't map the reserved region with no-map property
No more map the reserved region with "no-map" property by marking
the corresponding TLB entries with invalid entry (=0) to avoid
speculative access.

This patch fixes an issue on STM32MP15x where predictive read access
on secure DDR area are caught by OP-TEE.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I373600b164862b9150717aacc6835f363395ee7a
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176460
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-03-08 17:19:32 +01:00
eb0109d557 image-fdt: save no-map parameter of reserve-memory
Save the no-map information present in reserve-memory node to allow
correct handling when the MMU is configured in board to avoid
speculative access.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Id906966934e591cb691481197488ae2cfa31ffa1
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176459
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-03-08 17:19:32 +01:00
9a54910efc test: lmb: add test for lmb_reserve_flags
Add a test to check the management of reserved region with flags.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I0067e50d8ebc0817f12ad5feb66db7e2f200d1d0
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176458
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-03-08 17:19:32 +01:00
21cc5096c3 lmb: add lmb_dump_region() function
Add lmb_dump_region() function, to simplify lmb_dump_all_force().
This patch is based on Linux memblock dump function.

A example of bdinfo output is:

.....
fdt_size    = 0x000146a0
FB base     = 0xfdd00000
lmb_dump_all:
 memory.cnt  = 0x1
 memory[0]	[0xc0000000-0xffffffff], 0x40000000 bytes flags: 0
 reserved.cnt  = 0x6
 reserved[0]	[0x10000000-0x10045fff], 0x00046000 bytes flags: 4
 reserved[1]	[0x30000000-0x3003ffff], 0x00040000 bytes flags: 4
 reserved[2]	[0x38000000-0x3800ffff], 0x00010000 bytes flags: 4
 reserved[3]	[0xe8000000-0xefffffff], 0x08000000 bytes flags: 4
 reserved[4]	[0xfbaea344-0xfdffffff], 0x02515cbc bytes flags: 0
 reserved[5]	[0xfe000000-0xffffffff], 0x02000000 bytes flags: 4
arch_number = 0x00000000
TLB addr    = 0xfdff0000
....

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I45ee4207ad3fed413a4f3382b0698998aef3266e
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176457
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
2021-03-08 17:19:32 +01:00
427aa1cb63 lmb: remove lmb_region.size
Remove the unused field size of struct lmb_region as it is initialized to 0
and never used after in lmb library.

See Linux kernel commit 4734b594c6ca ("memblock: Remove memblock_type.size
and add memblock.memory_size instead")

Change-Id: Ied3d7fa502a6796d8839ee9f4a048b276f16c073
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176456
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-03-08 17:19:32 +01:00
c4628d1760 lmb: add lmb_is_reserved_flags
Add a new function lmb_is_reserved_flags to check is a
address is reserved with a specific flags.

This function can be used to check if an address had be
reserved with no-map flags with:

lmb_is_reserved_flags(lmb, addr, LMB_NOMAP);

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I3a6b2d08f2fa71209db00af8e5bab8cba85eedd3
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176276
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176455
2021-03-08 17:19:32 +01:00
b65b0dab59 lmb: Add support of flags for no-map properties
Add "flags" in lmp_property to save the "no-map" property of reserved region
and a new function lmb_reserve_flags() to check this flag.

The default allocation use flags = LMB_NONE.

The adjacent reserved memory region are merged only when they have
the same flags value.

This patch is partially based on flags support done in Linux kernel
mm/memblock .c (previously lmb.c); it is why LMB_NOMAP = 0x4, it is
aligned with MEMBLOCK_NOMAP value.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Iac36d9d9036edd54d2574d712ca21283bf7c73d0
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176454
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-03-08 17:19:32 +01:00
2ca27108ba doc: add new board in documentation stm32mp1.rst
Add new board in documentation stm32mp1.rst:
+ stm32mp157a-ed1.dts
+ stm32mp157a-ev1.dts
+ stm32mp157d-dk1.dts
+ stm32mp157d-ed1.dts
+ stm32mp157d-ev1.dts
+ stm32mp157f-dk2.dts
+ stm32mp157f-ed1.dts
+ stm32mp157f-ev1.dts

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Ic10842f61b46982475da71c5f5fffa4c8ad34f64
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/153293
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
2021-03-08 17:19:32 +01:00
16ea27215d dts: reduce device tree for trusted boot
Remove the SPL only nodes for trusted boot chain with TFABOOT enable.
Prepare the removal of basic defconfig.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I784b62187091557c8b05161b70b578824e549195
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/152522
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-03-08 17:19:32 +01:00
fe67dde0a9 arm: dts: stm32mp15 remove forced dr_mode for usbotg_hs
The OTG mode is supported in DWC2 driver since the
commit 7c65468346 ("usb: dwc2: allow peripheral mode for
OTG configuration").

So the override of the kernel configuration of usbotg node in SOC
dtsi stm32mp151.dtsi (dr_mode = "otg") is no more required to
support USB peripheral profile on STMicroelectronics boards

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Id00e9684d36e31636b791666a10fac4909ddc3c4
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/192900
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2021-03-08 17:19:32 +01:00
a27bb329bb dts: stm32mp1: alignment with v5.10-stm32mp-r1
Device tree alignment with Linux kernel v5.10-stm32mp-r1

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Iff062ef9f417c3b6d6ef0ce0c7ada8f4f7ef334c
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/192682
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/194405
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/194422
2021-03-08 17:19:32 +01:00
155cd5d967 arm: dts: stm32mp15: reorder uart node
Reorder uart and usart node in pincontrol in alphabetic order as done in
Linux kernel device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I5ef42cc1baa9fd06a8055befdec0c959f459c4f9
2021-03-02 09:29:27 +01:00
27023f0622 configs: stm32mp1_trusted_defconfig rely on SCMI support
Enable SCMI clock and reset domain support for stm32mp1 platform
and ARM SMC mailbox driver as used as communication channel for
SCMI messages between non-secure world and secure SCMI server.

Change-Id: Id6e8c7bc7b812ba39f50a9c331684c942745d483
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/150331
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-03-02 09:29:27 +01:00
dad06fb439 clk: stm32mp1 gets root clocks from fdt
This change makes stm32mp1 clock driver to get the root clocks
reference from the device node in the FDT rather than fetching
straight these clocks by their name. Driver now stores the
clock reference and use it to know if a root clock is present,
get its rate or gets its related udevice reference.

Change-Id: Ic47f7891c8e3621cbc40aef4ebc54355e1fcfe12
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/153896
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-02 09:29:27 +01:00
ea8d62311f dts: stm32mp1: explicit clock reference needed by RCC clock driver
Define in the RCC clock provider node which root clocks the driver
depends on. These are root oscillators, which may be present or
not, upon FDT content.

Change-Id: I9565e66593bf785bf3616f10c76b168a87acaf77
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/153895
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-02 09:29:27 +01:00
660f93a7dd stm32mp1: pwr: use SMC to access secure resources
For trusted boot, STM32MP1 need  to use SMC to access PWR secure
ressources.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I65c85d36be51d381c6b95a795f4d589986c01cb3
2021-03-02 09:29:27 +01:00
6b0a2110e3 stm32mp1: Add STMicroelectronics proprietary SMC
Add proprietary SMC to access to secure ressource provided
or protected by STMicroelectronics TF-A.

Change-Id: I9f54d8f1e560b3a7077f515d0f0f28bd3c346e6d
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/173696
2021-03-02 09:29:27 +01:00
19200c0da0 stm32mp1: activated DDR interactive by default
Only used by STMicroelectronics CubeMX - DDR tuning tools
It is activated by default in OpenSTlinux delivery

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Ie4b23882b48f2bb8a117813a8e6fcdfc358b23e7
2021-03-02 09:29:27 +01:00
a4242ee4dd cli: deactivate some feature for SPL
Reduce the SPL size compiled with DDR interactive mode.

This patch deactivates the U-Boot proper features activateded by DISTRO
but it is not necessary for SPL.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I31e7667c70e7f238976b867cfa7fb620623f357e
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/134443
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-03-02 09:29:27 +01:00
8f4e7f90af board: stm32mp1: use CONFIG_SYS_MMC_ENV_DEV when available
Check whether user has explicitly defined the mmc device to use
in mmc_get_env_dev() with CONFIG_SYS_MMC_ENV_DEV.

By default, on ST boards the mmc device is selected by boot instance
device and mmc alias in device tree.

This patch allows to override this behavior for the support of customer
boards; for example when SDMMC1 is not used and ENV in mmc0=SDMMC2.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I8cbd6f92056fa2d10bf3880746d89ee0779f8e27
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/191271
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
2021-03-02 09:29:27 +01:00
8185e4ef32 configs: stm32mp15: move bootdelay configuration in defconfig
The STM32MP15 boards have no reason to configure bootdelay in stm32mp1.h
as it is already done with CONFIG_BOOTDELAY (default = 2) and in
include/env_default.h:

This patch allows configuration for customers which reuse stm32mp1.h
and reduce the size of the defualt environment.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ia172a59601a113931d127852f494213587cf0f6b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/190838
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
2021-03-02 09:29:27 +01:00
8394f45f4c pinctrl: stm32: bind only the enabled GPIO subnode
Bind only the enabled GPIO subnode, to avoid to probe the node
"gpio-controller" present in SOC dtsi (disabled by default) but
not enabled in the included pincontrol dtsi file.

For example, in stm32mp15xxac-pinctrl.dtsi 2 gpio bank are absent:
 gpioj: gpio@5000b000
 gpiok: gpio@5000c000

Then these GPIO are absent in output of command "dm tree" and
"gpio status -a"

Cover-letter:
pinctrl: stm32: correction for pinmux status

This serie solve 2 issues found in output of command
"pinmux status -a" when I test the serie [1].

[1] "gpio: Update and simplify the uclass API"
    http://patchwork.ozlabs.org/project/uboot/list/?series=225585

END

Change-Id: I0a3428974f4b9205c6a22076bf60c87639520b20
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/191673
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
2021-03-02 09:29:27 +01:00
1d0aabdada pinctrl: stm32: correct management pin display of OTYPE
OTYPE can be used for output or for alternate function to select
PP = push-pull or OP = open-drain mode, according reference manual
(Table 81. Port bit configuration table).

This patch removes this indication for input pins and adds it
for AF and output pins for pinmux command output.

Fixes: b305dbc08b ("pinctrl: stm32: display bias information for all pins")

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Icf7e03823d5975be1d5ec623652c893849882657
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/191672
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
2021-03-02 09:29:27 +01:00
54172bd819 pinctrl: stmfx: Use PINNAME_SIZE for pin's name size
Instead of redefining a pin's name size, use PINNAME_SIZE defined
in include/dm/pinctrl.h

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I56dd1eeb25498a3e309c8d7033f094e0206f2df8
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/190657
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrice CHOTARD <patrice.chotard@st.com>
2021-03-02 09:29:27 +01:00
625dc3af9f clk: stm32mp1: add support of I2C6_K
Add support of missing I2C6_K with bit 3 of RCC_MC_APB5ENSETR =
I2C6EN: I2C6 peripheral clocks enable.

This patch allows customer to use I2C6 in SPL or in U-Boot
as other I2C instance, already support in clk driver.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I28be53e4ce2082b513afd19d77d1430741ac16f3
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/191811
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-03-02 09:29:27 +01:00
38cab67688 board: stm32pm1: update USB-C power detection algorithm on DK boards
USB-C power supply which are Power Delivery compliant (USB-PD) are able
to provide different voltage/current (for example 5V/3A 9V/3A 12V/2.25A...)

In this case, the power supply need to negotiate the voltage/current to
use with the device using CC1/CC2 USB-C signals.

If this negotiation occurs during ADC measurement (done also on CC1/CC2
USB-C signals) some ADC acquisition can be corrupted which cause wrong
power supply current detection.

To avoid this, the power supply current detection algorithm is updated
as following:
  - perform an ADC measurement, if a 3A current is detected, continue the
    boot process.
  - else, wait 20ms (max tPDDebounce duration) to ensure that USB-PD
    negotiation is done and perform another ADC measurement.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Change-Id: I260c4a913fea905a3d17c28af0a8d3eb2d1974cd
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/178171
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Fabrice GASNIER <fabrice.gasnier@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
(cherry picked from commit 57fdb049454e073f9ac813d3d65593be9662b3da)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/179333
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-02 09:29:27 +01:00
70ab7eaf11 arch: cache: cp15: Add mmu_set_region_dcache_behaviour() when SYS_DCACHE_OFF is enable
Fix following compilation issue when SYS_DCACHE_OFF is enable:
drivers/misc/scmi_agent.c:128: undefined reference to `mmu_set_region_dcache_behaviour'

when SYS_DCACHE_OFF is enable, mmu_set_region_dcache_behaviour() must be
defined.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Change-Id: Id06e70cc6c2007a945f5ef3303db5e5a5b3680a5
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/183265
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/190609
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-02 09:29:27 +01:00
d1531adc7d arm: stm32mp: Fix compilation issue when SYS_DCACHE_OFF and/or SYS_DCACHE_SYS are enabled
Fix following compilation issue when SYS_DCACHE_OFF and/or SYS_DCACHE_SYS
are enabled :

arch/arm/mach-stm32mp/cpu.c: In function ‘early_enable_caches’:
arch/arm/mach-stm32mp/cpu.c:223:10: error: ‘volatile struct arch_global_data’ has no member named ‘tlb_size’
  223 |  gd->arch.tlb_size = PGTABLE_SIZE;
      |          ^
arch/arm/mach-stm32mp/cpu.c:224:10: error: ‘volatile struct arch_global_data’ has no member named ‘tlb_addr’
  224 |  gd->arch.tlb_addr = (unsigned long)&early_tlb;
      |          ^

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Change-Id: Ic8f7be7e700d15bdd32f8a8f6e7fcb671404e7fb
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/183264
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2021-03-02 09:29:27 +01:00
84af99d7fb ARM: dts: stm32: Fix cosmetic typo: use 'kHz' as kilohertz abbreviation
The kilohertz unit abbreviation should read 'kHz'.
Note to STM32 team: modified files were generated, it may be worth
to fix STM32CubeMX tool.

[backport of commit 2220c2e84d ("ARM: dts: stm32: Fix cosmetic
typo: use 'kHz' as kilohertz abbreviation")]
Signed-off-by: Fabrice GIRARDOT <fabrice.girardot@flowbird.group>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I887ba4933f6b35df90cc8d99f2246671b7194999
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/196252
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-03-02 09:28:13 +01:00
cbba2eb804 usb: dwc2: add "u-boot,force-vbus-detection" for stm32
On some board, the ID pin is not connected so the B session must be
overridden with "u-boot,force_b_session_valid" but the VBus sensing
must continue to be handle.

To managed it, this patch adds a new DT field
"u-boot,force-vbus-detection" to use with "u-boot,force_b_session_valid"

[Backport of 5739ef2bcb ("usb: dwc2: add "u-boot,force-vbus-detection"
 for stm32")]

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I77269d852e0f410c31f9d1f869815c4328510c12
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/177081
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
(cherry picked from commit ee741e28fa3c64c891d095fce315995e8bfbcb79)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/179332
2021-01-27 18:12:10 +01:00
9c66fde95b arm: stm32mp: stm32prog: always flush DFU on start command for uart
Remove the test on data->dfu_seq, because dfu_seq=0 not only when
the DFU is not started (mask with 0xffff). This flush is mandatory
as the final treatment, common with USB, is done in DFU callback.

This patch avoids issue if the received length is a multiple of
the DFU packet.

For example if size of bootfs partition is egual to 0x4000000,
data->dfu_seq=0 at the end of the partition, the flush it not
requested and the phase is not increased in the callback.
U-Boot continue to request the bootfs in the next GetPhase command.

[Backport of commit 751f918bdb ("arm: stm32mp: stm32prog: always
 flush DFU on start command for uart")]

Fixes: 468f0508b5 ("stm32mp: stm32prog: add serial link support")
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I5168c97ed041354102af2ba6ba3f5b3e5d0b9a47
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/186954
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-01-27 18:12:10 +01:00
002c5fe8f4 dm: core: Add a livetree function to check node status
Add a way to find out if a node is enabled or not, based on its 'status'
property.

[Backport of commit 0de1b07406 ("dm: core: Add a
 livetree function to check node status")]

Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I36aaa9161423184d2d4d3bb95ceb0a79c1cfb0a1
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/191707
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-01-27 18:12:10 +01:00
844f722e5c optee: add property no-map to secure reserved memory
OP-TEE reserved memory node must set property "no-map" to prevent
Linux kernel from mapping secure memory unless what non-secure world
speculative accesses of the CPU can violate the memory firmware
configuration.

[backport of commit 3e15c315f9 ("optee: add property no-map to
 secure reserved memory")]

Fixes: 6ccb05eae0 ("image: fdt: copy possible optee nodes to a loaded devicetree")
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/174732
Change-Id: I8d959adeff23676479380cfc64a68d223c65e358
2021-01-27 18:12:10 +01:00
101b18a11b test: fdtdec: Add test for new no-map fdtdec_add_reserved_memory() parameter
Add a test to verify that the no-map property is added in reserved-memory
node when fdtdec_add_reserved_memory() no-map parameter is set to true.

[backport of commit 6613ed1e07 ("test: fdtdec: Add test for new no-map
 fdtdec_add_reserved_memory() parameter")]

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: I75c9d07a17925b17b33be4a6c592cfefac6d5de5
2021-01-27 18:12:10 +01:00
1c8bb54c75 fdtdec: optionally add property no-map to created reserved memory node
Add boolean input argument @no_map to helper function
fdtdec_add_reserved_memory() to add or not "no-map" property
for an added reserved memory node.

Property no-map is used by the Linux kernel to not not map memory
in its static memory mapping. It is needed for example for the|
consistency of system non-cached memory and to prevent speculative
accesses to some firewalled memory.

No functional change. A later change will update to OPTEE library to
add no-map property to OP-TEE reserved memory nodes.

[backport of commit ccaa5747bd ("fdtdec: optionally add property no-map
 to created reserved memory node")]

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/174732
Change-Id: I8d959adeff23676479380cfc64a68d223c65e358
2021-01-27 18:12:10 +01:00
14a049aac7 board: st: stm32mp1: update load address for FIT examples
Update kernel load address for FIT examples to avoid relocation:
- Kernel example uses Image.gz with U-Boot gzip decompression
  at final kernel location 0x0xC0008000.
- Copro example loads zImage at a correct location (0xC4000000),
  to avoid zImage relocation before decompression by kernel code.

An other solution to avoid zImage relocation is to align
the kernel load and entry address with the real location in FIT
(the relocation of zImage is skipped in U-Boot bootm command for
identical address) but it is less flexible because this offset
depends on FIT content:

For example:

## Loading kernel from FIT Image at c2000000 ...
   Using 'ev1' configuration
   Trying 'kernel' kernel subimage
     Description:  Linux kernel
     Created:      2020-10-22   9:08:32 UTC
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0xc20000cc

The kernel offset in FIT is 0xCC in FIT and zImage is decompressed at
0xC0008000 by kernel code:

kernel {
	description = "Linux kernel";
	data = /incbin/("zImage");
	type = "kernel";
	arch = "arm";
	os = "linux";
	compression = "none";
	load = <0xC20000cc>;
	entry = <0xC20000cc>;
	hash-1 {
		algo = "sha1";
	};
};

[backport of commit 60a2dd6aa2 ("board: st: stm32mp1: update load
 address for FIT example")]

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Change-Id: I077eed496ea5fded723418afa845e759df8e6c9b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/181710
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
(cherry picked from commit ec12ce4fc6)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/186004
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2021-01-27 18:12:10 +01:00
ad597c3596 phy: stm32: usbphyc: manage optional vbus regulator on phy_power_on/off
This patch adds support for optional vbus regulator.
It is managed on phy_power_on/off calls and may be needed for host mode.

[backport of c480138958 ("phy: stm32: usbphyc: manage optional vbus
 regulator on phy_power_on/off")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I47bb6a36ff3c0138c2a8ca5f6ee669c04b804eb1
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/178473
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
(cherry picked from commit 2292d0b83f6f65eb871f06aaa371f015addd529b)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/179339
2021-01-27 18:12:10 +01:00
35ebbb4dd7 pinctrl: stmfx: update pincontrol and gpio device name
The device name is used in pinmux command and in log trace
so it is better to use the parent parent name ("stmfx@42" for
example) than a generic name ("pinctrl" or "stmfx-gpio")
to identify the device instance.

[backport of commit c2a8181d45 ("pinctrl: stmfx: update
 pincontrol and gpio device name")]

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Change-Id: I65b1b6e190e45201b176dc1efb872502ca040fea
2020-11-30 11:03:49 +01:00
c532220188 pinctrl: stm32: display bias information for all pins
Display the bias information for input gpios or AF configuration,
and not only for output pin, as described in Reference manual
(Table 81. Port bit configuration table).

[backport of commit b305dbc08b ("pinctrl: stm32: display bias
 information for all pins")]

Fixes: da7a0bb1f2 ("pinctrl: stm32: add information on pin configuration")
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Change-Id: I11b888809f04b5fb4ac1ae457feb2ff6248646ce
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/185995
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
(cherry picked from commit 5fc2ad22a2)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/186332
2020-11-30 10:59:43 +01:00
6f15b18c2a gpio: stm32: correct the bias management
Use the bias configuration for all the GPIO configurations and not
only for input GPIO, as indicated in Reference manual
(Table 81. Port bit configuration table).

[backport of commit 2c6df94c83 ("gpio: stm32: correct the bias
management")]

Fixes: 43efbb6a3e ("gpio: stm32: add ops get_dir_flags")
Fixes: f13ff88b61 ("gpio: stm32: add ops set_dir_flags")
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Change-Id: Ib0d32663ca2284fefc438abfae4b4dc211308387
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/185993
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
(cherry picked from commit 5458c338fda5505bdba4f4ef159773b5ced2e731)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/186005
2020-11-30 10:59:40 +01:00
31cb9f8b1e arm: stm32mp: correct the ALIGN macro usage
Correct the ALIGN macro usage in mmu_set_region_dcache_behaviour
call: the address must use ALIGN_DOWN and size can use ALIGN macro.

With STM32_SYSRAM_BASE=0x2FFC0000 and MMU_SECTION_SIZE=0x100000 for
STM32MP15x the computed address was 30000000 instead of 2ff00000.

[backport of commit 77c077e171 ("arm: stm32mp: correct the ALIGN
macro usage")

Fixes: 43fe9d2fda ("stm32mp1: mmu_set_region_dcache_behaviour")
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I8531d6fea3ca25fc6912467bce84e47d5e669560
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/186337
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
2020-11-30 10:58:58 +01:00
0747c5fd3e SPL: stm32mp1: fix spl_mmc_boot_partition not defined
spl_mmc_boot_partition is only defined when
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is defined.

[backport of commit 29e5c02788 ("SPL: stm32mp1: fix spl_mmc_boot_partition not defined")]

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I508b78f8d4d2e5f08ec0d86709ddd4880ce0c236
2020-11-30 10:58:15 +01:00
d019c25475 remoteproc: stm32: update error management in stm32_copro_start
The coprocessor is running as soon as the hold boot is de-asserted.

So indicate this running state and save the resource table even
if the protective assert, to avoid autonomous reboot, is failed.

This error case should never occurs.

[backport of commit 9ed6f929a3 ("remoteproc: stm32: update error
 management in stm32_copro_start")]

Change-Id: If11081706d310a6eb7ed2ba30291bdd20e74927b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/173942
Reviewed-by: Fabien DESSENNE <fabien.dessenne@st.com>
Reviewed-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2020-11-30 10:55:42 +01:00
35607c6fdc remoteproc: stm32: use reset for hold boot
Use the reset function to handle the hold boot bit in RCC
with device tree handle with MCU_HOLD_BOOT identifier.

This generic reset allows to remove the two specific properties:
- st,syscfg-holdboot
- st,syscfg-tz

This patch prepares alignment with kernel device tree.

[backport of commit 5a536dfe33 ("remoteproc: stm32: use reset
 for hold boot")]

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Id4df826efcbb8c6e22a7d5ad02cfc7459ef27345
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/173695
Reviewed-by: Fabien DESSENNE <fabien.dessenne@st.com>
Reviewed-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
2020-11-30 10:55:42 +01:00
06d87a5083 reset: stm32: Add support of MCU HOLD BOOT
Handle the register RCC_MP_GCR without SET/CLR registers
but with a direct access to bit BOOT_MCU:
- deassert => set the bit: The MCU will not be in HOLD_BOOT
- assert => clear the bit: The MCU will be set in HOLD_BOOT

With this patch the RCC driver handles the MCU_HOLD_BOOT_R value
added in binding stm32mp1-resets.h

[backport of commit d8d29a4489 ("reset: stm32: Add support
 of MCU HOLD BOOT")]

Cc: Fabien DESSENNE <fabien.dessenne@st.com>
Cc: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
Change-Id: Ic4f6a36fa0594203b3f994a9e1d48143b420f072
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/180909
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@st.com>
Reviewed-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
(cherry picked from commit e01ad309ded1a7aa58db8b12e70c7c7713424f5a)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/181895
2020-11-30 10:51:41 +01:00
1672d72a2c stm32mp: limit size of cacheable DDR in pre-reloc stage
In pre-reloc stage, U-Boot marks cacheable the DDR limited by
the new config CONFIG_DDR_CACHEABLE_SIZE.

This patch allows to avoid any speculative access to DDR protected by
firewall and used by OP-TEE; the "no-map" reserved memory
node in DT are assumed after this limit:
STM32_DDR_BASE + DDR_CACHEABLE_SIZE.

Without security, in basic boot, the value is equal to STM32_DDR_SIZE.

[backport of commit 67f9f11f19 ("stm32mp: limit size of cacheable DDR in pre-reloc stage")]

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I23889bc9bd065ae7ac2b17faf2436522848e0568
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176461
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2020-11-30 10:47:18 +01:00
d923687d36 board: stm32mp1: no MTD partitions fixup for serial boot
Remove the update of the MTD partitions in kernel device tree
for serial boot (USB / UART), and the kernel will use the MTD
partitions define in the loaded DTB because U-Boot can't known the
expected flash layout in this case.

[backport of commit 29e5c02788 ("board: stm32mp1: no MTD
 partitions fixup for serial boot")]

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Iaffbe4c566aa29f32e66803c79787eb74843de09
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/170427
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2020-11-30 10:47:00 +01:00
22313e34b2 firmware: smci: sandbox test for SCMI reset controllers
Add tests for SCMI reset controllers. A test device driver
sandbox-scmi_devices.c is used to get reset resources, allowing further
resets manipulation.

Change sandbox-smci_agent to emulate 1 reset controller exposed through
an agent. Add DM test scmi_resets to test this reset controller.

[backport of this commit c0dd177a99 ("firmware: smci: sandbox test for SCMI reset controllers")]

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: I8fb2eac4f21eba060e1295570c81e68e0d2fc3eb
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/182788
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2020-11-02 10:11:34 +01:00
12d1e62295 reset: add reset controller driver for SCMI agents
This change introduces a reset controller driver for SCMI agent devices.
When SCMI agent and SCMI reset domain drivers are enabled, SCMI agent
binds a reset controller device for each SCMI reset domain protocol
devices enabled in the FDT.

SCMI reset driver is embedded upon CONFIG_RESET_SCMI=y. If enabled,
CONFIG_SCMI_AGENT is also enabled.

SCMI Reset Domain protocol is defined in the SCMI specification [1].

[backport of commit 34d76fefb2 ("reset: add reset controller driver for SCMI agents")]

Links: [1] https://developer.arm.com/architectures/system-architectures/software-standards/scmi
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: Ic2f7f024260e317926e013bad898408c47fcfd75
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/182787
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2020-11-02 10:10:26 +01:00
18b732f78a firmware: scmi: sandbox test for SCMI clocks
Add tests for SCMI clocks. A test device driver sandbox-scmi_devices.c
is used to get clock resources, allowing further clock manipulation.

Change sandbox-smci_agent to emulate 3 clocks exposed through 2 agents.
Add DM test scmi_clocks to test these 3 clocks.
Update DM test sandbox_scmi_agent with load/remove test sequences
factorized by {load|remove}_sandbox_scmi_test_devices() helper functions.

[backport of commit 87d4f277d4 ("firmware: scmi: sandbox test for SCMI clocks")]

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: I8a8aa115ac32111a3d49604d7b4bb7b71dfb0433
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/182786
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2020-11-02 10:10:14 +01:00
938ea5ce35 clk: add clock driver for SCMI agents
This change introduces a clock driver for SCMI agent devices. When
SCMI agent and SCMI clock drivers are enabled, SCMI agent binds a
clock device for each SCMI clock protocol devices enabled in the FDT.

SCMI clock driver is embedded upon CONFIG_CLK_SCMI=y. If enabled,
CONFIG_SCMI_AGENT is also enabled.

SCMI Clock protocol is defined in the SCMI specification [1].

[backport of commit 6038884483 ("clk: add clock driver for SCMI agents")]

Links: [1] https://developer.arm.com/architectures/system-architectures/software-standards/scmi
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: Ie4efc25a1f58930a9b7a81d3e115154374cc35ac
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/182785
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2020-11-02 10:09:58 +01:00
e27bb6886a dt-bindings: arm: SCMI bindings documentation
Dump SCMI DT bindings documentation from Linux kernel source
tree v5.8-rc1.

[backport of commit 4e5ce7ecd3 ("dt-bindings: arm: SCMI bindings documentation")]

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: I875577d4fa841a87af9f5d224fe7099a4a503855
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/182784
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2020-11-02 10:09:43 +01:00
09a1bd58c7 firmware: scmi: support Arm SMCCC transport
This change implements a SMCCC transport for SCMI exchanges. This
implementation follows the Linux kernel as references implementation
for SCMI message processing, using the SMT format for communication
channel meta-data.

Use of SMCCC transport in SCMI FDT bindings are defined in the Linux
kernel DT bindings since v5.8. SMCCC with SMT is implemented in OP-TEE
from tag 3.9.0 [2].

[backport of commit 1e35913a26 ("firmware: scmi: support Arm SMCCC transport")]

Links: [2] https://github.com/OP-TEE/optee_os/commit/a58c4d706d23
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: Ie931a3f600b2c81433de73e4d07ccd16a5e6238e
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/182783
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2020-11-02 10:09:27 +01:00
d85f35f67a firmware: scmi: mailbox/smt agent device
This change implements a mailbox transport using SMT format for SCMI
exchanges. This implementation follows the Linux kernel and
SCP-firmware [1] as references implementation for SCMI message
processing using SMT format for communication channel meta-data.

Use of mailboxes in SCMI FDT bindings are defined in the Linux kernel
DT bindings since v4.17.

[backport of commit 240720e905 ("firmware: scmi: mailbox/smt agent device")]

Links: [1] https://github.com/ARM-software/SCP-firmware
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: Ie240636888d8dadcdc2f41fd5808a5c428b39f30
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/182782
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2020-11-02 10:09:09 +01:00
6f2c14f673 firmware: add SCMI agent uclass
This change introduces SCMI agent uclass to interact with a firmware
using the SCMI protocols [1].

SCMI agent uclass currently supports a single method to request
processing of the SCMI message by an identified server. A SCMI message
is made of a byte payload associated to a protocol ID and a message ID,
all defined by the SCMI specification [1]. On return from process_msg()
method, the caller gets the service response.

SCMI agent uclass defines a post bind generic sequence for all devices.
The sequence binds all the SCMI protocols listed in the FDT for that
SCMI agent device. Currently none, but later change will introduce
protocols.

This change implements a simple sandbox device for the SCMI agent uclass.
The sandbox nicely answers SCMI_NOT_SUPPORTED to SCMI messages.
To prepare for further test support, the sandbox exposes a architecture
function for test application to read the sandbox emulated devices state.
Currently supports 2 SCMI agents, identified by an ID in the FDT device
name. The simplistic DM test does nothing yet.

SCMI agent uclass is designed for platforms that embed a SCMI server in
a firmware hosted somewhere, for example in a companion co-processor or
in the secure world of the executing processor. SCMI protocols allow an
SCMI agent to discover and access external resources as clock, reset
controllers and more. SCMI agent and server communicate following the
SCMI specification [1]. This SCMI agent implementation complies with
the DT bindings defined in the Linux kernel source tree regarding
SCMI agent description since v5.8.

[backport of commit 358599efd8 ("firmware: add SCMI agent uclass")]

Links: [1] https://developer.arm.com/architectures/system-architectures/software-standards/scmi
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: Idcb82241b7ddfae30d1fd9c958d5fdfb71b5a2a4
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/182781
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
2020-11-02 10:08:52 +01:00
52fd68c0ca configs: stm32mp15: activate CMD_EXPORTENV
Activate CONFIG_CMD_EXPORTENV to accept the command "env export".

[backport of commit d931186312 ("configs: stm32mp15: activate CMD_EXPORTENV")]

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: If1d49fa8059b3c6fd60f667ed9ab31a19d59ff81
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176257
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176453
2020-10-26 12:47:56 +01:00
54eb65bc01 configs: stm32mp15: activate CMD_IMPORTENV
Activate CONFIG_CMD_IMPORTENV to accept the command "env import".
This command is useful in script to include some variable.

[backport of commit fba7b95085 ("configs: stm32mp15: activate CMD_IMPORTENV")]

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I81473a93ee7a195c368348e98a38c125bfda859a
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176256
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176452
2020-10-26 12:47:56 +01:00
828055b0f2 stm32mp: stm32prog: accept device without partition
When partition is not found it is not a error but the selected
device as no partition scheme, so nothing to check.

The command need to continue to the next part_id.

This patch correct an issue for ram0 target.

[backport of commit 53de79fecc ("stm32mp: stm32prog: accept device without partition")]

Fixes: ffc405e63b ("stm32mp: stm32prog: add upport of partial update")
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Ica5db473ac0416c71b18f52d0b221e37d1f1a9aa
2020-10-26 12:47:56 +01:00
7a3599a5a4 dfu: Fix handling of UBI partitions in MTD backend
For UBI partitions ("partubi" in dfu_alt_info), dfu_fill_entity_mtd sets
the mtd.ubi flag; however other functions incorrectly check for nand.ubi
instead. Fix this by checking for the correct flag.

Fixes: 6015af28ee ("dfu: add backend for MTD device")
Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
Cc: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: I3683e7458daea6fc350fe5ba35aa85b07da86f48
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176222
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/176451
2020-10-26 12:47:56 +01:00
7561878cdc Remove default value of CONFIG_PREBOOT for CONFIG_USB_STORAGE
Remove the default value "usb start" for CONFIG_USB_STORAGE as the USB
storage boot initialization is correctly managed by  distro boot command
('usb_boot' defined in include/config_distro_bootcmd.h already include
the command 'usb  start').

[backport of commit 87459da102 ("Remove default value of CONFIG_PREBOOT for CONFIG_USB_STORAGE")]

Fixes: 324d77998e ("Define default CONFIG_PREBOOT with right config option")
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: I3c5d8a9a202ea7f1cc88182afa1e40e91d2999e9
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/179834
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
2020-10-26 12:47:56 +01:00
9444435a55 Add oe-* to .gitignore.
Add Yocto genenerated files in exclude list.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-10-23 17:29:29 +02:00
5f4cb019c5 CONTRIBUTING: add contributing guide to STMicroelectronics/u-boot repository
Add contributing guide to STMicroelectronics/u-boot repository.

Signed-off-by: Bernard Puel <bernard.puel@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Change-Id: Ia32afcbd025f24949fb27c7fe4db2133a47dcf5b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/163160
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: CIBUILD <smet-aci-builds@lists.codex.cro.st.com>
(cherry picked from commit 41862c1b26)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/163162
2020-10-23 17:29:29 +02:00
170 changed files with 8313 additions and 1940 deletions

3
.gitignore vendored
View File

@ -95,3 +95,6 @@ GTAGS
# Python cache
__pycache__
/oe-*
bitbake-cookerdaemon.log

30
CONTRIBUTING.md Normal file
View 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.

View File

@ -3,7 +3,7 @@
VERSION = 2020
PATCHLEVEL = 10
SUBLEVEL =
EXTRAVERSION =
EXTRAVERSION = -stm32mp-r1.1
NAME =
# *DOCUMENTATION*

View File

@ -8,6 +8,4 @@
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
#define CONFIG_LMB
#endif /*__ASM_ARC_CONFIG_H_ */

View File

@ -943,13 +943,21 @@ dtb-$(CONFIG_ARCH_ASPEED) += ast2500-evb.dtb
dtb-$(CONFIG_ARCH_STI) += stih410-b2260.dtb
dtb-$(CONFIG_STM32MP15x) += \
stm32mp157a-dk1.dtb \
stm32mp157a-avenger96.dtb \
stm32mp157a-dk1.dtb \
stm32mp157a-ed1.dtb \
stm32mp157a-ev1.dtb \
stm32mp157c-dk2.dtb \
stm32mp157c-ed1.dtb \
stm32mp157c-ev1.dtb \
stm32mp157c-odyssey.dtb \
stm32mp15xx-dhcom-drc02.dtb \
stm32mp157d-dk1.dtb \
stm32mp157d-ed1.dtb \
stm32mp157d-ev1.dtb \
stm32mp157f-dk2.dtb \
stm32mp157f-ed1.dtb \
stm32mp157f-ev1.dtb \
stm32mp15xx-dhcom-pdk2.dtb \
stm32mp15xx-dhcor-avenger96.dtb

View File

@ -14,6 +14,7 @@
st,mem-speed = <DDR_MEM_SPEED>;
st,mem-size = <DDR_MEM_SIZE>;
#ifndef CONFIG_TFABOOT
st,ctl-reg = <
DDR_MSTR
DDR_MRCTRL0
@ -133,7 +134,7 @@
>;
#endif
#endif
status = "okay";
};
};

View File

@ -15,7 +15,7 @@
* Save Date: 2020.02.20, save Time: 18:45:20
*/
#define DDR_MEM_COMPATIBLE ddr3-1066-888-bin-g-1x4gb-533mhz
#define DDR_MEM_NAME "DDR3-DDR3L 16bits 533000Khz"
#define DDR_MEM_NAME "DDR3-DDR3L 16bits 533000kHz"
#define DDR_MEM_SPEED 533000
#define DDR_MEM_SIZE 0x20000000

View File

@ -15,7 +15,7 @@
* Save Date: 2020.02.20, save Time: 18:49:33
*/
#define DDR_MEM_COMPATIBLE ddr3-1066-888-bin-g-2x4gb-533mhz
#define DDR_MEM_NAME "DDR3-DDR3L 32bits 533000Khz"
#define DDR_MEM_NAME "DDR3-DDR3L 32bits 533000kHz"
#define DDR_MEM_SPEED 533000
#define DDR_MEM_SIZE 0x40000000

View 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 */
};
};
};

View 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";
};
};
};

View 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>;
};
};
reboot {
compatible = "syscon-reboot";
regmap = <&rcc>;
offset = <0x404>;
mask = <0x1>;
};
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>;
};
dsi: dsi@5a000000 {
clocks = <&rcc DSI_K>, <&clk_hse>, <&rcc DSI_PX>;
};
};
ahb {
m4_rproc: m4@10000000 {
resets = <&rcc MCU_R>, <&rcc MCU_HOLD_BOOT_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/ scmi0;
/delete-node/ scmi1;
};
/delete-node/ sram@2ffff000;
};
&cec {
clocks = <&rcc CEC_K>, <&clk_lse>;
};
&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>;
};

View File

@ -118,6 +118,45 @@
};
};
dfsdm_clkout_pins_a: dfsdm-clkout-pins-0 {
pins {
pinmux = <STM32_PINMUX('B', 13, AF3)>; /* DFSDM_CKOUT */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
};
dfsdm_clkout_sleep_pins_a: dfsdm-clkout-sleep-pins-0 {
pins {
pinmux = <STM32_PINMUX('B', 13, ANALOG)>; /* DFSDM_CKOUT */
};
};
dfsdm_data1_pins_a: dfsdm-data1-pins-0 {
pins {
pinmux = <STM32_PINMUX('C', 3, AF3)>; /* DFSDM_DATA1 */
};
};
dfsdm_data1_sleep_pins_a: dfsdm-data1-sleep-pins-0 {
pins {
pinmux = <STM32_PINMUX('C', 3, ANALOG)>; /* DFSDM_DATA1 */
};
};
dfsdm_data3_pins_a: dfsdm-data3-pins-0 {
pins {
pinmux = <STM32_PINMUX('F', 13, AF6)>; /* DFSDM_DATA3 */
};
};
dfsdm_data3_sleep_pins_a: dfsdm-data3-sleep-pins-0 {
pins {
pinmux = <STM32_PINMUX('F', 13, ANALOG)>; /* DFSDM_DATA3 */
};
};
ethernet0_rgmii_pins_a: rgmii-0 {
pins1 {
pinmux = <STM32_PINMUX('G', 5, AF11)>, /* ETH_RGMII_CLK125 */
@ -349,6 +388,51 @@
};
};
hdp0_pins_a: hdp0-0 {
pins {
pinmux = <STM32_PINMUX('I', 12, AF2)>; /* HDP0 */
bias-disable;
drive-push-pull;
slew-rate = <2>;
};
};
hdp0_pins_sleep_a: hdp0-sleep-0 {
pins {
pinmux = <STM32_PINMUX('I', 12, ANALOG)>; /* HDP0 */
};
};
hdp6_pins_a: hdp6-0 {
pins {
pinmux = <STM32_PINMUX('K', 5, AF2)>; /* HDP6 */
bias-disable;
drive-push-pull;
slew-rate = <2>;
};
};
hdp6_pins_sleep_a: hdp6-sleep-0 {
pins {
pinmux = <STM32_PINMUX('K', 5, ANALOG)>; /* HDP6 */
};
};
hdp7_pins_a: hdp7-0 {
pins {
pinmux = <STM32_PINMUX('K', 6, AF2)>; /* HDP7 */
bias-disable;
drive-push-pull;
slew-rate = <2>;
};
};
hdp7_pins_sleep_a: hdp7-sleep-0 {
pins {
pinmux = <STM32_PINMUX('K', 6, ANALOG)>; /* HDP7 */
};
};
i2c1_pins_a: i2c1-0 {
pins {
pinmux = <STM32_PINMUX('D', 12, AF5)>, /* I2C1_SCL */
@ -1051,6 +1135,12 @@
};
};
rtc_out2_rmp_pins_a: rtc-out2-rmp-pins-0 {
pins {
pinmux = <STM32_PINMUX('I', 8, ANALOG)>; /* RTC_OUT2_RMP */
};
};
sai2a_pins_a: sai2a-0 {
pins {
pinmux = <STM32_PINMUX('I', 5, AF10)>, /* SAI2_SCK_A */
@ -1147,7 +1237,7 @@
};
};
sai2b_pins_c: sai2a-4 {
sai2b_pins_c: sai2b-4 {
pins1 {
pinmux = <STM32_PINMUX('F', 11, AF10)>; /* SAI2_SD_B */
bias-disable;
@ -1437,6 +1527,24 @@
};
};
sdmmc2_d47_pins_d: sdmmc2-d47-3 {
pins {
pinmux = <STM32_PINMUX('A', 8, AF9)>, /* SDMMC2_D4 */
<STM32_PINMUX('A', 9, AF10)>, /* SDMMC2_D5 */
<STM32_PINMUX('E', 5, AF9)>, /* SDMMC2_D6 */
<STM32_PINMUX('C', 7, AF10)>; /* SDMMC2_D7 */
};
};
sdmmc2_d47_sleep_pins_d: sdmmc2-d47-sleep-3 {
pins {
pinmux = <STM32_PINMUX('A', 8, ANALOG)>, /* SDMMC2_D4 */
<STM32_PINMUX('A', 9, ANALOG)>, /* SDMMC2_D5 */
<STM32_PINMUX('E', 5, ANALOG)>, /* SDMMC2_D6 */
<STM32_PINMUX('C', 7, ANALOG)>; /* SDMMC2_D7 */
};
};
sdmmc3_b4_pins_a: sdmmc3-b4-0 {
pins1 {
pinmux = <STM32_PINMUX('F', 0, AF9)>, /* SDMMC3_D0 */
@ -1573,10 +1681,205 @@
};
};
spi4_pins_a: spi4-0 {
pins {
pinmux = <STM32_PINMUX('E', 12, AF5)>, /* SPI4_SCK */
<STM32_PINMUX('E', 6, AF5)>; /* SPI4_MOSI */
bias-disable;
drive-push-pull;
slew-rate = <1>;
};
pins2 {
pinmux = <STM32_PINMUX('E', 13, AF5)>; /* SPI4_MISO */
bias-disable;
};
};
spi4_pins_b: spi4-1 {
pins1 {
pinmux = <STM32_PINMUX('E', 12, AF5)>, /* SPI4_SCK */
<STM32_PINMUX('E', 14, AF5)>; /* SPI4_MOSI */
bias-disable;
drive-push-pull;
slew-rate = <1>;
};
pins2 {
pinmux = <STM32_PINMUX('E', 13, AF5)>; /* SPI4_MISO */
bias-disable;
};
};
spi4_sleep_pins_b: spi4-sleep-1 {
pins {
pinmux = <STM32_PINMUX('E', 12, ANALOG)>, /* SPI4_SCK */
<STM32_PINMUX('E', 13, ANALOG)>, /* SPI4_MISO */
<STM32_PINMUX('E', 14, ANALOG)>; /* SPI4_MOSI */
};
};
spi5_pins_a: spi5-0 {
pins1 {
pinmux = <STM32_PINMUX('F', 7, AF5)>, /* SPI5_SCK */
<STM32_PINMUX('F', 9, AF5)>; /* SPI5_MOSI */
bias-disable;
drive-push-pull;
slew-rate = <1>;
};
pins2 {
pinmux = <STM32_PINMUX('F', 8, AF5)>; /* SPI5_MISO */
bias-disable;
};
};
spi5_sleep_pins_a: spi5-sleep-0 {
pins {
pinmux = <STM32_PINMUX('F', 7, ANALOG)>, /* SPI5_SCK */
<STM32_PINMUX('F', 8, ANALOG)>, /* SPI5_MISO */
<STM32_PINMUX('F', 9, ANALOG)>; /* SPI5_MOSI */
};
};
stusb1600_pins_a: stusb1600-0 {
pins {
pinmux = <STM32_PINMUX('I', 11, ANALOG)>;
bias-pull-up;
pins {
pinmux = <STM32_PINMUX('I', 11, ANALOG)>;
bias-pull-up;
};
};
uart4_pins_a: uart4-0 {
pins1 {
pinmux = <STM32_PINMUX('G', 11, AF6)>; /* UART4_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
bias-disable;
};
};
uart4_idle_pins_a: uart4-idle-0 {
pins1 {
pinmux = <STM32_PINMUX('G', 11, ANALOG)>; /* UART4_TX */
};
pins2 {
pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
bias-disable;
};
};
uart4_sleep_pins_a: uart4-sleep-0 {
pins {
pinmux = <STM32_PINMUX('G', 11, ANALOG)>, /* UART4_TX */
<STM32_PINMUX('B', 2, ANALOG)>; /* UART4_RX */
};
};
uart4_pins_b: uart4-1 {
pins1 {
pinmux = <STM32_PINMUX('D', 1, AF8)>; /* UART4_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
bias-disable;
};
};
uart4_pins_c: uart4-2 {
pins1 {
pinmux = <STM32_PINMUX('G', 11, AF6)>; /* UART4_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
bias-disable;
};
};
uart7_pins_a: uart7-0 {
pins1 {
pinmux = <STM32_PINMUX('E', 8, AF7)>; /* UART7_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('E', 7, AF7)>, /* UART7_RX */
<STM32_PINMUX('E', 10, AF7)>, /* UART7_CTS */
<STM32_PINMUX('E', 9, AF7)>; /* UART7_RTS */
bias-disable;
};
};
uart7_pins_b: uart7-1 {
pins1 {
pinmux = <STM32_PINMUX('F', 7, AF7)>; /* UART7_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('F', 6, AF7)>; /* UART7_RX */
bias-disable;
};
};
uart7_pins_c: uart7-2 {
pins1 {
pinmux = <STM32_PINMUX('E', 8, AF7)>; /* UART7_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('E', 7, AF7)>; /* UART7_RX */
bias-pull-up;
};
};
uart7_idle_pins_c: uart7-idle-2 {
pins1 {
pinmux = <STM32_PINMUX('E', 8, ANALOG)>; /* UART7_TX */
};
pins2 {
pinmux = <STM32_PINMUX('E', 7, AF7)>; /* UART7_RX */
bias-pull-up;
};
};
uart7_sleep_pins_c: uart7-sleep-2 {
pins {
pinmux = <STM32_PINMUX('E', 8, ANALOG)>, /* UART7_TX */
<STM32_PINMUX('E', 7, ANALOG)>; /* UART7_RX */
};
};
uart8_pins_a: uart8-0 {
pins1 {
pinmux = <STM32_PINMUX('E', 1, AF8)>; /* UART8_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('E', 0, AF8)>; /* UART8_RX */
bias-disable;
};
};
uart8_rtscts_pins_a: uart8rtscts-0 {
pins {
pinmux = <STM32_PINMUX('G', 7, AF8)>, /* UART8_RTS */
<STM32_PINMUX('G', 10, AF8)>; /* UART8_CTS */
bias-disable;
};
};
@ -1628,6 +1931,47 @@
};
};
usart2_pins_c: usart2-2 {
pins1 {
pinmux = <STM32_PINMUX('D', 5, AF7)>, /* USART2_TX */
<STM32_PINMUX('D', 4, AF7)>; /* USART2_RTS */
bias-disable;
drive-push-pull;
slew-rate = <3>;
};
pins2 {
pinmux = <STM32_PINMUX('D', 6, AF7)>, /* USART2_RX */
<STM32_PINMUX('D', 3, AF7)>; /* USART2_CTS_NSS */
bias-disable;
};
};
usart2_idle_pins_c: usart2-idle-2 {
pins1 {
pinmux = <STM32_PINMUX('D', 5, ANALOG)>, /* USART2_TX */
<STM32_PINMUX('D', 3, ANALOG)>; /* USART2_CTS_NSS */
};
pins2 {
pinmux = <STM32_PINMUX('D', 4, AF7)>; /* USART2_RTS */
bias-disable;
drive-push-pull;
slew-rate = <3>;
};
pins3 {
pinmux = <STM32_PINMUX('D', 6, AF7)>; /* USART2_RX */
bias-disable;
};
};
usart2_sleep_pins_c: usart2-sleep-2 {
pins {
pinmux = <STM32_PINMUX('D', 5, ANALOG)>, /* USART2_TX */
<STM32_PINMUX('D', 4, ANALOG)>, /* USART2_RTS */
<STM32_PINMUX('D', 6, ANALOG)>, /* USART2_RX */
<STM32_PINMUX('D', 3, ANALOG)>; /* USART2_CTS_NSS */
};
};
usart3_pins_a: usart3-0 {
pins1 {
pinmux = <STM32_PINMUX('B', 10, AF7)>; /* USART3_TX */
@ -1641,83 +1985,85 @@
};
};
uart4_pins_a: uart4-0 {
usart3_pins_b: usart3-1 {
pins1 {
pinmux = <STM32_PINMUX('G', 11, AF6)>; /* UART4_TX */
pinmux = <STM32_PINMUX('B', 10, AF7)>, /* USART3_TX */
<STM32_PINMUX('G', 8, AF8)>; /* USART3_RTS */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
pinmux = <STM32_PINMUX('B', 12, AF8)>, /* USART3_RX */
<STM32_PINMUX('I', 10, AF8)>; /* USART3_CTS_NSS */
bias-disable;
};
};
uart4_pins_b: uart4-1 {
usart3_idle_pins_b: usart3-idle-1 {
pins1 {
pinmux = <STM32_PINMUX('D', 1, AF8)>; /* UART4_TX */
pinmux = <STM32_PINMUX('B', 10, ANALOG)>, /* USART3_TX */
<STM32_PINMUX('I', 10, ANALOG)>; /* USART3_CTS_NSS */
};
pins2 {
pinmux = <STM32_PINMUX('G', 8, AF8)>; /* USART3_RTS */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
pins3 {
pinmux = <STM32_PINMUX('B', 12, AF8)>; /* USART3_RX */
bias-disable;
};
};
uart4_pins_c: uart4-2 {
pins1 {
pinmux = <STM32_PINMUX('G', 11, AF6)>; /* UART4_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
bias-disable;
usart3_sleep_pins_b: usart3-sleep-1 {
pins {
pinmux = <STM32_PINMUX('B', 10, ANALOG)>, /* USART3_TX */
<STM32_PINMUX('G', 8, ANALOG)>, /* USART3_RTS */
<STM32_PINMUX('I', 10, ANALOG)>, /* USART3_CTS_NSS */
<STM32_PINMUX('B', 12, ANALOG)>; /* USART3_RX */
};
};
uart7_pins_a: uart7-0 {
usart3_pins_c: usart3-2 {
pins1 {
pinmux = <STM32_PINMUX('E', 8, AF7)>; /* UART4_TX */
pinmux = <STM32_PINMUX('B', 10, AF7)>, /* USART3_TX */
<STM32_PINMUX('G', 8, AF8)>; /* USART3_RTS */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('E', 7, AF7)>, /* UART4_RX */
<STM32_PINMUX('E', 10, AF7)>, /* UART4_CTS */
<STM32_PINMUX('E', 9, AF7)>; /* UART4_RTS */
bias-disable;
pinmux = <STM32_PINMUX('B', 12, AF8)>, /* USART3_RX */
<STM32_PINMUX('B', 13, AF7)>; /* USART3_CTS_NSS */
bias-pull-up;
};
};
uart7_pins_b: uart7-1 {
usart3_idle_pins_c: usart3-idle-2 {
pins1 {
pinmux = <STM32_PINMUX('F', 7, AF7)>; /* UART7_TX */
pinmux = <STM32_PINMUX('B', 10, ANALOG)>, /* USART3_TX */
<STM32_PINMUX('B', 13, ANALOG)>; /* USART3_CTS_NSS */
};
pins2 {
pinmux = <STM32_PINMUX('G', 8, AF8)>; /* USART3_RTS */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('F', 6, AF7)>; /* UART7_RX */
bias-disable;
pins3 {
pinmux = <STM32_PINMUX('B', 12, AF8)>; /* USART3_RX */
bias-pull-up;
};
};
uart8_pins_a: uart8-0 {
pins1 {
pinmux = <STM32_PINMUX('E', 1, AF8)>; /* UART8_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('E', 0, AF8)>; /* UART8_RX */
bias-disable;
usart3_sleep_pins_c: usart3-sleep-2 {
pins {
pinmux = <STM32_PINMUX('B', 10, ANALOG)>, /* USART3_TX */
<STM32_PINMUX('G', 8, ANALOG)>, /* USART3_RTS */
<STM32_PINMUX('B', 13, ANALOG)>, /* USART3_CTS_NSS */
<STM32_PINMUX('B', 12, ANALOG)>; /* USART3_RX */
};
};
@ -1783,17 +2129,11 @@
};
};
spi4_pins_a: spi4-0 {
spi1_sleep_pins_a: spi1-sleep-0 {
pins {
pinmux = <STM32_PINMUX('E', 12, AF5)>, /* SPI4_SCK */
<STM32_PINMUX('E', 6, AF5)>; /* SPI4_MOSI */
bias-disable;
drive-push-pull;
slew-rate = <1>;
};
pins2 {
pinmux = <STM32_PINMUX('E', 13, AF5)>; /* SPI4_MISO */
bias-disable;
pinmux = <STM32_PINMUX('Z', 0, ANALOG)>, /* SPI1_SCK */
<STM32_PINMUX('Z', 1, ANALOG)>, /* SPI1_MISO */
<STM32_PINMUX('Z', 2, ANALOG)>; /* SPI1_MOSI */
};
};
};

View File

@ -21,23 +21,11 @@
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;
compatible = "syscon-reboot";
regmap = <&rcc>;
offset = <0x404>;
mask = <0x1>;
};
soc {
u-boot,dm-pre-reloc;
@ -72,36 +60,6 @@
u-boot,dm-pre-reloc;
};
&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;
};
&cpu0_opp_table {
u-boot,dm-spl;
opp-650000000 {
u-boot,dm-spl;
};
opp-800000000 {
u-boot,dm-spl;
};
};
&gpioa {
u-boot,dm-pre-reloc;
};
@ -167,16 +125,44 @@
u-boot,dm-pre-reloc;
};
&pwr_regulators {
&rcc {
u-boot,dm-pre-reloc;
};
&rcc {
#ifdef CONFIG_TFABOOT
&scmi0 {
u-boot,dm-pre-reloc;
#address-cells = <1>;
#size-cells = <0>;
};
&scmi0_clk {
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_shm {
u-boot,dm-pre-reloc;
};
&scmi_sram {
u-boot,dm-pre-reloc;
};
#endif
&sdmmc1 {
compatible = "st,stm32-sdmmc2", "arm,pl18x", "arm,primecell";
};
@ -190,7 +176,7 @@
};
&usart1 {
resets = <&rcc USART1_R>;
resets = <&scmi0_reset RST_SCMI0_USART1>;
};
&usart2 {
@ -221,6 +207,63 @@
resets = <&rcc UART8_R>;
};
&usbotg_hs {
compatible = "st,stm32mp1-hsotg", "snps,dwc2";
/* NO MORE USE SCMI SUPPORT for BASIC boot chain */
#ifndef CONFIG_TFABOOT
#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;
};
};
&cpu0_opp_table {
u-boot,dm-spl;
opp-650000000 {
u-boot,dm-spl;
};
opp-800000000 {
u-boot,dm-spl;
};
};
/* only for vdd-supply in sysconf_init() */
&pwr_regulators {
u-boot,dm-pre-reloc;
};
&rcc {
#address-cells = <1>;
#size-cells = <0>;
};
&usart1 {
resets = <&rcc USART1_R>;
};
#endif /* CONFIG_TFABOOT */

File diff suppressed because it is too large Load Diff

View File

@ -10,12 +10,20 @@
cpus {
cpu1: cpu@1 {
compatible = "arm,cortex-a7";
clock-frequency = <650000000>;
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";
@ -24,7 +32,7 @@
interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "int0", "int1";
clocks = <&rcc CK_HSE>, <&rcc FDCAN_K>;
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";
@ -37,7 +45,7 @@
interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "int0", "int1";
clocks = <&rcc CK_HSE>, <&rcc FDCAN_K>;
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";

View File

@ -20,7 +20,8 @@
dsi: dsi@5a000000 {
compatible = "st,stm32-dsi";
reg = <0x5a000000 0x800>;
clocks = <&rcc DSI_K>, <&clk_hse>, <&rcc DSI_PX>;
phy-dsi-supply = <&reg18>;
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";

View File

@ -16,12 +16,18 @@
config {
u-boot,boot-led = "heartbeat";
u-boot,error-led = "error";
u-boot,mmc-env-partition = "ssbl";
u-boot,mmc-env-partition = "fip";
st,adc_usb_pd = <&adc1 18>, <&adc1 19>;
st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
};
#ifdef CONFIG_STM32MP15x_STM32IMAGE
config {
u-boot,mmc-env-partition = "ssbl";
};
/* only needed for boot with TF-A, witout FIP support */
firmware {
optee {
compatible = "linaro,optee-tz";
@ -35,9 +41,10 @@
no-map;
};
};
#endif
led {
red {
led-red {
label = "error";
gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
default-state = "off";
@ -50,6 +57,7 @@
status = "okay";
};
#ifndef CONFIG_TFABOOT
&clk_hse {
st,digbypass;
};
@ -65,6 +73,10 @@
};
};
&i2s2 {
clocks = <&rcc SPI2>, <&rcc SPI2_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
};
&pmic {
u-boot,dm-pre-reloc;
};
@ -161,6 +173,10 @@
};
};
&sai2 {
clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
};
&sdmmc1 {
u-boot,dm-spl;
};
@ -174,6 +190,7 @@
u-boot,dm-spl;
};
};
#endif
&uart4 {
u-boot,dm-pre-reloc;

View File

@ -7,6 +7,7 @@
/dts-v1/;
#include "stm32mp157.dtsi"
#include "stm32mp15xa.dtsi"
#include "stm32mp15-pinctrl.dtsi"
#include "stm32mp15xxac-pinctrl.dtsi"
#include "stm32mp15xx-dkx.dtsi"
@ -16,8 +17,9 @@
compatible = "st,stm32mp157a-dk1", "st,stm32mp157";
aliases {
ethernet0 = &ethernet0;
serial0 = &uart4;
serial1 = &usart3;
serial2 = &uart7;
};
chosen {

View File

@ -0,0 +1,228 @@
// 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 = "fip";
st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
};
led {
led-red {
label = "error";
gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
default-state = "off";
status = "okay";
};
};
#ifdef CONFIG_STM32MP15x_STM32IMAGE
config {
u-boot,mmc-env-partition = "ssbl";
};
/* only needed for boot with TF-A, witout FIP support */
firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
reserved-memory {
optee@fe000000 {
reg = <0xfe000000 0x02000000>;
no-map;
};
};
#endif
};
#ifndef CONFIG_TFABOOT
&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;
};
};

View 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.
*/
/dts-v1/;
#include "stm32mp157.dtsi"
#include "stm32mp15xa.dtsi"
#include "stm32mp15-pinctrl.dtsi"
#include "stm32mp15xxaa-pinctrl.dtsi"
#include "stm32mp15xx-edx.dtsi"
/ {
model = "STMicroelectronics STM32MP157A eval daughter";
compatible = "st,stm32mp157a-ed1", "st,stm32mp157";
chosen {
stdout-path = "serial0:115200n8";
};
reserved-memory {
gpu_reserved: gpu@f6000000 {
reg = <0xf6000000 0x8000000>;
no-map;
};
};
};
&gpu {
contiguous-area = <&gpu_reserved>;
};

View File

@ -0,0 +1,62 @@
// 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_TFABOOT
&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

View File

@ -0,0 +1,88 @@
// 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"
/ {
model = "STMicroelectronics STM32MP157A eval daughter on eval mother";
compatible = "st,stm32mp157a-ev1", "st,stm32mp157a-ed1", "st,stm32mp157";
chosen {
stdout-path = "serial0:115200n8";
};
aliases {
serial0 = &uart4;
serial1 = &usart3;
};
};
&ltdc {
status = "okay";
port {
ltdc_ep0_out: endpoint@0 {
reg = <0>;
remote-endpoint = <&dsi_in>;
};
};
};
&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 = <&ltdc_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>;
};
};

View File

@ -11,24 +11,35 @@
#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 = &ethernet0;
serial0 = &uart4;
serial1 = &usart3;
serial2 = &uart7;
serial3 = &usart2;
};
chosen {
stdout-path = "serial0:115200n8";
};
wifi_pwrseq: wifi-pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&gpioh 4 GPIO_ACTIVE_LOW>;
};
};
&cryp1 {
status = "okay";
};
&dsi {
status = "okay";
phy-dsi-supply = <&reg18>;
ports {
port@0 {
@ -46,7 +57,7 @@
};
};
panel@0 {
panel_otm8009a: panel-otm8009a@0 {
compatible = "orisetech,otm8009a";
reg = <0>;
reset-gpios = <&gpioe 4 GPIO_ACTIVE_LOW>;
@ -62,6 +73,18 @@
};
&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>;
vcc-supply = <&v3v3>;
status = "okay";
};
touchscreen@38 {
compatible = "focaltech,ft6236";
reg = <0x38>;
@ -70,6 +93,8 @@
interrupt-controller;
touchscreen-size-x = <480>;
touchscreen-size-y = <800>;
panel = <&panel_otm8009a>;
vcc-supply = <&v3v3>;
status = "okay";
};
};
@ -84,3 +109,49 @@
};
};
};
&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_c>;
pinctrl-1 = <&usart2_sleep_pins_c>;
pinctrl-2 = <&usart2_idle_pins_c>;
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>;
};
};

View File

@ -3,217 +3,4 @@
* 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>;
};
firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
reserved-memory {
optee@fe000000 {
reg = <0xfe000000 0x02000000>;
no-map;
};
};
led {
red {
label = "error";
gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
default-state = "off";
status = "okay";
};
};
};
&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;
};
};
&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"

View File

@ -1,7 +1,7 @@
// 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/;
@ -9,8 +9,7 @@
#include "stm32mp15xc.dtsi"
#include "stm32mp15-pinctrl.dtsi"
#include "stm32mp15xxaa-pinctrl.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/mfd/st,stpmic1.h>
#include "stm32mp15xx-edx.dtsi"
/ {
model = "STMicroelectronics STM32MP157C eval daughter";
@ -20,360 +19,18 @@
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>;
gpu_reserved: gpu@f6000000 {
reg = <0xf6000000 0x8000000>;
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;
gpios = <&gpiof 14 GPIO_ACTIVE_HIGH>;
gpios-states = <0>;
states = <1800000 0x1>,
<2900000 0x0>;
};
};
&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>;
};
&cpu1{
cpu-supply = <&vddcore>;
};
&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";
};
};
&dts {
&cryp1 {
status = "okay";
};
&gpu {
contiguous-area = <&gpu_reserved>;
};
&i2c4 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2c4_pins_a>;
pinctrl-1 = <&i2c4_sleep_pins_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 = <&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 = <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";
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;
};
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>;
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;
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";
};
&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>;
};

View File

@ -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"

View File

@ -1,13 +1,12 @@
// 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 <dt-bindings/input/input.h>
#include "stm32mp15xx-evx.dtsi"
/ {
model = "STMicroelectronics STM32MP157C eval daughter on eval mother";
@ -19,89 +18,30 @@
aliases {
serial0 = &uart4;
ethernet0 = &ethernet0;
};
clocks {
clk_ext_camera: clk-ext-camera {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <24000000>;
};
};
joystick {
compatible = "gpio-keys";
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";
serial1 = &usart3;
};
};
&cec {
pinctrl-names = "default";
pinctrl-0 = <&cec_pins_a>;
&ltdc {
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>;
ltdc_ep0_out: endpoint@0 {
reg = <0>;
remote-endpoint = <&dsi_in>;
};
};
};
&dsi {
phy-dsi-supply = <&reg18>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
dsi_in: endpoint {
@ -117,7 +57,7 @@
};
};
panel-dsi@0 {
panel_dsi: panel-dsi@0 {
compatible = "raydium,rm68200";
reg = <0>;
reset-gpios = <&gpiof 15 GPIO_ACTIVE_LOW>;
@ -133,229 +73,16 @@
};
};
&ethernet0 {
status = "okay";
pinctrl-0 = <&ethernet0_rgmii_pins_a>;
pinctrl-1 = <&ethernet0_rgmii_sleep_pins_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";
nand-controller@4,0 {
status = "okay";
nand@0 {
reg = <0>;
nand-on-flash-bbt;
#address-cells = <1>;
#size-cells = <1>;
};
};
};
&i2c2 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2c2_pins_a>;
pinctrl-1 = <&i2c2_sleep_pins_a>;
i2c-scl-rising-time-ns = <185>;
i2c-scl-falling-time-ns = <20>;
status = "okay";
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>;
gt9147: goodix_ts@5d {
compatible = "goodix,gt9147";
reg = <0x5d>;
panel = <&panel_dsi>;
pinctrl-0 = <&goodix_pins>;
pinctrl-names = "default";
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: pinctrl {
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 {
pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4";
bias-pull-down;
};
};
interrupts = <14 IRQ_TYPE_EDGE_RISING>;
interrupt-parent = <&stmfx_pinctrl>;
};
};
&i2c5 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2c5_pins_a>;
pinctrl-1 = <&i2c5_sleep_pins_a>;
i2c-scl-rising-time-ns = <185>;
i2c-scl-falling-time-ns = <20>;
status = "okay";
};
&ltdc {
status = "okay";
port {
ltdc_ep0_out: endpoint@0 {
reg = <0>;
remote-endpoint = <&dsi_in>;
};
};
};
&m_can1 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&m_can1_pins_a>;
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>;
};
};
&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";
};
&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-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";
};
};
&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";
};

View File

@ -13,9 +13,11 @@
};
};
#ifndef CONFIG_TFABOOT
&clk_hse {
st,digbypass;
};
#endif
&i2c2 {
u-boot,dm-pre-reloc;
@ -32,6 +34,7 @@
u-boot,dm-pre-reloc;
};
#ifndef CONFIG_TFABOOT
&rcc {
st,clksrc = <
CLK_MPU_PLL1P
@ -123,3 +126,4 @@
u-boot,dm-pre-reloc;
};
};
#endif

View File

@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
/*
* Copyright : STMicroelectronics 2019
*/
#include "stm32mp157a-dk1-u-boot.dtsi"

View File

@ -0,0 +1,28 @@
// 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 {
serial0 = &uart4;
serial1 = &usart3;
serial2 = &uart7;
};
chosen {
stdout-path = "serial0:115200n8";
};
};

View File

@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
/*
* Copyright : STMicroelectronics 2019
*/
#include "stm32mp157a-ed1-u-boot.dtsi"

View File

@ -0,0 +1,33 @@
// 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 "stm32mp15xx-edx.dtsi"
/ {
model = "STMicroelectronics STM32MP157D eval daughter";
compatible = "st,stm32mp157d-ed1", "st,stm32mp157";
chosen {
stdout-path = "serial0:115200n8";
};
reserved-memory {
gpu_reserved: gpu@f6000000 {
reg = <0xf6000000 0x8000000>;
no-map;
};
};
};
&gpu {
contiguous-area = <&gpu_reserved>;
status = "okay";
};

View File

@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
/*
* Copyright : STMicroelectronics 2019
*/
#include "stm32mp157a-ev1-u-boot.dtsi"

View File

@ -0,0 +1,88 @@
// 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"
/ {
model = "STMicroelectronics STM32MP157D eval daughter on eval mother";
compatible = "st,stm32mp157d-ev1", "st,stm32mp157d-ed1", "st,stm32mp157";
chosen {
stdout-path = "serial0:115200n8";
};
aliases {
serial0 = &uart4;
serial1 = &usart3;
};
};
&ltdc {
status = "okay";
port {
ltdc_ep0_out: endpoint@0 {
reg = <0>;
remote-endpoint = <&dsi_in>;
};
};
};
&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 = <&ltdc_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>;
};
};

View File

@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
/*
* Copyright : STMicroelectronics 2019
*/
#include "stm32mp157c-dk2-u-boot.dtsi"

View File

@ -0,0 +1,157 @@
// 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 {
serial0 = &uart4;
serial1 = &usart3;
serial2 = &uart7;
serial3 = &usart2;
};
chosen {
stdout-path = "serial0:115200n8";
};
wifi_pwrseq: wifi-pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&gpioh 4 GPIO_ACTIVE_LOW>;
};
};
&cryp1 {
status = "okay";
};
&dsi {
status = "okay";
ports {
port@0 {
reg = <0>;
dsi_in: endpoint {
remote-endpoint = <&ltdc_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>;
vcc-supply = <&v3v3>;
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>;
vcc-supply = <&v3v3>;
status = "okay";
};
};
&ltdc {
status = "okay";
port {
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_c>;
pinctrl-1 = <&usart2_sleep_pins_c>;
pinctrl-2 = <&usart2_idle_pins_c>;
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>;
};
};

View File

@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
/*
* Copyright : STMicroelectronics 2019
*/
#include "stm32mp157c-ed1-u-boot.dtsi"

View File

@ -0,0 +1,37 @@
// 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 "stm32mp15xx-edx.dtsi"
/ {
model = "STMicroelectronics STM32MP157F eval daughter";
compatible = "st,stm32mp157f-ed1", "st,stm32mp157";
chosen {
stdout-path = "serial0:115200n8";
};
reserved-memory {
gpu_reserved: gpu@f6000000 {
reg = <0xf6000000 0x8000000>;
no-map;
};
};
};
&cryp1 {
status = "okay";
};
&gpu {
contiguous-area = <&gpu_reserved>;
status = "okay";
};

View File

@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
/*
* Copyright : STMicroelectronics 2019
*/
#include "stm32mp157c-ev1-u-boot.dtsi"

View File

@ -0,0 +1,89 @@
// 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>
/ {
model = "STMicroelectronics STM32MP157F eval daughter on eval mother";
compatible = "st,stm32mp157f-ev1", "st,stm32mp157f-ed1", "st,stm32mp157";
chosen {
stdout-path = "serial0:115200n8";
};
aliases {
serial0 = &uart4;
serial1 = &usart3;
};
};
&ltdc {
status = "okay";
port {
ltdc_ep0_out: endpoint@0 {
reg = <0>;
remote-endpoint = <&dsi_in>;
};
};
};
&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 = <&ltdc_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>;
};
};

View 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>;
};
};

View File

@ -4,14 +4,16 @@
* 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 = <&rcc CRYP1>;
resets = <&rcc CRYP1_R>;
clocks = <&scmi0_clk CK_SCMI0_CRYP1>;
resets = <&scmi0_reset RST_SCMI0_CRYP1>;
status = "disabled";
};
};

View 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 = <95000>;
hysteresis = <10000>;
type = "passive";
};
};
cooling-maps {
map0 {
trip = <&cpu_alert>;
cooling-device = <&cpu0 1 1>;
};
};
};

View 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";
};
};
};

View File

@ -171,6 +171,7 @@
};
};
#ifndef CONFIG_TFABOOT
&rcc {
st,clksrc = <
CLK_MPU_PLL1P
@ -262,6 +263,7 @@
u-boot,dm-pre-reloc;
};
};
#endif
&sdmmc1 {
u-boot,dm-spl;

View File

@ -70,6 +70,7 @@
};
};
#ifndef CONFIG_TFABOOT
&rcc {
st,clksrc = <
CLK_MPU_PLL1P
@ -161,3 +162,4 @@
u-boot,dm-pre-reloc;
};
};
#endif

View File

@ -4,10 +4,16 @@
* Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
*/
#include "stm32mp15-m4-srm.dtsi"
#include "stm32mp15-m4-srm-pinctrl.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/mfd/st,stpmic1.h>
/ {
aliases {
ethernet0 = &ethernet0;
};
memory@c0000000 {
device_type = "memory";
reg = <0xc0000000 0x20000000>;
@ -62,7 +68,7 @@
led {
compatible = "gpio-leds";
blue {
led-blue {
label = "heartbeat";
gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
@ -72,7 +78,7 @@
sound {
compatible = "audio-graph-card";
label = "STM32MP1-DK";
label = "STM32MP15-DK";
routing =
"Playback" , "MCLK",
"Capture" , "MCLK",
@ -80,6 +86,25 @@
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 {
@ -116,10 +141,6 @@
status = "okay";
};
&dts {
status = "okay";
};
&cpu0{
cpu-supply = <&vddcore>;
};
@ -128,6 +149,22 @@
cpu-supply = <&vddcore>;
};
&crc1 {
status = "okay";
};
&dma1 {
sram = <&dma_pool>;
};
&dma2 {
sram = <&dma_pool>;
};
&dts {
status = "okay";
};
&ethernet0 {
status = "okay";
pinctrl-0 = <&ethernet0_rgmii_pins_a>;
@ -136,6 +173,8 @@
phy-mode = "rgmii-id";
max-speed = <1000>;
phy-handle = <&phy0>;
nvmem-cells = <&ethernet_mac_address>;
nvmem-cell-names = "mac-address";
mdio0 {
#address-cells = <1>;
@ -151,6 +190,10 @@
contiguous-area = <&gpu_reserved>;
};
&hash1 {
status = "okay";
};
&i2c1 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2c1_pins_a>;
@ -238,37 +281,52 @@
/delete-property/dmas;
/delete-property/dma-names;
typec: stusb1600@28 {
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>;
typec_con: connector {
connector {
compatible = "usb-c-connector";
label = "USB-C";
power-role = "sink";
power-opmode = "default";
power-role = "dual";
typec-power-opmode = "default";
port {
con_usbotg_hs_ep: endpoint {
remote-endpoint = <&usbotg_hs_ep>;
};
};
};
};
pmic: stpmic@33 {
compatible = "st,stpmic1";
reg = <0x33>;
interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;
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>;
@ -357,23 +415,24 @@
vref_ddr: vref_ddr {
regulator-name = "vref_ddr";
regulator-always-on;
regulator-over-current-protection;
};
bst_out: boost {
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 {
vbus_sw: pwr_sw2 {
regulator-name = "vbus_sw";
interrupts = <IT_OCP_SWOUT 0>;
regulator-active-discharge = <1>;
};
};
};
onkey {
@ -391,6 +450,19 @@
};
};
&i2c5 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2c5_pins_a>;
pinctrl-1 = <&i2c5_sleep_pins_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";
@ -438,6 +510,7 @@
mbox-names = "vq0", "vq1", "shutdown";
interrupt-parent = <&exti>;
interrupts = <68 1>;
wakeup-source;
status = "okay";
};
@ -465,8 +538,6 @@
sai2a: audio-controller@4400b004 {
#clock-cells = <0>;
dma-names = "tx";
clocks = <&rcc SAI2_K>;
clock-names = "sai_ck";
status = "okay";
sai2a_port: port {
@ -524,6 +595,27 @@
status = "disabled";
};
&spi4 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&spi4_pins_b>;
pinctrl-1 = <&spi4_sleep_pins_b>;
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;
@ -610,21 +702,50 @@
};
&uart4 {
pinctrl-names = "default";
pinctrl-names = "default", "sleep", "idle";
pinctrl-0 = <&uart4_pins_a>;
pinctrl-1 = <&uart4_sleep_pins_a>;
pinctrl-2 = <&uart4_idle_pins_a>;
/delete-property/dmas;
/delete-property/dma-names;
status = "okay";
};
&uart7 {
pinctrl-names = "default", "sleep", "idle";
pinctrl-0 = <&uart7_pins_c>;
pinctrl-1 = <&uart7_sleep_pins_c>;
pinctrl-2 = <&uart7_idle_pins_c>;
/delete-property/dmas;
/delete-property/dma-names;
status = "disabled";
};
&usart3 {
pinctrl-names = "default", "sleep", "idle";
pinctrl-0 = <&usart3_pins_c>;
pinctrl-1 = <&usart3_sleep_pins_c>;
pinctrl-2 = <&usart3_idle_pins_c>;
uart-has-rtscts;
status = "disabled";
};
&usbh_ehci {
phys = <&usbphyc_port0>;
status = "okay";
};
&usbotg_hs {
dr_mode = "peripheral";
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 {
@ -633,10 +754,12 @@
&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 {

View File

@ -0,0 +1,413 @@
// 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 "stm32mp15-m4-srm.dtsi"
#include "stm32mp15-m4-srm-pinctrl.dtsi"
#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;
};
};
aliases {
serial0 = &uart4;
};
led {
compatible = "gpio-leds";
led-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>;
};
&cpu1{
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_sleep_pins_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";
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 = <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;
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>;
/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>;
};

View File

@ -0,0 +1,686 @@
// 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>
/ {
aliases {
ethernet0 = &ethernet0;
};
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 = "STM32MP15-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-type = <5>;
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 = <0>;
st,adc-channel-names = "dmic_u2";
st,adc-channel-types = "SPI_F";
st,adc-channel-clk-src = "CLKOUT";
st,filter-order = <3>;
st,adc-alt-channel = <1>;
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 = <2>;
st,adc-channel-names = "dmic_u3";
st,adc-channel-types = "SPI_F";
st,adc-channel-clk-src = "CLKOUT";
st,adc-alt-channel = <1>;
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>;
};
};
};
};
};
&ethernet0 {
status = "okay";
pinctrl-0 = <&ethernet0_rgmii_pins_a>;
pinctrl-1 = <&ethernet0_rgmii_sleep_pins_a>;
pinctrl-names = "default", "sleep";
phy-mode = "rgmii-id";
max-speed = <1000>;
phy-handle = <&phy0>;
nvmem-cells = <&ethernet_mac_address>;
nvmem-cell-names = "mac-address";
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";
nand-controller@4,0 {
status = "okay";
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_sleep_pins_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: pinctrl {
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 {
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_sleep_pins_a>;
i2c-scl-rising-time-ns = <185>;
i2c-scl-falling-time-ns = <20>;
/delete-property/dmas;
/delete-property/dma-names;
status = "okay";
};
&m_can1 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&m_can1_pins_a>;
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>;
};
};
&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";
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";
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>;
broken-cd;
st,neg-edge;
bus-width = <4>;
vmmc-supply = <&v3v3>;
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_b>;
pinctrl-1 = <&usart3_sleep_pins_b>;
pinctrl-2 = <&usart3_idle_pins_b>;
/*
* HW flow control USART3_RTS is optional, and isn't default wired to
* the connector. SB23 needs to be soldered in order to use it, and R77
* (ETH_CLK) should be removed.
*/
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>;
vbus-supply = <&vbus_sw>;
};
&usbphyc_port1 {
st,phy-tuning = <&usb_phy_tuning>;
};

View File

@ -6,7 +6,6 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
#define CONFIG_LMB
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
#if defined(CONFIG_ARCH_LS1021A) || \

View File

@ -458,6 +458,7 @@ static inline void set_dacr(unsigned int val)
/* options available for data cache on each page */
enum dcache_option {
INVALID_ENTRY = 0,
DCACHE_OFF = TTB_SECT | TTB_SECT_MAIR(0) | TTB_SECT_XN_MASK,
DCACHE_WRITETHROUGH = TTB_SECT | TTB_SECT_MAIR(1),
DCACHE_WRITEBACK = TTB_SECT | TTB_SECT_MAIR(2),
@ -488,6 +489,7 @@ enum dcache_option {
* 1 1 1 Outer/Inner Write-Back, Read-Allocate Write-Allocate
*/
enum dcache_option {
INVALID_ENTRY = 0,
DCACHE_OFF = TTB_SECT_DOMAIN(0) | TTB_SECT_XN_MASK | TTB_SECT,
DCACHE_WRITETHROUGH = DCACHE_OFF | TTB_SECT_C_MASK,
DCACHE_WRITEBACK = DCACHE_WRITETHROUGH | TTB_SECT_B_MASK,
@ -497,6 +499,7 @@ enum dcache_option {
#define TTB_SECT_AP (3 << 10)
/* options available for data cache on each page */
enum dcache_option {
INVALID_ENTRY = 0,
DCACHE_OFF = 0x12,
DCACHE_WRITETHROUGH = 0x1a,
DCACHE_WRITEBACK = 0x1e,

View File

@ -6,6 +6,7 @@
#include <common.h>
#include <cpu_func.h>
#include <lmb.h>
#include <log.h>
#include <asm/system.h>
#include <asm/cache.h>
@ -96,27 +97,33 @@ void mmu_set_region_dcache_behaviour_phys(phys_addr_t start, phys_addr_t phys,
mmu_page_table_flush(startpt, stoppt);
}
void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
enum dcache_option option)
{
mmu_set_region_dcache_behaviour_phys(start, start, size, option);
}
__weak void dram_bank_mmu_setup(int bank)
{
struct bd_info *bd = gd->bd;
struct lmb lmb;
int i;
/* bd->bi_dram is available only after relocation */
if ((gd->flags & GD_FLG_RELOC) == 0)
return;
/*
* don't allow cache on reserved memory tagged 'no-map' in DT
* => avoid speculative access to "secure" data
*/
lmb_init_and_reserve(&lmb, bd, (void *)gd->fdt_blob);
debug("%s: bank: %d\n", __func__, bank);
for (i = bd->bi_dram[bank].start >> MMU_SECTION_SHIFT;
i < (bd->bi_dram[bank].start >> MMU_SECTION_SHIFT) +
(bd->bi_dram[bank].size >> MMU_SECTION_SHIFT);
i++)
set_section_dcache(i, DCACHE_DEFAULT_OPTION);
i++) {
if (lmb_is_reserved_flags(&lmb, i << MMU_SECTION_SHIFT,
LMB_NOMAP))
set_section_dcache(i, INVALID_ENTRY);
else
set_section_dcache(i, DCACHE_DEFAULT_OPTION);
}
}
/* to activate the MMU we need to set up virtual memory: use 1M areas */
@ -313,6 +320,12 @@ int dcache_status(void)
{
return 0; /* always off */
}
void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
enum dcache_option option)
{
}
#else
void dcache_enable(void)
{
@ -328,4 +341,10 @@ int dcache_status(void)
{
return (get_cr() & CR_C) != 0;
}
void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
enum dcache_option option)
{
mmu_set_region_dcache_behaviour_phys(start, start, size, option);
}
#endif

View File

@ -56,6 +56,13 @@ config STM32MP15x
dual core A7 for STM32MP157/3, monocore for STM32MP151
target all the STMicroelectronics board with SOC STM32MP1 family
config STM32MP15x_STM32IMAGE
bool "Support STM32 image for generated U-Boot image"
depends on STM32MP15x && TFABOOT
help
Support of STM32 image generation for SOC STM32MP15x
for TF-A boot when FIP container is not used
choice
prompt "STM32MP15x board select"
optional
@ -93,6 +100,19 @@ config SYS_TEXT_BASE
config NR_DRAM_BANKS
default 1
config DDR_CACHEABLE_SIZE
hex "Size of the DDR marked cacheable in pre-reloc stage"
default 0x10000000 if TFABOOT
default 0x40000000
help
Define the size of the DDR marked as cacheable in U-Boot
pre-reloc stage.
This option can be useful to avoid speculatif access
to secured area of DDR used by TF-A or OP-TEE before U-Boot
initialization.
The areas marked "no-map" in device tree should be located
before this limit: STM32_DDR_BASE + DDR_CACHEABLE_SIZE.
config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2
hex "Partition on MMC2 to use to load U-Boot from"
depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
@ -108,23 +128,6 @@ config STM32_ETZPC
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
@ -164,6 +167,7 @@ config DEBUG_UART_CLOCK
default 64000000
endif
source "arch/arm/mach-stm32mp/cmd_stm32prog/Kconfig"
source "board/st/stm32mp1/Kconfig"
source "board/dhelectronics/dh_stm32mp1/Kconfig"

View File

@ -11,7 +11,7 @@ obj-y += bsec.o
ifdef CONFIG_SPL_BUILD
obj-y += spl.o
else
obj-$(CONFIG_CMD_STM32PROG) += cmd_stm32prog/
obj-y += cmd_stm32prog/
obj-$(CONFIG_CMD_STM32KEY) += cmd_stm32key.o
obj-$(CONFIG_ARMV7_PSCI) += psci.o
obj-$(CONFIG_TFABOOT) += boot_params.o

View File

@ -4,6 +4,7 @@
*/
#include <common.h>
#include <clk.h>
#include <dm.h>
#include <log.h>
#include <misc.h>
@ -486,6 +487,15 @@ static int stm32mp_bsec_probe(struct udevice *dev)
{
int otp;
struct stm32mp_bsec_platdata *plat;
struct clk_bulk clk_bulk;
int ret;
ret = clk_get_bulk(dev, &clk_bulk);
if (!ret) {
ret = clk_enable_bulk(&clk_bulk);
if (ret)
return ret;
}
/*
* update unlocked shadow for OTP cleared by the rom code

View File

@ -0,0 +1,34 @@
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
NB: access to not volatile memory (NOR/NAND/SD/eMMC) is based
on U-Boot DFU framework
config CMD_STM32PROG_USB
bool "support stm32prog over USB"
depends on CMD_STM32PROG
default y
help
activate the command "stm32prog usb" for STM32MP soc family
witch update the device with the tools STM32CubeProgrammer,
using USB with DFU protocol
config CMD_STM32PROG_SERIAL
bool "support stm32prog over UART"
depends on CMD_STM32PROG
default y
help
activate the command "stm32prog serial" for STM32MP soc family
with the tools STM32CubeProgrammer using U-Boot serial device
and UART protocol.

View File

@ -3,7 +3,7 @@
# 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
obj-$(CONFIG_CMD_STM32PROG) += cmd_stm32prog.o
obj-$(CONFIG_CMD_STM32PROG) += stm32prog.o
obj-$(CONFIG_CMD_STM32PROG_SERIAL) += stm32prog_serial.o
obj-$(CONFIG_CMD_STM32PROG_USB) += stm32prog_usb.o

View File

@ -50,9 +50,9 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc,
if (argc < 3 || argc > 5)
return CMD_RET_USAGE;
if (!strcmp(argv[1], "usb"))
if (IS_ENABLED(CONFIG_CMD_STM32PROG_USB) && !strcmp(argv[1], "usb"))
link = LINK_USB;
else if (!strcmp(argv[1], "serial"))
else if (IS_ENABLED(CONFIG_CMD_STM32PROG_SERIAL) && !strcmp(argv[1], "serial"))
link = LINK_SERIAL;
if (link == LINK_UNDEFINED) {
@ -73,15 +73,16 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc,
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;
if (size == 0) {
stm32prog_header_check((struct raw_header_s *)addr, &header);
if (header.type == HEADER_STM32IMAGE) {
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 image_source_script(addr + BL_HEADER_SIZE,
"script@1");
/* uImage detected in STM32IMAGE, execute the script */
if (IMAGE_FORMAT_LEGACY ==
genimg_get_format((void *)(addr + BL_HEADER_SIZE)))
return image_source_script(addr + BL_HEADER_SIZE, "script@1");
}
}
if (IS_ENABLED(CONFIG_DM_VIDEO))
@ -174,6 +175,7 @@ U_BOOT_CMD(stm32prog, 5, 0, do_stm32prog,
"<size> = size of flashlayout\n"
);
#ifdef CONFIG_STM32MP15x_STM32IMAGE
bool stm32prog_get_tee_partitions(void)
{
if (stm32prog_data)
@ -181,6 +183,7 @@ bool stm32prog_get_tee_partitions(void)
return false;
}
#endif
bool stm32prog_get_fsbl_nor(void)
{

View File

@ -59,8 +59,6 @@ static const efi_guid_t uuid_mmc[3] = {
ROOTFS_MMC2_UUID
};
DECLARE_GLOBAL_DATA_PTR;
/* order of column in flash layout file */
enum stm32prog_col_t {
COL_OPTION,
@ -72,6 +70,16 @@ enum stm32prog_col_t {
COL_NB_STM32
};
#define FIP_TOC_HEADER_NAME 0xAA640001
struct fip_toc_header {
u32 name;
u32 serial_number;
u64 flags;
};
DECLARE_GLOBAL_DATA_PTR;
/* partition handling routines : CONFIG_CMD_MTDPARTS */
int mtdparts_init(void);
int find_dev_and_part(const char *id, struct mtd_device **dev,
@ -87,46 +95,57 @@ char *stm32prog_get_error(struct stm32prog_data *data)
return data->error;
}
u8 stm32prog_header_check(struct raw_header_s *raw_header,
struct image_header_s *header)
static bool stm32prog_is_fip_header(struct fip_toc_header *header)
{
return (header->name == FIP_TOC_HEADER_NAME) && header->serial_number;
}
void stm32prog_header_check(struct raw_header_s *raw_header,
struct image_header_s *header)
{
unsigned int i;
header->present = 0;
if (!raw_header || !header) {
pr_debug("%s:no header data\n", __func__);
return;
}
header->type = HEADER_NONE;
header->image_checksum = 0x0;
header->image_length = 0x0;
if (!raw_header || !header) {
pr_debug("%s:no header data\n", __func__);
return -1;
if (stm32prog_is_fip_header((struct fip_toc_header *)raw_header)) {
header->type = HEADER_FIP;
return;
}
if (raw_header->magic_number !=
(('S' << 0) | ('T' << 8) | ('M' << 16) | (0x32 << 24))) {
pr_debug("%s:invalid magic number : 0x%x\n",
__func__, raw_header->magic_number);
return -2;
return;
}
/* only header v1.0 supported */
if (raw_header->header_version != 0x00010000) {
pr_debug("%s:invalid header version : 0x%x\n",
__func__, raw_header->header_version);
return -3;
return;
}
if (raw_header->reserved1 != 0x0 || raw_header->reserved2) {
pr_debug("%s:invalid reserved field\n", __func__);
return -4;
return;
}
for (i = 0; i < (sizeof(raw_header->padding) / 4); i++) {
if (raw_header->padding[i] != 0) {
pr_debug("%s:invalid padding field\n", __func__);
return -5;
return;
}
}
header->present = 1;
header->type = HEADER_STM32IMAGE;
header->image_checksum = le32_to_cpu(raw_header->image_checksum);
header->image_length = le32_to_cpu(raw_header->image_length);
return 0;
return;
}
static u32 stm32prog_header_checksum(u32 addr, struct image_header_s *header)
@ -349,23 +368,24 @@ static int parse_flash_layout(struct stm32prog_data *data,
bool end_of_line, eof;
char *p, *start, *last, *col;
struct stm32prog_part_t *part;
struct image_header_s header;
int part_list_size;
int i;
data->part_nb = 0;
/* check if STM32image is detected */
if (!stm32prog_header_check((struct raw_header_s *)addr,
&data->header)) {
stm32prog_header_check((struct raw_header_s *)addr, &header);
if (header.type == HEADER_STM32IMAGE) {
u32 checksum;
addr = addr + BL_HEADER_SIZE;
size = data->header.image_length;
size = header.image_length;
checksum = stm32prog_header_checksum(addr, &data->header);
if (checksum != data->header.image_checksum) {
checksum = stm32prog_header_checksum(addr, &header);
if (checksum != header.image_checksum) {
stm32prog_err("Layout: invalid checksum : 0x%x expected 0x%x",
checksum, data->header.image_checksum);
checksum, header.image_checksum);
return -EIO;
}
}
@ -768,9 +788,8 @@ static int init_device(struct stm32prog_data *data,
part_found = true;
}
/* no partition for this device */
if (!part_found) {
stm32prog_err("%s (0x%x): Invalid partition",
part->name, part->id);
pr_debug("\n");
continue;
}
@ -804,7 +823,9 @@ static int treat_partition_list(struct stm32prog_data *data)
INIT_LIST_HEAD(&data->dev[j].part_list);
}
#ifdef CONFIG_STM32MP15x_STM32IMAGE
data->tee_detected = false;
#endif
data->fsbl_nor_detected = false;
for (i = 0; i < data->part_nb; i++) {
part = &data->part_array[i];
@ -858,10 +879,12 @@ static int treat_partition_list(struct stm32prog_data *data)
/* fallthrough */
case STM32PROG_NAND:
case STM32PROG_SPI_NAND:
#ifdef CONFIG_STM32MP15x_STM32IMAGE
if (!data->tee_detected &&
!strncmp(part->name, "tee", 3))
data->tee_detected = true;
break;
#endif
default:
break;
}
@ -1410,7 +1433,7 @@ static int stm32prog_copy_fsbl(struct stm32prog_part_t *part)
if (part->target != STM32PROG_NAND &&
part->target != STM32PROG_SPI_NAND)
return -1;
return -EINVAL;
dfu = dfu_get_entity(part->alt_id);
@ -1420,8 +1443,10 @@ static int stm32prog_copy_fsbl(struct stm32prog_part_t *part)
ret = dfu->read_medium(dfu, 0, (void *)&raw_header, &size);
if (ret)
return ret;
if (stm32prog_header_check(&raw_header, &header))
return -1;
stm32prog_header_check(&raw_header, &header);
if (header.type != HEADER_STM32IMAGE)
return -ENOENT;
/* read header + payload */
size = header.image_length + BL_HEADER_SIZE;
@ -1706,7 +1731,6 @@ void stm32prog_clean(struct stm32prog_data *data)
free(data->part_array);
free(data->otp_part);
free(data->buffer);
free(data->header_data);
}
/* DFU callback: used after serial and direct DFU USB access */

View File

@ -37,8 +37,14 @@ enum stm32prog_link_t {
LINK_UNDEFINED,
};
enum stm32prog_header_t {
HEADER_NONE,
HEADER_STM32IMAGE,
HEADER_FIP,
};
struct image_header_s {
bool present;
enum stm32prog_header_t type;
u32 image_checksum;
u32 image_length;
};
@ -115,7 +121,9 @@ struct stm32prog_data {
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 */
#ifdef CONFIG_STM32MP15x_STM32IMAGE
bool tee_detected;
#endif
bool fsbl_nor_detected;
/* command internal information */
@ -126,14 +134,9 @@ struct stm32prog_data {
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;
@ -160,8 +163,8 @@ int stm32prog_pmic_read(struct stm32prog_data *data, u32 offset,
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);
void 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);
@ -177,9 +180,29 @@ char *stm32prog_get_error(struct stm32prog_data *data);
/* 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);
#ifdef CONFIG_CMD_STM32PROG_SERIAL
int stm32prog_serial_init(struct stm32prog_data *data, int link_dev);
bool stm32prog_serial_loop(struct stm32prog_data *data);
#else
static inline int stm32prog_serial_init(struct stm32prog_data *data, int link_dev)
{
return -ENOSYS;
}
static inline bool stm32prog_serial_loop(struct stm32prog_data *data)
{
return false;
}
#endif
#ifdef CONFIG_CMD_STM32PROG_USB
bool stm32prog_usb_loop(struct stm32prog_data *data, int dev);
#else
static inline bool stm32prog_usb_loop(struct stm32prog_data *data, int dev)
{
return false;
}
#endif
#endif

View File

@ -59,6 +59,9 @@ const u8 cmd_id[] = {
#define NB_CMD sizeof(cmd_id)
/* with 115200 bauds, 20 ms allow to receive the 256 bytes buffer */
#define TIMEOUT_SERIAL_BUFFER 30
/* DFU support for serial *********************************************/
static struct dfu_entity *stm32prog_get_entity(struct stm32prog_data *data)
{
@ -186,36 +189,19 @@ static int stm32prog_read(struct stm32prog_data *data, u8 phase, u32 offset,
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);
if (uclass_get_device_by_seq(UCLASS_SERIAL, link_dev, &dev)) {
pr_err("serial %d device not found\n", link_dev);
return -ENODEV;
}
down_serial_dev = dev;
/* 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;
@ -225,11 +211,11 @@ int stm32prog_serial_init(struct stm32prog_data *data, int link_dev)
ops = serial_get_ops(down_serial_dev);
if (!ops) {
pr_err("%s = %s missing ops", alias, path);
pr_err("serial %d = %s missing ops\n", link_dev, dev->name);
return -ENODEV;
}
if (!ops->setconfig) {
pr_err("%s = %s missing setconfig", alias, path);
pr_err("serial %d = %s missing setconfig\n", link_dev, dev->name);
return -ENODEV;
}
@ -280,6 +266,7 @@ static bool stm32prog_serial_get_buffer(u8 *buffer, u32 *count)
{
struct dm_serial_ops *ops = serial_get_ops(down_serial_dev);
int err;
ulong start = get_timer(0);
do {
err = ops->getc(down_serial_dev);
@ -289,6 +276,10 @@ static bool stm32prog_serial_get_buffer(u8 *buffer, u32 *count)
} else if (err == -EAGAIN) {
ctrlc();
WATCHDOG_RESET();
if (get_timer(start) > TIMEOUT_SERIAL_BUFFER) {
err = -ETIMEDOUT;
break;
}
} else {
break;
}
@ -308,57 +299,6 @@ static void stm32prog_serial_putc(u8 w_byte)
}
/* 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;
@ -397,32 +337,14 @@ static u8 stm32prog_start(struct stm32prog_data *data, u32 address)
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;
}
ret = dfu_flush(dfu_entity, NULL, 0, data->dfu_seq);
if (ret) {
stm32prog_err("DFU flush failed [%d]", ret);
return ret;
}
data->dfu_seq = 0;
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)
@ -645,14 +567,12 @@ static void download_command(struct stm32prog_data *data)
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;
@ -686,13 +606,8 @@ static void download_command(struct stm32prog_data *data)
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++;
@ -740,7 +655,7 @@ static void download_command(struct stm32prog_data *data)
printf("transmission error on packet %d, byte %d\n",
packet_number, codesize - counter);
/* waiting end of packet before flush & NACK */
mdelay(30);
mdelay(TIMEOUT_SERIAL_BUFFER);
data->packet_number--;
result = NACK_BYTE;
goto end;
@ -758,80 +673,33 @@ static void download_command(struct stm32prog_data *data)
/* wait to be sure that all data are received
* in the FIFO before flush
*/
mdelay(30);
mdelay(TIMEOUT_SERIAL_BUFFER);
data->packet_number--;
result = NACK_BYTE;
goto end;
}
/* Update current position in buffer */
data->cursor += codesize;
switch (operation) {
case PHASE_OTP:
size = codesize;
ret = stm32prog_otp_write(data, cursor, data->buffer, &size);
break;
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;
case PHASE_PMIC:
size = codesize;
ret = stm32prog_pmic_write(data, cursor, data->buffer, &size);
break;
default:
ret = stm32prog_write(data, data->buffer, codesize);
break;
}
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;
else
/* Update current position in buffer */
data->cursor += codesize;
end:
stm32prog_serial_result(result);

View File

@ -4,7 +4,7 @@
#
ifndef CONFIG_SPL
INPUTS-y += u-boot.stm32
INPUTS-$(CONFIG_STM32MP15x_STM32IMAGE) += u-boot.stm32
else
ifdef CONFIG_SPL_BUILD
INPUTS-y += u-boot-spl.stm32

View File

@ -219,18 +219,21 @@ static void early_enable_caches(void)
if (CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
return;
#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
gd->arch.tlb_size = PGTABLE_SIZE;
gd->arch.tlb_addr = (unsigned long)&early_tlb;
#endif
dcache_enable();
if (IS_ENABLED(CONFIG_SPL_BUILD))
mmu_set_region_dcache_behaviour(
ALIGN(STM32_SYSRAM_BASE, MMU_SECTION_SIZE),
round_up(STM32_SYSRAM_SIZE, MMU_SECTION_SIZE),
ALIGN_DOWN(STM32_SYSRAM_BASE, MMU_SECTION_SIZE),
ALIGN(STM32_SYSRAM_SIZE, MMU_SECTION_SIZE),
DCACHE_DEFAULT_OPTION);
else
mmu_set_region_dcache_behaviour(STM32_DDR_BASE, STM32_DDR_SIZE,
mmu_set_region_dcache_behaviour(STM32_DDR_BASE,
CONFIG_DDR_CACHEABLE_SIZE,
DCACHE_DEFAULT_OPTION);
}
@ -260,7 +263,8 @@ int arch_cpu_init(void)
boot_mode = get_bootmode();
if ((boot_mode & TAMP_BOOT_DEVICE_MASK) == BOOT_SERIAL_UART)
if (IS_ENABLED(CONFIG_CMD_STM32PROG_SERIAL) &&
(boot_mode & TAMP_BOOT_DEVICE_MASK) == BOOT_SERIAL_UART)
gd->flags |= GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE;
#if defined(CONFIG_DEBUG_UART) && \
!defined(CONFIG_TFABOOT) && \
@ -460,7 +464,6 @@ static void setup_boot_mode(void)
unsigned int instance = (boot_mode & TAMP_BOOT_INSTANCE_MASK) - 1;
u32 forced_mode = (boot_ctx & TAMP_BOOT_FORCED_MASK);
struct udevice *dev;
int alias;
pr_debug("%s: boot_ctx=0x%x => boot_mode=%x, instance=%d forced=%x\n",
__func__, boot_ctx, boot_mode, instance, forced_mode);
@ -470,17 +473,22 @@ static void setup_boot_mode(void)
break;
/* serial : search associated alias in devicetree */
sprintf(cmd, "serial@%x", serial_addr[instance]);
if (uclass_get_device_by_name(UCLASS_SERIAL, cmd, &dev))
if (uclass_get_device_by_name(UCLASS_SERIAL, cmd, &dev)) {
/* restore console on error */
if (IS_ENABLED(CONFIG_CMD_STM32PROG_SERIAL))
gd->flags &= ~(GD_FLG_SILENT |
GD_FLG_DISABLE_CONSOLE);
printf("uart%d = %s not found in device tree!\n",
instance, cmd);
break;
if (fdtdec_get_alias_seq(gd->fdt_blob, "serial",
dev_of_offset(dev), &alias))
break;
sprintf(cmd, "%d", alias);
}
sprintf(cmd, "%d", dev->seq);
env_set("boot_device", "serial");
env_set("boot_instance", cmd);
/* restore console on uart when not used */
if (gd->cur_serial_dev != dev) {
if (IS_ENABLED(CONFIG_CMD_STM32PROG_SERIAL) &&
(gd->cur_serial_dev != dev)) {
gd->flags &= ~(GD_FLG_SILENT |
GD_FLG_DISABLE_CONSOLE);
printf("serial boot with console enabled!\n");

View File

@ -328,7 +328,16 @@ int ft_system_setup(void *blob, struct bd_info *bd)
"st,package", pkg, false);
}
if (!CONFIG_IS_ENABLED(OPTEE) ||
/*
* TEMP: remove OP-TEE nodes in kernel device tree
* copied from U-Boot device tree by optee_copy_fdt_nodes
* when OP-TEE is not detected (probe failed)
* these OP-TEE nodes are present in <board>-u-boot.dtsi
* under CONFIG_STM32MP15x_STM32IMAGE only for compatibility
* when FIP is not used by TF-A
*/
if (CONFIG_IS_ENABLED(STM32MP15x_STM32IMAGE) &&
CONFIG_IS_ENABLED(OPTEE) &&
!tee_find_device(NULL, NULL, NULL, NULL))
stm32_fdt_disable_optee(blob);

View File

@ -91,8 +91,10 @@ enum boot_device {
/* 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)

View File

@ -8,19 +8,53 @@
#include <linux/arm-smccc.h>
/* SMC service generic return codes */
#define STM32_SMC_OK 0x00000000U
#define STM32_SMC_NOT_SUPPORTED 0xFFFFFFFFU
#define STM32_SMC_FAILED 0xFFFFFFFEU
#define STM32_SMC_INVALID_PARAMS 0xFFFFFFFDU
/*
* SMC function IDs for STM32 Service queries
* SMC function IDs for STM32 Service queries.
* STM32 SMC services use the space between 0x82000000 and 0x8200FFFF
* like this is defined in SMC calling Convention by ARM
* for SiP (silicon Partner)
* http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html
* for SiP (silicon Partner).
* https://developer.arm.com/docs/den0028/latest
*/
#define STM32_SMC_VERSION 0x82000000
/* Secure Service access from Non-secure */
/*
* SMC function STM32_SMC_PWR.
*
* Argument a0: (input) SMCC ID.
* (output) Status return code.
* Argument a1: (input) Service ID (STM32_SMC_REG_xxx).
* Argument a2: (input) Register offset or physical address.
* (output) Register read value, if applicable.
* Argument a3: (input) Register target value if applicable.
*/
#define STM32_SMC_PWR 0x82001001
/*
* SMC functions STM32_SMC_BSEC.
*
* Argument a0: (input) SMCC ID.
* (output) Status return code.
* Argument a1: (input) Service ID (STM32_SMC_READ_xxx/_PROG_xxx/_WRITE_xxx).
* (output) OTP read value, if applicable.
* Argument a2: (input) OTP index.
* Argument a3: (input) OTP value if applicable.
*/
#define STM32_SMC_BSEC 0x82001003
/* Service for BSEC */
/* Service ID for STM32_SMC_PWR */
#define STM32_SMC_REG_READ 0x0
#define STM32_SMC_REG_WRITE 0x1
#define STM32_SMC_REG_SET 0x2
#define STM32_SMC_REG_CLEAR 0x3
/* Service ID for STM32_SMC_BSEC */
#define STM32_SMC_READ_SHADOW 0x01
#define STM32_SMC_PROG_OTP 0x02
#define STM32_SMC_WRITE_SHADOW 0x03
@ -29,12 +63,6 @@
#define STM32_SMC_WRITE_ALL 0x06
#define STM32_SMC_WRLOCK_OTP 0x07
/* SMC error codes */
#define STM32_SMC_OK 0x0
#define STM32_SMC_NOT_SUPPORTED -1
#define STM32_SMC_FAILED -2
#define STM32_SMC_INVALID_PARAMS -3
#define stm32_smc_exec(svc, op, data1, data2) \
stm32_smc(svc, op, data1, data2, NULL)

View File

@ -11,6 +11,7 @@ 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);
/* only needed for CONFIG_STM32MP15x_STM32IMAGE, prototype defined to avoid compilation issue */
bool stm32prog_get_tee_partitions(void);
bool stm32prog_get_fsbl_nor(void);

View File

@ -8,6 +8,7 @@
#include <errno.h>
#include <syscon.h>
#include <asm/io.h>
#include <asm/arch/stm32mp1_smc.h>
#include <dm/device_compat.h>
#include <linux/bitops.h>
#include <linux/err.h>
@ -41,6 +42,10 @@ static int stm32mp_pwr_write(struct udevice *dev, uint reg,
if (len != 4)
return -EINVAL;
if (IS_ENABLED(CONFIG_TFABOOT))
return stm32_smc_exec(STM32_SMC_PWR, STM32_SMC_REG_WRITE,
STM32MP_PWR_CR3, val);
writel(val, priv->base + STM32MP_PWR_CR3);
return 0;

View File

@ -55,6 +55,7 @@ u32 spl_mmc_boot_mode(const u32 boot_device)
return MMCSD_MODE_RAW;
}
#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
int spl_mmc_boot_partition(const u32 boot_device)
{
switch (boot_device) {
@ -66,6 +67,7 @@ int spl_mmc_boot_partition(const u32 boot_device)
return -EINVAL;
}
}
#endif
#ifdef CONFIG_SPL_DISPLAY_PRINT
void spl_display_print(void)
@ -138,7 +140,8 @@ void board_init_f(ulong dummy)
* to avoid speculative access and issue in get_ram_size()
*/
if (!CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
mmu_set_region_dcache_behaviour(STM32_DDR_BASE, STM32_DDR_SIZE,
mmu_set_region_dcache_behaviour(STM32_DDR_BASE,
CONFIG_DDR_CACHEABLE_SIZE,
DCACHE_DEFAULT_OPTION);
}

View File

@ -8,7 +8,6 @@
#define CONFIG_NEEDS_MANUAL_RELOC
#define CONFIG_LMB
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
#endif

View File

@ -6,8 +6,6 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
#define CONFIG_LMB
#ifndef CONFIG_SPL_BUILD
#define CONFIG_NEEDS_MANUAL_RELOC
#endif

View File

@ -6,7 +6,6 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
#define CONFIG_LMB
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
#endif

View File

@ -7,6 +7,5 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
#define CONFIG_LMB
#endif

View File

@ -18,7 +18,6 @@
#define HWCONFIG_BUFFER_SIZE 256
#endif
#define CONFIG_LMB
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
#ifndef CONFIG_MAX_MEM_MAPPED

View File

@ -7,7 +7,6 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
#define CONFIG_LMB
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
#endif

View File

@ -75,7 +75,7 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst)
pmp_mem.start = addr;
pmp_mem.end = addr + size - 1;
err = fdtdec_add_reserved_memory(dst, basename, &pmp_mem,
&phandle);
&phandle, false);
if (err < 0 && err != -FDT_ERR_EXISTS) {
log_err("failed to add reserved memory: %d\n", err);
return err;

View File

@ -356,6 +356,37 @@
sandbox_firmware: sandbox-firmware {
compatible = "sandbox,firmware";
};
sandbox-scmi-agent@0 {
compatible = "sandbox,scmi-agent";
#address-cells = <1>;
#size-cells = <0>;
clk_scmi0: protocol@14 {
reg = <0x14>;
#clock-cells = <1>;
};
reset_scmi0: protocol@16 {
reg = <0x16>;
#reset-cells = <1>;
};
};
sandbox-scmi-agent@1 {
compatible = "sandbox,scmi-agent";
#address-cells = <1>;
#size-cells = <0>;
clk_scmi1: protocol@14 {
reg = <0x14>;
#clock-cells = <1>;
};
protocol@10 {
reg = <0x10>;
};
};
};
pinctrl-gpio {
@ -1036,6 +1067,12 @@
compatible = "sandbox,virtio2";
};
sandbox_scmi {
compatible = "sandbox,scmi-devices";
clocks = <&clk_scmi0 7>, <&clk_scmi0 3>, <&clk_scmi1 1>;
resets = <&reset_scmi0 3>;
};
pinctrl {
compatible = "sandbox,pinctrl";

View File

@ -0,0 +1,99 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2020, Linaro Limited
*/
#ifndef __SANDBOX_SCMI_TEST_H
#define __SANDBOX_SCMI_TEST_H
struct udevice;
struct sandbox_scmi_agent;
struct sandbox_scmi_service;
/**
* struct sandbox_scmi_clk - Simulated clock exposed by SCMI
* @id: Identifier of the clock used in the SCMI protocol
* @enabled: Clock state: true if enabled, false if disabled
* @rate: Clock rate in Hertz
*/
struct sandbox_scmi_clk {
uint id;
bool enabled;
ulong rate;
};
/**
* struct sandbox_scmi_reset - Simulated reset controller exposed by SCMI
* @asserted: Reset control state: true if asserted, false if desasserted
*/
struct sandbox_scmi_reset {
uint id;
bool asserted;
};
/**
* struct sandbox_scmi_agent - Simulated SCMI service seen by SCMI agent
* @idx: Identifier for the SCMI agent, its index
* @clk: Simulated clocks
* @clk_count: Simulated clocks array size
* @clk: Simulated reset domains
* @clk_count: Simulated reset domains array size
*/
struct sandbox_scmi_agent {
uint idx;
struct sandbox_scmi_clk *clk;
size_t clk_count;
struct sandbox_scmi_reset *reset;
size_t reset_count;
};
/**
* struct sandbox_scmi_service - Reference to simutaed SCMI agents/services
* @agent: Pointer to SCMI sandbox agent pointers array
* @agent_count: Number of emulated agents exposed in array @agent.
*/
struct sandbox_scmi_service {
struct sandbox_scmi_agent **agent;
size_t agent_count;
};
/**
* struct sandbox_scmi_devices - Reference to devices probed through SCMI
* @clk: Array the clock devices
* @clk_count: Number of clock devices probed
* @reset: Array the reset controller devices
* @reset_count: Number of reset controller devices probed
*/
struct sandbox_scmi_devices {
struct clk *clk;
size_t clk_count;
struct reset_ctl *reset;
size_t reset_count;
};
#ifdef CONFIG_SCMI_FIRMWARE
/**
* sandbox_scmi_service_context - Get the simulated SCMI services context
* @return: Reference to backend simulated resources state
*/
struct sandbox_scmi_service *sandbox_scmi_service_ctx(void);
/**
* sandbox_scmi_devices_get_ref - Get references to devices accessed through SCMI
* @dev: Reference to the test device used get test resources
* @return: Reference to the devices probed by the SCMI test
*/
struct sandbox_scmi_devices *sandbox_scmi_devices_ctx(struct udevice *dev);
#else
static inline struct sandbox_scmi_service *sandbox_scmi_service_ctx(void)
{
return NULL;
}
static inline
struct sandbox_scmi_devices *sandbox_scmi_devices_ctx(struct udevice *dev)
{
return NULL;
}
#endif /* CONFIG_SCMI_FIRMWARE */
#endif /* __SANDBOX_SCMI_TEST_H */

View File

@ -8,8 +8,6 @@
#include <asm/processor.h>
#define CONFIG_LMB
/* Timer */
#define CONFIG_SYS_TIMER_COUNTS_DOWN
#define CONFIG_SYS_TIMER_COUNTER (TMU_BASE + 0xc) /* TCNT0 */

View File

@ -6,7 +6,6 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
#define CONFIG_LMB
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
#endif

View File

@ -9,8 +9,6 @@
#include <asm/arch/core.h>
#define CONFIG_LMB
/*
* Make boot parameters available in the MMUv2 virtual memory layout by
* restricting used physical memory to the first 128MB.

View File

@ -8,18 +8,22 @@ config CMD_STBOARD
config MTDPARTS_NAND0_BOOT
string "mtd boot partitions for nand0"
default "2m(fsbl),2m(ssbl1),2m(ssbl2)"
default "2m(fsbl),2m(ssbl1),2m(ssbl2)" if STM32MP15x_STM32IMAGE || \
!TFABOOT
default "2m(fsbl),4m(fip1),4m(fip2)"
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.
The fsbl partition support multiple copy of the same binary, one by
erase block.
config MTDPARTS_NAND0_TEE
string "mtd tee partitions for nand0"
default "512k(teeh),512k(teed),512k(teex)"
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP && STM32MP15x_STM32IMAGE
help
This define the tee partitions added in mtparts dynamically
when tee is supported with boot from nand0.
@ -28,7 +32,9 @@ config MTDPARTS_NAND0_TEE
config MTDPARTS_NOR0_BOOT
string "mtd boot partitions for nor0"
default "256k(fsbl1),256k(fsbl2),2m(ssbl),512k(u-boot-env)"
default "256k(fsbl1),256k(fsbl2),2m(ssbl),512k(u-boot-env)" if STM32MP15x_STM32IMAGE || \
!TFABOOT
default "256k(fsbl1),256k(fsbl2),4m(fip),512k(u-boot-env)"
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
help
This define the partitions of nand0 used to build mtparts dynamically
@ -40,24 +46,27 @@ config MTDPARTS_NOR0_BOOT
config MTDPARTS_NOR0_TEE
string "mtd tee partitions for nor0"
default "256k(teeh),512k(teed),256k(teex)"
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP && STM32MP15x_STM32IMAGE
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)"
default "2m(fsbl),2m(ssbl1),2m(ssbl2)" if STM32MP15x_STM32IMAGE || !TFABOOT
default "2m(fsbl),4m(fip1),4m(fip2)"
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.
The fsbl partition support multiple copy of the same binary, one by
erase block.
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
depends on SYS_MTDPARTS_RUNTIME && ARCH_STM32MP && STM32MP15x_STM32IMAGE
help
This define the tee partitions added in mtparts dynamically
when tee is supported with boot from spi-nand0,

View File

@ -142,7 +142,8 @@ void set_dfu_alt_info(char *interface, char *devstr)
board_get_alt_info_mtd(mtd, buf);
}
if (IS_ENABLED(CONFIG_DFU_VIRT)) {
if (IS_ENABLED(CONFIG_DFU_VIRT) &&
IS_ENABLED(CMD_STM32PROG_USB)) {
strncat(buf, "&virt 0=OTP", DFU_ALT_BUF_LEN);
if (IS_ENABLED(CONFIG_PMIC_STPMIC1))
@ -216,7 +217,7 @@ int dfu_read_medium_virt(struct dfu_entity *dfu, u64 offset,
return dfu_pmic_read(offset, buf, len);
}
if (CONFIG_IS_ENABLED(CMD_STM32PROG) &&
if (IS_ENABLED(CONFIG_CMD_STM32PROG_USB) &&
dfu->data.virt.dev_num >= STM32PROG_VIRT_FIRST_DEV_NUM)
return stm32prog_read_medium_virt(dfu, offset, buf, len);
@ -227,7 +228,7 @@ int dfu_read_medium_virt(struct dfu_entity *dfu, u64 offset,
int dfu_write_medium_virt(struct dfu_entity *dfu, u64 offset,
void *buf, long *len)
{
if (CONFIG_IS_ENABLED(CMD_STM32PROG) &&
if (IS_ENABLED(CONFIG_CMD_STM32PROG_USB) &&
dfu->data.virt.dev_num >= STM32PROG_VIRT_FIRST_DEV_NUM)
return stm32prog_write_medium_virt(dfu, offset, buf, len);
@ -236,7 +237,7 @@ int dfu_write_medium_virt(struct dfu_entity *dfu, u64 offset,
int __weak dfu_get_medium_size_virt(struct dfu_entity *dfu, u64 *size)
{
if (CONFIG_IS_ENABLED(CMD_STM32PROG) &&
if (IS_ENABLED(CONFIG_CMD_STM32PROG_USB) &&
dfu->data.virt.dev_num >= STM32PROG_VIRT_FIRST_DEV_NUM)
return stm32prog_get_medium_size_virt(dfu, size);

View File

@ -10,7 +10,9 @@
#include <env_internal.h>
#include <mtd.h>
#include <mtd_node.h>
#ifdef CONFIG_STM32MP15x_STM32IMAGE
#include <tee.h>
#endif
#include <asm/arch/stm32prog.h>
#include <asm/arch/sys_proto.h>
@ -29,7 +31,9 @@ static void board_set_mtdparts(const char *dev,
char *mtdids,
char *mtdparts,
const char *boot,
#ifdef CONFIG_STM32MP15x_STM32IMAGE
const char *tee,
#endif
const char *user)
{
/* mtdids: "<dev>=<dev>, ...." */
@ -53,10 +57,12 @@ static void board_set_mtdparts(const char *dev,
strncat(mtdparts, ",", MTDPARTS_LEN);
}
#ifdef CONFIG_STM32MP15x_STM32IMAGE
if (tee) {
strncat(mtdparts, tee, MTDPARTS_LEN);
strncat(mtdparts, ",", MTDPARTS_LEN);
}
#endif
strncat(mtdparts, user, MTDPARTS_LEN);
}
@ -68,7 +74,10 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
static char parts[3 * MTDPARTS_LEN + 1];
static char ids[MTDIDS_LEN + 1];
static bool mtd_initialized;
bool tee, nor, nand, spinand, serial;
bool nor, nand, spinand, serial;
#ifdef CONFIG_STM32MP15x_STM32IMAGE
bool tee = false;
#endif
if (mtd_initialized) {
*mtdids = ids;
@ -76,7 +85,6 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
return;
}
tee = false;
nor = false;
nand = false;
spinand = false;
@ -87,7 +95,9 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
case BOOT_SERIAL_USB:
serial = true;
if (CONFIG_IS_ENABLED(CMD_STM32PROG)) {
#ifdef CONFIG_STM32MP15x_STM32IMAGE
tee = stm32prog_get_tee_partitions();
#endif
nor = stm32prog_get_fsbl_nor();
}
nand = true;
@ -106,9 +116,11 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
break;
}
#ifdef CONFIG_STM32MP15x_STM32IMAGE
if (!serial && CONFIG_IS_ENABLED(OPTEE) &&
tee_find_device(NULL, NULL, NULL, NULL))
tee = true;
#endif
memset(parts, 0, sizeof(parts));
memset(ids, 0, sizeof(ids));
@ -120,29 +132,27 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
pr_debug("mtd device = %s\n", dev->name);
}
if (nor || nand) {
if (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,
CONFIG_MTDPARTS_NAND0_BOOT,
#ifdef CONFIG_STM32MP15x_STM32IMAGE
!nor && tee ? CONFIG_MTDPARTS_NAND0_TEE : NULL,
#endif
"-(UBI)");
put_mtd_device(mtd);
}
}
if (nor || spinand) {
if (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,
CONFIG_MTDPARTS_SPINAND0_BOOT,
#ifdef CONFIG_STM32MP15x_STM32IMAGE
!nor && tee ? CONFIG_MTDPARTS_SPINAND0_TEE : NULL,
#endif
"-(UBI)");
put_mtd_device(mtd);
}
@ -150,12 +160,11 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
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,
CONFIG_MTDPARTS_NOR0_BOOT,
#ifdef CONFIG_STM32MP15x_STM32IMAGE
tee ? CONFIG_MTDPARTS_NOR0_TEE : NULL,
#endif
"-(nor_user)");
}
}

View File

@ -1,6 +1,20 @@
/*
* Compilation:
* mkimage -f fit_copro_kernel_dtb.its fit_copro_kernel_dtb.itb
*
* M4 firmware to load with remoteproc: rproc-m4-fw.elf
*
* Files in linux build dir:
* - arch/arm/boot/zImage
* - arch/arm/boot/dts/stm32mp157c-dk2.dtb
* - arch/arm/boot/dts/stm32mp157c-ev1.dtb
*
* load mmc 0:4 $kernel_addr_r fit_copro_kernel_dtb.itb
* bootm $kernel_addr_r
* bootm $kernel_addr_r#dk2
* bootm $kernel_addr_r#ev1
* bootm $kernel_addr_r#dk2-m4
* bootm $kernel_addr_r#ev1-m4
*/
/dts-v1/;
@ -29,8 +43,8 @@
arch = "arm";
os = "linux";
compression = "none";
load = <0xC0008000>;
entry = <0xC0008000>;
load = <0xC4000000>;
entry = <0xC4000000>;
hash-1 {
algo = "sha1";
};

View File

@ -3,7 +3,7 @@
* mkimage -f fit_kernel_dtb.its fit_kernel_dtb.itb
*
* Files in linux build dir:
* - arch/arm/boot/zImage
* - arch/arm/boot/Image (gzipped in Image.gz)
* - arch/arm/boot/dts/stm32mp157c-dk2.dtb
* - arch/arm/boot/dts/stm32mp157c-ev1.dtb
*
@ -23,11 +23,11 @@
images {
kernel {
description = "Linux kernel";
data = /incbin/("zImage");
data = /incbin/("Image.gz");
type = "kernel";
arch = "arm";
os = "linux";
compression = "none";
compression = "gzip";
load = <0xC0008000>;
entry = <0xC0008000>;
hash-1 {

View File

@ -101,7 +101,9 @@ int checkboard(void)
const char *fdt_compat;
int fdt_compat_len;
if (IS_ENABLED(CONFIG_TFABOOT))
if (IS_ENABLED(CONFIG_STM32MP15x_STM32IMAGE))
mode = "trusted - stm32image";
else if (IS_ENABLED(CONFIG_TFABOOT))
mode = "trusted";
else
mode = "basic";
@ -288,42 +290,13 @@ static void __maybe_unused led_error_blink(u32 nb_blink)
hang();
}
static int board_check_usb_power(void)
static int adc_measurement(ofnode node, int adc_count, int *min_uV, int *max_uV)
{
struct ofnode_phandle_args adc_args;
struct udevice *adc;
ofnode node;
unsigned int raw;
int max_uV = 0;
int min_uV = USB_START_HIGH_THRESHOLD_UV;
int ret, uV, adc_count;
u32 nb_blink;
u8 i;
if (!IS_ENABLED(CONFIG_ADC))
return -ENODEV;
node = ofnode_path("/config");
if (!ofnode_valid(node)) {
debug("%s: no /config node?\n", __func__);
return -ENOENT;
}
/*
* Retrieve the ADC channels devices and get measurement
* for each of them
*/
adc_count = ofnode_count_phandle_with_args(node, "st,adc_usb_pd",
"#io-channel-cells");
if (adc_count < 0) {
if (adc_count == -ENOENT)
return 0;
pr_err("%s: can't find adc channel (%d)\n", __func__,
adc_count);
return adc_count;
}
int ret, uV;
int i;
for (i = 0; i < adc_count; i++) {
if (ofnode_parse_phandle_with_args(node, "st,adc_usb_pd",
@ -352,10 +325,10 @@ static int board_check_usb_power(void)
}
/* Convert to uV */
if (!adc_raw_to_uV(adc, raw, &uV)) {
if (uV > max_uV)
max_uV = uV;
if (uV < min_uV)
min_uV = uV;
if (uV > *max_uV)
*max_uV = uV;
if (uV < *min_uV)
*min_uV = uV;
pr_debug("%s: %s[%02d] = %u, %d uV\n", __func__,
adc->name, adc_args.args[0], raw, uV);
} else {
@ -364,18 +337,66 @@ static int board_check_usb_power(void)
}
}
return 0;
}
static int board_check_usb_power(void)
{
ofnode node;
int max_uV = 0;
int min_uV = USB_START_HIGH_THRESHOLD_UV;
int adc_count, ret;
u32 nb_blink;
u8 i;
if (!IS_ENABLED(CONFIG_ADC))
return -ENODEV;
node = ofnode_path("/config");
if (!ofnode_valid(node)) {
debug("%s: no /config node?\n", __func__);
return -ENOENT;
}
/*
* If highest value is inside 1.23 Volts and 2.10 Volts, that means
* board is plugged on an USB-C 3A power supply and boot process can
* continue.
* Retrieve the ADC channels devices and get measurement
* for each of them
*/
if (max_uV > USB_START_LOW_THRESHOLD_UV &&
max_uV <= USB_START_HIGH_THRESHOLD_UV &&
min_uV <= USB_LOW_THRESHOLD_UV)
return 0;
adc_count = ofnode_count_phandle_with_args(node, "st,adc_usb_pd",
"#io-channel-cells");
if (adc_count < 0) {
if (adc_count == -ENOENT)
return 0;
pr_err("%s: can't find adc channel (%d)\n", __func__,
adc_count);
return adc_count;
}
/* perform maximum of 2 ADC measurement to detect power supply current */
for (i = 0; i < 2; i++) {
ret = adc_measurement(node, adc_count, &min_uV, &max_uV);
if (ret)
return ret;
/*
* If highest value is inside 1.23 Volts and 2.10 Volts, that means
* board is plugged on an USB-C 3A power supply and boot process can
* continue.
*/
if (max_uV > USB_START_LOW_THRESHOLD_UV &&
max_uV <= USB_START_HIGH_THRESHOLD_UV &&
min_uV <= USB_LOW_THRESHOLD_UV)
return 0;
if (i == 0) {
pr_debug("Previous ADC measurements was not the one expected, retry in 20ms\n");
mdelay(20); /* equal to max tPDDebounce duration (min 10ms - max 20ms) */
}
}
pr_err("****************************************************\n");
/*
* If highest and lowest value are either both below
* USB_LOW_THRESHOLD_UV or both above USB_LOW_THRESHOLD_UV, that
@ -583,7 +604,8 @@ error:
static bool board_is_dk2(void)
{
if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) &&
of_machine_is_compatible("st,stm32mp157c-dk2"))
(of_machine_is_compatible("st,stm32mp157c-dk2") ||
of_machine_is_compatible("st,stm32mp157f-dk2")))
return true;
return false;
@ -832,10 +854,17 @@ const char *env_ext4_get_dev_part(void)
return dev_part[(bootmode & TAMP_BOOT_INSTANCE_MASK) - 1];
}
int mmc_get_env_dev(void)
{
u32 bootmode = get_bootmode();
u32 bootmode;
if (CONFIG_SYS_MMC_ENV_DEV >= 0)
return CONFIG_SYS_MMC_ENV_DEV;
bootmode = get_bootmode();
/* use boot instance to select the correct mmc device identifier */
return (bootmode & TAMP_BOOT_INSTANCE_MASK) - 1;
}
@ -848,9 +877,14 @@ int ft_board_setup(void *blob, struct bd_info *bd)
{ "st,stm32mp15-fmc2", MTD_DEV_TYPE_NAND, },
{ "st,stm32mp1-fmc2-nfc", MTD_DEV_TYPE_NAND, },
};
char *boot_device;
if (IS_ENABLED(CONFIG_FDT_FIXUP_PARTITIONS))
fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
/* Check the boot-source and don't update MTD for serial or usb boot */
boot_device = env_get("boot_device");
if (!boot_device ||
(strcmp(boot_device, "serial") && strcmp(boot_device, "usb")))
if (IS_ENABLED(CONFIG_FDT_FIXUP_PARTITIONS))
fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
return 0;
}

View File

@ -416,7 +416,7 @@ config USE_PREBOOT
config PREBOOT
string "preboot default value"
depends on USE_PREBOOT && !USE_DEFAULT_ENV_FILE
default "usb start" if USB_KEYBOARD || USB_STORAGE
default "usb start" if USB_KEYBOARD
default ""
help
This is the default of "preboot" environment variable.

View File

@ -15,6 +15,12 @@
#include <time.h>
#include <watchdog.h>
#ifdef CONFIG_SPL_BUILD
#undef CONFIG_CMDLINE_EDITING
#undef CONFIG_AUTO_COMPLETE
#undef CONFIG_SHOW_ACTIVITY
#endif
DECLARE_GLOBAL_DATA_PTR;
static const char erase_seq[] = "\b \b"; /* erase sequence */

View File

@ -74,18 +74,20 @@ static const image_header_t *image_get_fdt(ulong fdt_addr)
#endif
static void boot_fdt_reserve_region(struct lmb *lmb, uint64_t addr,
uint64_t size)
uint64_t size, enum lmb_flags flags)
{
long ret;
ret = lmb_reserve(lmb, addr, size);
ret = lmb_reserve_flags(lmb, addr, size, flags);
if (ret >= 0) {
debug(" reserving fdt memory region: addr=%llx size=%llx\n",
(unsigned long long)addr, (unsigned long long)size);
debug(" reserving fdt memory region: addr=%llx size=%llx flags=%x\n",
(unsigned long long)addr,
(unsigned long long)size, flags);
} else {
puts("ERROR: reserving fdt memory region failed ");
printf("(addr=%llx size=%llx)\n",
(unsigned long long)addr, (unsigned long long)size);
printf("(addr=%llx size=%llx flags=%x)\n",
(unsigned long long)addr,
(unsigned long long)size, flags);
}
}
@ -105,6 +107,7 @@ void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob)
int i, total, ret;
int nodeoffset, subnode;
struct fdt_resource res;
enum lmb_flags flags;
if (fdt_check_header(fdt_blob) != 0)
return;
@ -114,7 +117,7 @@ void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob)
for (i = 0; i < total; i++) {
if (fdt_get_mem_rsv(fdt_blob, i, &addr, &size) != 0)
continue;
boot_fdt_reserve_region(lmb, addr, size);
boot_fdt_reserve_region(lmb, addr, size, LMB_NONE);
}
/* process reserved-memory */
@ -126,9 +129,13 @@ void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob)
ret = fdt_get_resource(fdt_blob, subnode, "reg", 0,
&res);
if (!ret && fdtdec_get_is_enabled(fdt_blob, subnode)) {
flags = LMB_NONE;
if (fdtdec_get_bool(fdt_blob, subnode,
"no-map"))
flags = LMB_NOMAP;
addr = res.start;
size = res.end - res.start + 1;
boot_fdt_reserve_region(lmb, addr, size);
boot_fdt_reserve_region(lmb, addr, size, flags);
}
subnode = fdt_next_subnode(fdt_blob, subnode);

View File

@ -122,6 +122,7 @@ CONFIG_BUTTON=y
CONFIG_BUTTON_GPIO=y
CONFIG_CLK=y
CONFIG_CLK_COMPOSITE_CCF=y
CONFIG_CLK_SCMI=y
CONFIG_SANDBOX_CLK_CCF=y
CONFIG_CPU=y
CONFIG_DM_DEMO=y
@ -132,6 +133,8 @@ CONFIG_BOARD_SANDBOX=y
CONFIG_DMA=y
CONFIG_DMA_CHANNELS=y
CONFIG_SANDBOX_DMA=y
CONFIG_FIRMWARE=y
CONFIG_SCMI_FIRMWARE=y
CONFIG_GPIO_HOG=y
CONFIG_DM_GPIO_LOOKUP_LABEL=y
CONFIG_PM8916_GPIO=y
@ -217,6 +220,7 @@ CONFIG_REMOTEPROC_SANDBOX=y
CONFIG_DM_RESET=y
CONFIG_SANDBOX_RESET=y
CONFIG_RESET_SYSCON=y
CONFIG_RESET_SCMI=y
CONFIG_DM_RNG=y
CONFIG_DM_RTC=y
CONFIG_RTC_RV8803=y

View File

@ -18,6 +18,7 @@ CONFIG_SPL_SPI_SUPPORT=y
CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_FIT=y
CONFIG_BOOTDELAY=1
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y
@ -31,8 +32,6 @@ CONFIG_SPL_SPI_FLASH_MTD=y
CONFIG_SYS_PROMPT="STM32MP> "
CONFIG_CMD_ADTIMG=y
# CONFIG_CMD_ELF is not set
# CONFIG_CMD_EXPORTENV is not set
# CONFIG_CMD_IMPORTENV is not set
CONFIG_CMD_ERASEENV=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MEMTEST=y
@ -69,6 +68,7 @@ CONFIG_ENV_UBI_PART="UBI"
CONFIG_ENV_UBI_VOLUME="uboot_config"
CONFIG_ENV_UBI_VOLUME_REDUND="uboot_config_r"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_SYS_MMC_ENV_DEV=-1
# CONFIG_SPL_ENV_IS_NOWHERE is not set
# CONFIG_SPL_ENV_IS_IN_SPI_FLASH is not set
CONFIG_STM32_ADC=y
@ -121,6 +121,7 @@ CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_REGULATOR_STM32_VREFBUF=y
CONFIG_DM_REGULATOR_STPMIC1=y
CONFIG_STM32MP1_DDR_INTERACTIVE=y
CONFIG_REMOTEPROC_STM32_COPRO=y
CONFIG_DM_RNG=y
CONFIG_RNG_STM32MP1=y
@ -153,3 +154,4 @@ CONFIG_WDT=y
CONFIG_WDT_STM32MP=y
CONFIG_ERRNO_STR=y
CONFIG_FDT_FIXUP_PARTITIONS=y
CONFIG_LMB_RESERVED_REGIONS=16

View File

@ -17,6 +17,7 @@ CONFIG_FIT=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_SPL_FIT_SOURCE="board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its"
# CONFIG_USE_SPL_FIT_GENERATOR is not set
CONFIG_BOOTDELAY=1
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_SPL_LEGACY_IMAGE_SUPPORT=y

View File

@ -17,6 +17,7 @@ CONFIG_FIT=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_SPL_FIT_SOURCE="board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its"
# CONFIG_USE_SPL_FIT_GENERATOR is not set
CONFIG_BOOTDELAY=1
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_SPL_LEGACY_IMAGE_SUPPORT=y

View File

@ -2,21 +2,20 @@ CONFIG_ARM=y
CONFIG_ARCH_STM32MP=y
CONFIG_TFABOOT=y
CONFIG_SYS_MALLOC_F_LEN=0x3000
CONFIG_ENV_OFFSET=0x280000
CONFIG_ENV_OFFSET=0x480000
CONFIG_ENV_SECT_SIZE=0x40000
CONFIG_TARGET_ST_STM32MP15x=y
CONFIG_CMD_STM32PROG=y
CONFIG_TYPEC_STUSB160X=y
CONFIG_ENV_OFFSET_REDUND=0x2C0000
CONFIG_ENV_OFFSET_REDUND=0x4C0000
CONFIG_DEFAULT_DEVICE_TREE="stm32mp157c-ev1"
CONFIG_DISTRO_DEFAULTS=y
CONFIG_FIT=y
CONFIG_BOOTDELAY=1
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
CONFIG_SYS_PROMPT="STM32MP> "
CONFIG_CMD_ADTIMG=y
# CONFIG_CMD_ELF is not set
# CONFIG_CMD_EXPORTENV is not set
# CONFIG_CMD_IMPORTENV is not set
CONFIG_CMD_ERASEENV=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MEMTEST=y
@ -51,7 +50,9 @@ CONFIG_ENV_UBI_PART="UBI"
CONFIG_ENV_UBI_VOLUME="uboot_config"
CONFIG_ENV_UBI_VOLUME_REDUND="uboot_config_r"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_SYS_MMC_ENV_DEV=-1
CONFIG_STM32_ADC=y
CONFIG_CLK_SCMI=y
CONFIG_SET_DFU_ALT_INFO=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
@ -99,7 +100,9 @@ CONFIG_DM_REGULATOR_FIXED=y
CONFIG_DM_REGULATOR_GPIO=y
CONFIG_DM_REGULATOR_STM32_VREFBUF=y
CONFIG_DM_REGULATOR_STPMIC1=y
CONFIG_REMOTEPROC_OPTEE=y
CONFIG_REMOTEPROC_STM32_COPRO=y
CONFIG_RESET_SCMI=y
CONFIG_DM_RNG=y
CONFIG_RNG_STM32MP1=y
CONFIG_DM_RTC=y
@ -134,3 +137,4 @@ CONFIG_WDT=y
CONFIG_WDT_STM32MP=y
CONFIG_ERRNO_STR=y
CONFIG_FDT_FIXUP_PARTITIONS=y
CONFIG_LMB_RESERVED_REGIONS=16

View File

@ -52,15 +52,23 @@ And the necessary drivers
Currently the following boards are supported:
+ stm32mp157a-dk1.dts
+ stm32mp157a-ed1.dts
+ stm32mp157a-ev1.dts
+ stm32mp157c-dk2.dts
+ stm32mp157c-ed1.dts
+ stm32mp157c-ev1.dts
+ stm32mp157d-dk1.dts
+ stm32mp157d-ed1.dts
+ stm32mp157d-ev1.dts
+ stm32mp157f-dk2.dts
+ stm32mp157f-ed1.dts
+ stm32mp157f-ev1.dts
+ stm32mp15xx-dhcor-avenger96.dts
Boot Sequences
--------------
3 boot configurations are supported with:
2 boot configurations are supported with:
+----------+------------------------+-------------------------+--------------+
| **ROM** | **FSBL** | **SSBL** | **OS** |
@ -83,14 +91,10 @@ defconfig_file : stm32mp15_trusted_defconfig
| TrustZone |secure monitor |
+-------------+-------------------------+------------+-------+
TF-A performs a full initialization of Secure peripherals and installs a
secure monitor, BL32:
* SPMin provided by TF-A or
* OP-TEE from specific partitions (teeh, teed, teex).
U-Boot is running in normal world and uses the secure monitor to access
to secure resources.
TF-A (BL2) initialize the DDR and loads the next stage binaries from a FIP file:
+ BL32: a secure monitor BL32 = SPMin provided by TF-A or OP-TEE : performs a full initialization of Secure peripherals and provides service to normal world
+ BL33: a non-trusted firmware = U-Boot, running in normal world and uses the secure monitor to access to secure resources.
+ HW_CONFIG: The hardware configuration file = the U-Boot device tree
The **Basic** boot chain
````````````````````````
@ -123,19 +127,27 @@ the supported device trees for STM32MP15x are:
+ ev1: eval board with pmic stpmic1 (ev1 = mother board + daughter ed1)
+ stm32mp157a-ev1
+ stm32mp157c-ev1
+ stm32mp157d-ev1
+ stm32mp157f-ev1
+ ed1: daughter board with pmic stpmic1
+ stm32mp157a-ed1
+ stm32mp157c-ed1
+ stm32mp157d-ed1
+ stm32mp157f-ed1
+ dk1: Discovery board
+ stm32mp157a-dk1
+ stm32mp157d-dk1
+ dk2: Discovery board = dk1 with a BT/WiFI combo and a DSI panel
+ stm32mp157c-dk2
+ stm32mp157f-dk2
+ avenger96: Avenger96 board from Arrow Electronics based on DH Elec. DHCOR SoM
@ -223,16 +235,24 @@ Build Procedure
6. Output files
BootRom and TF-A expect binaries with STM32 image header
SPL expects file with U-Boot uImage header
The ROM code expects FSBL binaries with STM32 image header.
TF-A expect a FIP binary, with OS monitor (SPmin or OP-TEE) and with U-Boot binary + device tree.
SPL expects file with U-Boot uImage header.
So in the output directory (selected by KBUILD_OUTPUT),
you can found the needed files:
- For **Trusted** boot (with or without OP-TEE)
- FSBL = **tf-a.stm32** (provided by TF-A compilation)
- SSBL = **u-boot.stm32**
- FSBL = **tf-a.stm32** and **tf-a-fip.bin** (provided by TF-A compilation)
- SSBL = **u-boot-nodtb.bin** and **u-boot.dtb**
The file tf-a-fip.bin includes the 2 U-Boot files, u-boot-nodtb.bin and u-boot.dtb;
they are needed during the TF-A compilation(BL33=u-boot-nodtb.bin BL33_CFG=u-boot.dtb).
You can also update a existing it with the tools provided by TF-A:
# fiptool update --nt-fw u-boot-nodtb.bin --hw-config u-boot.dtb tf-a-fip-stm32mp157c-ev1.bin
- For Basic boot
@ -298,22 +318,24 @@ Prepare an SD card
The minimal requirements for STMP32MP15x boot up to U-Boot are:
- GPT partitioning (with gdisk or with sgdisk)
- 2 fsbl partitions, named fsbl1 and fsbl2, size at least 256KiB
- one ssbl partition for U-Boot
- 2 fsbl partitions, named "fsbl1" and "fsbl2", size at least 256KiB
- one partition named "fip" for FIP or U-Boot (TF-A search the "fip"
partition and SPL search the 3th partition, because
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=3)
Then the minimal GPT partition is:
+-------+--------+---------+-------------+
| *Num* | *Name* | *Size* | *Content* |
+=======+========+=========+=============+
| 1 | fsbl1 | 256 KiB | TF-A or SPL |
+-------+--------+---------+-------------+
| 2 | fsbl2 | 256 KiB | TF-A or SPL |
+-------+--------+---------+-------------+
| 3 | ssbl | enought | U-Boot |
+-------+--------+---------+-------------+
| 4 | <any> | <any> | Rootfs |
+-------+--------+---------+-------------+
+-------+--------+---------+------------------------------+
| *Num* | *Name* | *Size* | *Content* |
+=======+========+=========+==============================+
| 1 | fsbl1 | 256 KiB | TF-A BL2 (tf-a.stm32) or SPL |
+-------+--------+---------+------------------------------+
| 2 | fsbl2 | 256 KiB | TF-A BL2 (tf-a.stm32) or SPL |
+-------+--------+---------+------------------------------+
| 3 | fip | enought | tf-a-fip.bin or u-boot.img |
+-------+--------+---------+------------------------------+
| 4 | <any> | <any> | Rootfs |
+-------+--------+---------+------------------------------+
Add a 4th partition (Rootfs) marked bootable with a file extlinux.conf
following the Generic Distribution feature (doc/README.distro for use).
@ -334,7 +356,7 @@ b) create minimal image::
# sgdisk --resize-table=128 -a 1 \
-n 1:34:545 -c 1:fsbl1 \
-n 2:546:1057 -c 2:fsbl2 \
-n 3:1058:5153 -c 3:ssbl \
-n 3:1058:5153 -c 3:fip \
-n 4:5154: -c 4:rootfs \
-p /dev/<SD card dev>
@ -353,7 +375,7 @@ c) copy the FSBL (2 times) and SSBL file on the correct partition.
# dd if=tf-a.stm32 of=/dev/mmcblk0p1
# dd if=tf-a.stm32 of=/dev/mmcblk0p2
# dd if=u-boot.stm32 of=/dev/mmcblk0p3
# dd if=tf-a-fip.bin of=/dev/mmcblk0p3
To boot from SD card, select BootPinMode = 1 0 1 and reset.
@ -363,8 +385,8 @@ Prepare eMMC
You can use U-Boot to copy binary in eMMC.
In the next example, you need to boot from SD card and the images
(u-boot-spl.stm32, u-boot.img) are presents on SD card (mmc 0)
in ext4 partition 4 (bootfs).
(tf-a.stm32, tf-a-fip.bin / u-boot-spl.stm32, u-boot.img) are presents
on SD card (mmc 0) in ext4 partition 4 (bootfs).
To boot from SD card, select BootPinMode = 1 0 1 and reset.
@ -373,13 +395,16 @@ Then you update the eMMC with the next U-Boot command :
a) prepare GPT on eMMC,
example with 2 partitions, bootfs and roots::
# setenv emmc_part "name=ssbl,size=2MiB;name=bootfs,type=linux,bootable,size=64MiB;name=rootfs,type=linux,size=512"
# setenv emmc_part "name=fip,size=2MiB;name=bootfs,type=linux,bootable,size=64MiB;name=rootfs,type=linux,size=512"
# gpt write mmc 1 ${emmc_part}
b) copy SPL on eMMC on firts boot partition
(SPL max size is 256kB, with LBA 512, 0x200)::
# ext4load mmc 0:4 0xC0000000 tf-a.stm32
or
# ext4load mmc 0:4 0xC0000000 u-boot-spl.stm32
# mmc dev 1
# mmc partconf 1 1 1 1
# mmc write ${fileaddr} 0 200
@ -387,7 +412,10 @@ b) copy SPL on eMMC on firts boot partition
c) copy U-Boot in first GPT partition of eMMC::
# ext4load mmc 0:4 0xC0000000 u-boo t.img
# ext4load mmc 0:4 0xC0000000 tf-a-fip.bin
or
# ext4load mmc 0:4 0xC0000000 u-boot.img
# mmc dev 1
# part start mmc 1 1 partstart
# mmc write ${fileaddr} ${partstart} ${filesize}
@ -520,14 +548,14 @@ On EV1 board, booting from SD card, without OP-TEE::
dev: RAM alt: 2 name: uramdisk.image.gz layout: RAM_ADDR
dev: eMMC alt: 3 name: mmc0_fsbl1 layout: RAW_ADDR
dev: eMMC alt: 4 name: mmc0_fsbl2 layout: RAW_ADDR
dev: eMMC alt: 5 name: mmc0_ssbl layout: RAW_ADDR
dev: eMMC alt: 5 name: mmc0_fip layout: RAW_ADDR
dev: eMMC alt: 6 name: mmc0_bootfs layout: RAW_ADDR
dev: eMMC alt: 7 name: mmc0_vendorfs layout: RAW_ADDR
dev: eMMC alt: 8 name: mmc0_rootfs layout: RAW_ADDR
dev: eMMC alt: 9 name: mmc0_userfs layout: RAW_ADDR
dev: eMMC alt: 10 name: mmc1_boot1 layout: RAW_ADDR
dev: eMMC alt: 11 name: mmc1_boot2 layout: RAW_ADDR
dev: eMMC alt: 12 name: mmc1_ssbl layout: RAW_ADDR
dev: eMMC alt: 12 name: mmc1_fip layout: RAW_ADDR
dev: eMMC alt: 13 name: mmc1_bootfs layout: RAW_ADDR
dev: eMMC alt: 14 name: mmc1_vendorfs layout: RAW_ADDR
dev: eMMC alt: 15 name: mmc1_rootfs layout: RAW_ADDR
@ -548,14 +576,14 @@ All the supported device are exported for dfu-util tool::
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=15, name="mmc1_rootfs", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=14, name="mmc1_vendorfs", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=13, name="mmc1_bootfs", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=12, name="mmc1_ssbl", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=12, name="mmc1_fip", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=11, name="mmc1_boot2", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=10, name="mmc1_boot1", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=9, name="mmc0_userfs", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=8, name="mmc0_rootfs", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=7, name="mmc0_vendorfs", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=6, name="mmc0_bootfs", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=5, name="mmc0_ssbl", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=5, name="mmc0_fip", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=4, name="mmc0_fsbl2", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=3, name="mmc0_fsbl1", serial="002700333338511934383330"
Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=2, name="uramdisk.image.gz", serial="002700333338511934383330"
@ -566,9 +594,9 @@ You can update the boot device:
- SD card (mmc0) ::
$> dfu-util -d 0483:5720 -a 3 -D tf-a-stm32mp157c-ev1-trusted.stm32
$> dfu-util -d 0483:5720 -a 4 -D tf-a-stm32mp157c-ev1-trusted.stm32
$> dfu-util -d 0483:5720 -a 5 -D u-boot-stm32mp157c-ev1-trusted.img
$> dfu-util -d 0483:5720 -a 3 -D tf-a-stm32mp157c-ev1.stm32
$> dfu-util -d 0483:5720 -a 4 -D tf-a-stm32mp157c-ev1.stm32
$> dfu-util -d 0483:5720 -a 5 -D tf-a-fip-stm32mp157c-ev1.bin
$> dfu-util -d 0483:5720 -a 6 -D st-image-bootfs-openstlinux-weston-stm32mp1.ext4
$> dfu-util -d 0483:5720 -a 7 -D st-image-vendorfs-openstlinux-weston-stm32mp1.ext4
$> dfu-util -d 0483:5720 -a 8 -D st-image-weston-openstlinux-weston-stm32mp1.ext4
@ -576,9 +604,9 @@ You can update the boot device:
- EMMC (mmc1)::
$> dfu-util -d 0483:5720 -a 10 -D tf-a-stm32mp157c-ev1-trusted.stm32
$> dfu-util -d 0483:5720 -a 11 -D tf-a-stm32mp157c-ev1-trusted.stm32
$> dfu-util -d 0483:5720 -a 12 -D u-boot-stm32mp157c-ev1-trusted.img
$> dfu-util -d 0483:5720 -a 10 -D tf-a-stm32mp157c-ev1.stm32
$> dfu-util -d 0483:5720 -a 11 -D tf-a-stm32mp157c-ev1.stm32
$> dfu-util -d 0483:5720 -a 12 -D tf-a-fip-stm32mp157c-ev1.bin
$> dfu-util -d 0483:5720 -a 13 -D st-image-bootfs-openstlinux-weston-stm32mp1.ext4
$> dfu-util -d 0483:5720 -a 14 -D st-image-vendorfs-openstlinux-weston-stm32mp1.ext4
$> dfu-util -d 0483:5720 -a 15 -D st-image-weston-openstlinux-weston-stm32mp1.ext4
@ -595,14 +623,14 @@ only the MTD partition on the boot devices are available, for example:
- NOR (nor0 = alt 20) & NAND (nand0 = alt 26) ::
$> dfu-util -d 0483:5720 -a 21 -D tf-a-stm32mp157c-ev1-trusted.stm32
$> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1-trusted.stm32
$> dfu-util -d 0483:5720 -a 23 -D u-boot-stm32mp157c-ev1-trusted.img
$> dfu-util -d 0483:5720 -a 21 -D tf-a-stm32mp157c-ev1.stm32
$> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1.stm32
$> dfu-util -d 0483:5720 -a 23 -D tf-a-fip-stm32mp157c-ev1.bin
$> dfu-util -d 0483:5720 -a 27 -D st-image-weston-openstlinux-weston-stm32mp1_nand_4_256_multivolume.ubi
- NAND (nand0 = alt 21)::
$> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1-trusted.stm32
$> dfu-util -d 0483:5720 -a 23 -D u-boot-stm32mp157c-ev1-trusted.img
$> dfu-util -d 0483:5720 -a 24 -D u-boot-stm32mp157c-ev1-trusted.img
$> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1.stm32
$> dfu-util -d 0483:5720 -a 23 -D tf-a-fip-stm32mp157c-ev1.bin
$> dfu-util -d 0483:5720 -a 24 -D tf-a-fip-stm32mp157c-ev1.bin
$> dfu-util -d 0483:5720 -a 25 -D st-image-weston-openstlinux-weston-stm32mp1_nand_4_256_multivolume.ubi

View File

@ -0,0 +1,197 @@
System Control and Management Interface (SCMI) Message Protocol
----------------------------------------------------------
The SCMI is intended to allow agents such as OSPM to manage various functions
that are provided by the hardware platform it is running on, including power
and performance functions.
This binding is intended to define the interface the firmware implementing
the SCMI as described in ARM document number ARM DEN 0056A ("ARM System Control
and Management Interface Platform Design Document")[0] provide for OSPM in
the device tree.
Required properties:
The scmi node with the following properties shall be under the /firmware/ node.
- compatible : shall be "arm,scmi" or "arm,scmi-smc" for smc/hvc transports
- mboxes: List of phandle and mailbox channel specifiers. It should contain
exactly one or two mailboxes, one for transmitting messages("tx")
and another optional for receiving the notifications("rx") if
supported.
- shmem : List of phandle pointing to the shared memory(SHM) area as per
generic mailbox client binding.
- #address-cells : should be '1' if the device has sub-nodes, maps to
protocol identifier for a given sub-node.
- #size-cells : should be '0' as 'reg' property doesn't have any size
associated with it.
- arm,smc-id : SMC id required when using smc or hvc transports
Optional properties:
- mbox-names: shall be "tx" or "rx" depending on mboxes entries.
See Documentation/devicetree/bindings/mailbox/mailbox.txt for more details
about the generic mailbox controller and client driver bindings.
The mailbox is the only permitted method of calling the SCMI firmware.
Mailbox doorbell is used as a mechanism to alert the presence of a
messages and/or notification.
Each protocol supported shall have a sub-node with corresponding compatible
as described in the following sections. If the platform supports dedicated
communication channel for a particular protocol, the 3 properties namely:
mboxes, mbox-names and shmem shall be present in the sub-node corresponding
to that protocol.
Clock/Performance bindings for the clocks/OPPs based on SCMI Message Protocol
------------------------------------------------------------
This binding uses the common clock binding[1].
Required properties:
- #clock-cells : Should be 1. Contains the Clock ID value used by SCMI commands.
Power domain bindings for the power domains based on SCMI Message Protocol
------------------------------------------------------------
This binding for the SCMI power domain providers uses the generic power
domain binding[2].
Required properties:
- #power-domain-cells : Should be 1. Contains the device or the power
domain ID value used by SCMI commands.
Sensor bindings for the sensors based on SCMI Message Protocol
--------------------------------------------------------------
SCMI provides an API to access the various sensors on the SoC.
Required properties:
- #thermal-sensor-cells: should be set to 1. This property follows the
thermal device tree bindings[3].
Valid cell values are raw identifiers (Sensor ID)
as used by the firmware. Refer to platform details
for your implementation for the IDs to use.
Reset signal bindings for the reset domains based on SCMI Message Protocol
------------------------------------------------------------
This binding for the SCMI reset domain providers uses the generic reset
signal binding[5].
Required properties:
- #reset-cells : Should be 1. Contains the reset domain ID value used
by SCMI commands.
SRAM and Shared Memory for SCMI
-------------------------------
A small area of SRAM is reserved for SCMI communication between application
processors and SCP.
The properties should follow the generic mmio-sram description found in [4]
Each sub-node represents the reserved area for SCMI.
Required sub-node properties:
- reg : The base offset and size of the reserved area with the SRAM
- compatible : should be "arm,scmi-shmem" for Non-secure SRAM based
shared memory
[0] http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/index.html
[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
[2] Documentation/devicetree/bindings/power/power-domain.yaml
[3] Documentation/devicetree/bindings/thermal/thermal.txt
[4] Documentation/devicetree/bindings/sram/sram.yaml
[5] Documentation/devicetree/bindings/reset/reset.txt
Example:
sram@50000000 {
compatible = "mmio-sram";
reg = <0x0 0x50000000 0x0 0x10000>;
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0x0 0x50000000 0x10000>;
cpu_scp_lpri: scp-shmem@0 {
compatible = "arm,scmi-shmem";
reg = <0x0 0x200>;
};
cpu_scp_hpri: scp-shmem@200 {
compatible = "arm,scmi-shmem";
reg = <0x200 0x200>;
};
};
mailbox@40000000 {
....
#mbox-cells = <1>;
reg = <0x0 0x40000000 0x0 0x10000>;
};
firmware {
...
scmi {
compatible = "arm,scmi";
mboxes = <&mailbox 0 &mailbox 1>;
mbox-names = "tx", "rx";
shmem = <&cpu_scp_lpri &cpu_scp_hpri>;
#address-cells = <1>;
#size-cells = <0>;
scmi_devpd: protocol@11 {
reg = <0x11>;
#power-domain-cells = <1>;
};
scmi_dvfs: protocol@13 {
reg = <0x13>;
#clock-cells = <1>;
};
scmi_clk: protocol@14 {
reg = <0x14>;
#clock-cells = <1>;
};
scmi_sensors0: protocol@15 {
reg = <0x15>;
#thermal-sensor-cells = <1>;
};
scmi_reset: protocol@16 {
reg = <0x16>;
#reset-cells = <1>;
};
};
};
cpu@0 {
...
reg = <0 0>;
clocks = <&scmi_dvfs 0>;
};
hdlcd@7ff60000 {
...
reg = <0 0x7ff60000 0 0x1000>;
clocks = <&scmi_clk 4>;
power-domains = <&scmi_devpd 1>;
resets = <&scmi_reset 10>;
};
thermal-zones {
soc_thermal {
polling-delay-passive = <100>;
polling-delay = <1000>;
/* sensor ID */
thermal-sensors = <&scmi_sensors0 3>;
...
};
};

View File

@ -45,6 +45,8 @@ Required properties:
- #phy-cells: see phy-bindings.txt in the same directory, must be <0> for PHY
port#1 and must be <1> for PHY port#2, to select USB controller
Optional properties:
- vbus-supply: phandle to the regulator providing 5V vbus to the USB connector
Example:
usbphyc: usb-phy@5a006000 {

View File

@ -159,6 +159,14 @@ config CLK_CDCE9XX
Enable the clock synthesizer driver for CDCE913/925/937/949
series of chips.
config CLK_SCMI
bool "Enable SCMI clock driver"
depends on SCMI_FIRMWARE
help
Enable this option if you want to support clock devices exposed
by a SCMI agent based on SCMI clock protocol communication
with a SCMI server.
source "drivers/clk/analogbits/Kconfig"
source "drivers/clk/at91/Kconfig"
source "drivers/clk/exynos/Kconfig"

View File

@ -32,6 +32,7 @@ obj-$(CONFIG_CLK_MPC83XX) += mpc83xx_clk.o
obj-$(CONFIG_CLK_OCTEON) += clk_octeon.o
obj-$(CONFIG_CLK_OWL) += owl/
obj-$(CONFIG_CLK_RENESAS) += renesas/
obj-$(CONFIG_CLK_SCMI) += clk_scmi.o
obj-$(CONFIG_CLK_SIFIVE) += sifive/
obj-$(CONFIG_ARCH_SUNXI) += sunxi/
obj-$(CONFIG_CLK_STM32F) += clk_stm32f.o

Some files were not shown because too many files have changed in this diff Show More