Compare commits

...

182 Commits

Author SHA1 Message Date
1d1745cd1a Prepare v2020.10-stm32mp-r2.1
Update version in Makefile to prepare the label v2020.10-stm32mp-r2.1
for OpenSTLinux v3.1.1

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ia75722d17556d1d299e7262b379ebc333721b33e
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/240719
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-05-02 18:21:53 +02:00
82ca306e54 board: stm32pm1: optimize board_interface_eth_init for stm32mp1 platform
Now only one property to manage different PHY config
(RMII, RMII wo cristal 25Mhz/50Mhz etc..)
Possibility to manage several ethernet instances.
Select which instance to configure with mask.
If mask is not present in DT, it is stm32mp15 platform

Change-Id: Ia60db8aca57744d04d57d66b2e962955c672fd08
Signed-off-by: Christophe Roullier <christophe.roullier@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/179669
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>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/246397
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@foss.st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-02 18:21:40 +02:00
7b6901ccb5 net: dwc_eth_qos: add rate parameter in board_interface_eth_init
Add rate parameter in the weak function board_interface_eth_init
to provided the PHY frequency when it is used  without
crystal.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I7ef1bc9355fc36f10210751c0785795ee99503bb
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/208103
Tested-by: Christophe ROULLIER <christophe.roullier@st.com>
Reviewed-by: Christophe ROULLIER <christophe.roullier@st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/246398
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-05-02 18:16:18 +02:00
fb2deee978 pinctrl: pinctrl_stm32: Use GPIOF_UNKNOWN to indicate not mapped pins
GPIOF_UNKNOWN becomes a valid pin muxing information to indicate
that a pin is not mapped.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I659b45eae59374d82103ee15857c35b4f2bcdf75
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/239066
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/248298
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@foss.st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-02 18:16:18 +02:00
c9e312ceb1 gpio: stm32_gpio: Rework GPIO hole management
On some STM32 SoC's package, GPIO bank may have hole in their GPIO bank
Example:
  If GPIO bank have 16 GPIO pins [0-15].
  In particular SoC's package case, some GPIO bank can have less GPIO pins:
    - [0-10] => 11 pins;
    - [2-7] => 6 pins.

Commit dbf928dd26 ("gpio: stm32f7: Add gpio bank holes management")
proposed a first implementation by not counting GPIO "inside" hole. GPIO
are not displaying correctly using gpio or pinmux command when GPIO holes
are located at the beginning of GPIO bank.

To simplify, consider that all GPIO have 16 GPIO and use the gpio_ranges
struct to indicate if a GPIO is mapped or not. GPIO uclass offers several
GPIO functions ("input", "output", "unused", "unknown" and "func"), use
"unknown" GPIO function to indicate that a GPIO is not mapped.

stm32_offset_to_index() is no more needed and removed.

This must be reflected using the "gpio" command to indicate to user
that a particular GPIO is not mapped (marked as "unknown") as shown below:

Example for a 16 pins GPIO bank with the [2-7] mapping (only 6 pins
mapped):
GPIOI0          : unknown
GPIOI1          : unknown
GPIOI2          : analog
GPIOI3          : analog
GPIOI4          : alt function 0 push-pull pull-down
GPIOI5          : alt function 0 push-pull pull-down
GPIOI6          : alt function 0 push-pull pull-down
GPIOI7          : analog
GPIOI8          : unknown
GPIOI9          : unknown
GPIOI10         : unknown
GPIOI11         : unknown
GPIOI12         : unknown
GPIOI13         : unknown
GPIOI14         : unknown
GPIOI15         : unknown

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I55c39a2707fa8dae108d90c4a72590f1a4520ca9
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/239065
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/248297
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@foss.st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-02 18:16:18 +02:00
fe1ed4fbe2 video: stm32: stm32_ltdc: fix data enable polarity
Wrong DISPLAY_FLAGS used to set the data enable polarity.

Signed-off-by: Yannick FERTRE <yannick.fertre@foss.st.com>
Change-Id: I767c723f7deb853ac09ee1f7e39c057bd37e1a46
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/240664
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-02-22 09:58:24 +01:00
6fde82adf7 Prepare v2020.10-stm32mp-r2
Update version in Makefile to prepare the label v2020.10-stm32mp-r2

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I0d978f1fc9dc1c4cbf8db3b06a4c9d84e21c7d89
2021-10-11 14:09:12 +02:00
660fbb2f29 adc: stm32mp15: add check in power down exit
Check actual power state before requesting ADC wake-up.
This allows to save time on successive conversions.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Change-Id: Ie271447eb36837cb9e50cc5f1d6612c26bede25e
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/223336
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Fabrice GASNIER <fabrice.gasnier@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-10-11 14:06:54 +02:00
601a3c6be5 adc: stm32mp15: add calibration support
Add support of offset and linear calibration for STM32MP15.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Change-Id: I12616a161ad14b61957ff2da5357c1220bc0d77b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/223152
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Fabrice GASNIER <fabrice.gasnier@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-10-11 14:06:08 +02:00
f6d6c70357 arm: stm32mp: add node for simple framebuffer
Add a node to save in device-tree the parameters of used framebuffer.

Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
Change-Id: I87046283debdab310d4d79278fd08700782e905a
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/218970
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@foss.st.com>
2021-10-05 18:20:43 +02:00
eaa8cca44d common: add fdt_simplefb_add_node_and_mem_rsv
Add a new function to reserved the frame buffer with no-map properties
and the video device is active and the video buffer is used.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I149e26a80c7e031a88b7b28724452fdb068deb62
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/218969
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Tested-by: Yannick FERTRE <yannick.fertre@foss.st.com>
2021-10-05 18:20:43 +02:00
6915c0af15 video: Add video_is_active function
Add the function helper function video_is_active() to test is one video device
is active.

This function can be used in board code to test to make operation
only when the display is probed / really used.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I1fdc777bed680de1bea00b4d1eea43fd75a66e42
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/218968
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Tested-by: Yannick FERTRE <yannick.fertre@foss.st.com>
2021-10-05 18:20:43 +02:00
1801c3f50e common: add framebuffer in chosen sub-node
In the Linux binding
Documentation/devicetree/bindings/display/simple-framebuffer.yaml
the famebuffer must be sub-nodes of chosen node.

It was not the case today in fdt_simplefb_add_node().

This patch also adds the missing #address-cells and #size-cells property
inherit from the root node as it is required by fdt_setup_simplefb_node()
and a empty "ranges" property to indicate a 1:1 translation.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Iafba8c82c16551cf84d0f6e703af5553ef7c4624
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/218967
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/220891
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Yannick FERTRE <yannick.fertre@foss.st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-10-05 18:20:43 +02:00
fff51dc169 common: rename functions lcd_dt_simplefb to fdt_simplefb
Rename the function named lcd_dt_simplefb* to fdt_simplefb* to be aligned
with the associated file name fdt_simplefb.h/fdt_simplefb.c

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I4feae35bc7d3eda703b157680caff3979d01d048
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/218966
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Tested-by: Yannick FERTRE <yannick.fertre@foss.st.com>
2021-10-05 18:20:43 +02:00
99e43c3568 common: rename lcd_simplefb.c file to fdt_simplefb.c
Rename the file lcd_simplefb.c to fdt_simplefb.c to be aligned
with the configuration name and with the associated include file
./include/fdt_simplefb.h

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I2b8768c30ed4364557c336097beea2e146c3e4fc
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/218965
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Tested-by: Yannick FERTRE <yannick.fertre@foss.st.com>
2021-10-05 18:20:43 +02:00
68f77d9038 Convert CONFIG_LCD_DT_SIMPLEFB to Kconfig
This converts the following to Kconfig:
   CONFIG_LCD_DT_SIMPLEFB

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I484cf4a475d46527cfefd4ff549a22ac23920cdc
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/218964
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>
Tested-by: Yannick FERTRE <yannick.fertre@foss.st.com>
2021-10-05 18:20:43 +02:00
30c0547c6e stm32mp: Fix board_get_usable_ram_top()
When booting in EFI, lib/efi_loader/efi_memory.c calls
board_get_usable_ram_top(0) which returns by default
gd->ram_base + gd->ram_size which is the top of DDR.

In case of OPTEE boot, the top of DDR is currently reserved by OPTEE,
board_get_usable_ram_top(0) must return an address outside OPTEE
reserved memory.

gd->ram_top matches this constraint as it has already been initialized
by substracting all DT reserved-memory (included OPTEE memory area).

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I8730b1312d246d36ef9dc131c4b36f2ff1fc06a2
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/217865
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@foss.st.com>
2021-10-05 18:20:43 +02:00
36c435c3fa board: dh_stm32mp1: Remove gpio_hog_probe_all() from board
DM_GPIO_HOG flag has been replaced by GPIO_HOG flag since a while in
commit 49b10cb492 ("gpio: fixes for gpio-hog support").

And furthermore, gpio_hog_probe_all() is already called in board_r.c.
So gpio_hog_probe() can be removed from stm32mp1.c.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I2bd31634ebf9c9ec127431f02f0c2fd149150d07
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/215687
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-10-05 18:20:43 +02:00
d66d737eef board: stm32mp1: Remove gpio_hog_probe_all() from board
DM_GPIO_HOG flag has been replaced by GPIO_HOG flag since a while in
commit 49b10cb492 ("gpio: fixes for gpio-hog support").

And furthermore, gpio_hog_probe_all() is already called in board_r.c.
So gpio_hog_probe() can be removed from stm32mp1.c.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I9beb7f8f4f69dbdb1764c9b9dc6d5275dcb6bbdb
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/215686
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-10-05 18:20:43 +02:00
e14597a7e9 clk: stm32mp1: add support of missing SPI clocks
Add the missing SPI clock even if these instances are not available
on STMicroelectronics boards: SPI2_K, SPI3_K, SPI4_K, SPI6_K.

With this patch, the SPI2 / SPI3 / SPI4 / SPI6 instances can be used on
customer design without the clock driver error:
  stm32mp1_clk_get_id: clk id 131 not found

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I9f0b06646bc5c9c2a673537caa8f5364e39793b3
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/213210
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2021-10-05 18:20:43 +02:00
982c2440e4 i2c: stm32f7: compute i2cclk only one time
Compute i2cclk only one time in stm32_i2c_compute_timing()
and remove setup parameter (accessible in i2c_priv).

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I3274530ffc3dc43e20e6f4929727ca5159658990
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/210214
Reviewed-by: MPUOSTL
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Reviewed-by: Amelie DELAUNAY <amelie.delaunay@foss.st.com>
2021-10-05 18:20:43 +02:00
21096715be i2c: stm32f7: add support for DNF i2c-digital-filter binding
Add the support for the i2c-digital-filter binding, allowing to enable
the digital filter via the device-tree and indicate its value in the DT

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I8715eace8f5e34887f2363abc583d42f02e01cb3
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/210213
2021-10-05 18:20:43 +02:00
42d11e3ca8 i2c: stm32f7: fix configuration of the digital filter
The digital filter related computation are present in the driver
however the programming of the filter within the IP is missing.
The maximum value for the DNF is wrong and should be 15 instead of 16.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: If56e5174ba80bee2e0db3f6ad04c9e7154f50ca4
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/210212
2021-10-05 18:20:43 +02:00
9242458677 i2c: stm32f7: support DT binding i2c-analog-filter
Replace driver internally coded enabling/disabling of the
analog-filter with the DT binding "i2c-analog-filter".

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I6d993c7092a37120fb3fa9d26b4d5e3de8944e7e
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/210211
Reviewed-by: MPUOSTL
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2021-10-05 18:20:43 +02:00
b3d2d1e925 i2c: stm32f7: move driver data of each instance in a privdata
Today all the I2C instance point on the same global
variable stm32_i2c_setup according the compatible: i2c_priv->setup =
pointer to the same driver data.

This patch changes this driver data (stm32f7_setup and stm32mp15_setup)
to a const struct and move the timing struct 'setup' as element of i2c
privdata, initialized in stm32_ofdata_to_platdata() with the driver
configuration data.

This patch solves issues when several I2C instance have not the same
clock source or not the same configuration: each timing setup is saved
is the I2C privdata.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ia8e6463592752f83c7748e619f393985e008186a
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/210210
Reviewed-by: MPUOSTL
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Reviewed-by: Amelie DELAUNAY <amelie.delaunay@foss.st.com>
2021-10-05 18:20:43 +02:00
732f280fa4 stm32mp: stm32prog: use defines for virtual partition size
Use the existing defines PMIC_SIZE and OTP_SIZE for virtual partition size.

This patch corrects the size for OTP partition: 1024 instead of 512.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I36ee8ad60f6e0ee9c3021a5e2f0fcc1863bb648e
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/213071
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-10-05 18:20:43 +02:00
22495180b0 spi: stm32: Add ofdata_to_platdata() callback
Parse DT in ofdata_to_platdata() callback instead of probe().

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Change-Id: I4855604e3a97ff2bc9d8b2009524bee22b1565f8
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/211100
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2021-10-05 18:20:43 +02:00
4dd56025bf stm32mp: stm32prog: fix the content of short help message
Reduce the content of short help message and removed the carrier return
to fix the display of 'help' command when this command is activated.

Fixes: 954bd1a923 ("stm32mp: add the command stm32prog")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ie7748433dd9d0a95d22e59a1ea7139341921ea91
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/210711
Reviewed-by: MPUOSTL
2021-10-05 18:20:43 +02:00
29ddeeb4c0 board: stm32mp1: correct the property name for eth
Use the correct name for STMicroelectronics phys config properties,
replace '_' by '-':
  "st,eth_clk_sel" => "st,eth-clk-sel"
  "st,eth-ref-clk-sel" => st,eth-clk-sel"

These property name are aligned with the upstreamed Linux kernel binding:
 linux/Documentation/devicetree/bindings/net/stm32-dwmac.yaml

See Linux kernel commit "dt-bindings: net: stmmac: add phys config
properties" merged in v5.1-rc1.

This patch allow to reuse the kernel device tree directly in U-Boot.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Idaeedfa2eaab3b76ec60a985d8f3625b803564b8
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/208648
Reviewed-by: MPUOSTL
2021-10-05 18:20:43 +02:00
2b62541713 arm: stm32mp1: force boot_device variable for invalid TAMP register value
When TAMP register 20 have a invalid value (0x0 for example after TAMPER
error) the "boot_device" U-Boot env variable have not value and not
error in U-Boot log.

The STM32MP boot command bootcmd_stm32mp failed with strange trace:
  "Boot over !"

and the next line failed with few indication:
  if test ${boot_device} = serial || test ${boot_device} = usb;
	then stm32prog ${boot_device} ${boot_instance};

The patch avoid this issue:
- add error during boot
- display trace "Boot over invalid!"
- execute "run distro_bootcmd" to try all the possible target


Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: If5e2c9dc73be2ddb58f1495b4f41186cda743798
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/208833
Reviewed-by: MPUOSTL
2021-10-05 18:20:43 +02:00
1e9aad96e6 phy: stm32-usbphyc: Add DT phy tuning support
Add support of st,phy-tuning property for sm32-usbphyc's phy.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: Ie551580e5fb6fda0ef920ad27cb55614d5b75db6
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/211926
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-10-05 18:20:43 +02:00
e7c947af9f phy: stm32: usbphyc: add protection on phy sub-node
Add protection on presence and order of the phy node sub node
by using the mandatory reg information and ofnode_valid(node).

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/206059
Change-Id: I38b706ca6f52e86cb791245a2aee6a81fbd1c030
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/206281
Reviewed-by: MPUOSTL
2021-10-05 18:20:43 +02:00
1449d7f127 phy: use connector for vbus-supply with phy-stm32-usbphyc
vbus-supply is an optional property of connector node. Use connector node
to add vbus-supply optional property to phy sub-nodes.
A regulator for USB VBUS may be needed for host mode.

See the latest kernel binding for details.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I48db0a17460592df70f33306da8d8196cd13e0e9
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/206060
2021-10-05 18:20:43 +02:00
f24784bc7c ARM: dts: stm32mp: add pull-up for gpio button PA13 and PA14
When a push-button is released and PA13/PA14 are defined as input (high-Z)
the LED should not be active as the circuit is open but a small current
leak through PCB or push-button close the circuit and allows a small LED
bias giving erroneous level voltage.

So it is recommended to activate an internal pull-up in order to clearly
fix the voltage at PA13/PA14 when button is released and to wait
a short delay before to read the GPIO value only when the pull-up is
correctly configured.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/204503
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/210963
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/211020
2021-10-05 18:20:43 +02:00
10ab5b2929 net: dwc: add a common empty ops eqos_null_ops
Add a common empty ops: eqos_null_ops() to remove the duplicated empty
functions and reduce the driver size for stm32 and imx config.

This patch also aligns the prototype of ops 'eqos_stop_clks' with other
eqos ops by adding return value.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I05af0032a32df49c4d6b7a18a84e2fd409097989
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201924
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-10-05 18:20:43 +02:00
880cd78bcd net: dwc_eth_qos: use generic ethernet phy for stm32 variant
Use the generic ethernet phy which already manages the correct binding
for gpio reset, including the assert an deassert delays.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I52d5d9f5fb91b6bd92ec7fed517bfe36074d487d
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201923
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-10-05 18:20:43 +02:00
14134c0f8d net: dwc_eth_qos: remove the field phyaddr of the struct eqos_priv
Since the commit commit 6a895d039b ("net: Update eQos driver and FEC
driver to use eth phy interfaces") the field phyaddr of driver private data
struct eqos_priv is no more used in eqos_start() for the phy_connect()
parameter.

Now this variable is only initialized in eqos_probe_resources_stm32()
it can be removed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I98726d4bbd3145e65b872950a884cd8424b10131
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201922
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-10-05 18:20:43 +02:00
0a14445700 net: eth-phy: manage subnode mdio0
Bind any subnode with name beginning by mdio, mdio0 for example,
and not only the "mdio" as namei of subnode.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ia198585f58eba36cd65105e2043f61d54e63ceb3
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201921
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-10-05 18:20:43 +02:00
6b9d4ab5b2 net: eth-phy: use dev_dbg and log_notice
Replace debug trace and printf to log macros:
- debug() replaced by dev_dbg() when device is available, this macro
indicate the device name since commit ceb70bb870 ("dm: Print device
name in dev_xxx like Linux")
- printf() replaced by log_notice() to allow  dispatch to log backends.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I523f439458f0ff2d770a2b8e8a7c8e0969e783dd
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201920
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-10-05 18:20:43 +02:00
e242aaeca1 net: eth-phy: add support of device tree configuration for gpio reset
The gpio reset and the assert or deassert delay are defined in generic
binding of the ethernet phy in Linux:
Documentation/devicetree/bindings/net/ethernet-phy.yaml

  reset-gpios:
    maxItems: 1
    description:
      The GPIO phandle and specifier for the PHY reset signal.

  reset-assert-us:
    description:
      Delay after the reset was asserted in microseconds. If this
      property is missing the delay will be skipped.

  reset-deassert-us:
    description:
      Delay after the reset was deasserted in microseconds. If
      this property is missing the delay will be skipped.

See also U-Boot: doc/device-tree-bindings/net/phy.txt

This patch adds the parsing of this common DT properties in the
u-class "eth_phy_generic", used by default in the associated driver
"eth_phy_generic_drv"

This parsing function eth_phy_of_to_plat can be reused by other
ethernet phy drivers for this uclass UCLASS_ETH_PHY.

Change-Id: I5a50f8eef93c11cb54dfdd3b11183422a82fb373
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201919
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-10-05 18:20:43 +02:00
a356a25ca6 dts: stm32mp1: alignment with v5.10-stm32mp-r2
Device tree alignment with Linux kernel v5.10-stm32mp-r2

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I5ebca78571f561325394ad5b0f15f159235d824f
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/203329
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-10-05 18:20:42 +02:00
13013cc0f0 stm32mp: syscon: manage clock when present in device tree
Enable the clocks during syscon probe when they are present in device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I6cc80b366a817fee3a61c5c284a208ca1a2d6188
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/190142
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/203301
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-09-22 13:25:03 +02:00
6ff8fbd7b3 clk: stm32mp15: add support of SYSCFG clock
Add the support of SYSCFG clock used by syscon driver
to prepare the clock management of STM32MP_SYSCON_SYSCFG.

This clock is already defined in kernel device tree,
stm32mp151.dtsi but not yet supported in the syscon driver:

syscfg: syscon@50020000 {
	compatible = "st,stm32mp157-syscfg", "syscon";
	reg = <0x50020000 0x400>;
	clocks = <&rcc SYSCFG>;
};

It is safe to support this clock in U-Boot driver with
RCC_MC_APB3ENSETR, Bit 11 SYSCFGEN: SYSCFG peripheral clocks
enable.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I711fb255292d0f086a2632041897c48c163403bd
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/192633
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/203300
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-09-22 13:25:03 +02:00
f5243e06b8 remoteproc: stm32: update to dynamically detect the OPTEE support
Instead of using compatible field in DT, dynamically detect the presence
of the remoteproc TEE trusted application (TA). If detected the
coprocessor firmware management is delegated to the TA.
Else the driver manages it.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Change-Id: Iebd3a4a94dc737101e09c59ee3de3a0d5ffb214c
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/192188
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
2021-09-22 13:25:03 +02:00
d8d19eacd5 remoteproc: tee: deinit rproc_optee struct on session close
The TEE session is closed, clean up related context registered
in the rproc_optee structure.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Change-Id: Idbaa8a7eea7ada691353f7e7490edbac61902bf0
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/194401
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
2021-09-22 13:25:03 +02:00
a09ed2a86a remoteproc: tee: return an error if tee session can be opened
to be able to dynamically detect the presence of the TEE TA, return an
error if the open session fails.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Change-Id: Icbc243f2c935a9d082ca4055bbd3e087268449d2
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/192187
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com>
2021-09-22 13:25:03 +02:00
946ed39534 stm32mp: configs: activate the command stm32key only for ST boards
This command is used to evaluate the secure boot on stm32mp SOC,
it is deactivated by default in real products.

We activate this command only in STMicroelectronics defconfig
used with the evaluation boards.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I222bda2f6a603fbc60ccaae84a9936af8ccbba8b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/194287
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-09-22 13:25:03 +02:00
7326278c93 stm32mp: cmd_stm32key: lock of PKH OTP after fuse
Lock the OTP value of hash of key after the command
$> stm32key fuse <address>

This operation forbids a second update of these OTP other as they are
ECC protected in BSEC : any update of these OTP with a different value
cause a BSEC disturb error and boot of the closed chip are bricked.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I8410e2048aae4150e956478327751a71d8124024
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/208418
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/208159
Reviewed-by: MPUOSTL
2021-09-22 13:25:03 +02:00
5f67652571 stm32mp: cmd_stm32key: add subcommand close
The expected sequence to closing the device

1/ Load key in DDR with any supported load command
2/ Update OTP with key: STM32MP> stm32key read <addr>

At this point the device is able to perform image authentication but
non-authenticated images can still be used and executed.
So it is the last moment to test boot with signed binary and
check that the ROM code accepted them.

3/ Close the device: only signed binary will be accepted !!
   STM32MP> stm32key close

Warning: Programming these OTP is an irreversible operation!
         This may brick your system is the HASH of key is invalid

This command should be deactivated by default in real product.

Change-Id: Ice24ec3430539077cefa5a43cb6245847db3871e
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/194285
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/208413
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-09-22 13:25:03 +02:00
9fc4e59b53 stm32mp: cmd_stm32key: add read OTP subcommand
Allow to read the OTP value and lock status with the command
$> stm32key read

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ied9f79b7d73deaea9b2680449aac2a92b3dae465
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/194283
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2021-09-22 13:25:03 +02:00
aeb1a56609 stm32mp: cmd_stm32key: add get_misc_dev function
Add function to access to BSEC misc driver.

Change-Id: I38ea9658e6b3f7be161eddb47b792f8af938910e
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/194282
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2021-09-22 13:25:03 +02:00
3c3a5fb941 stm32mp: cmd_stm32key: handle error in fuse_hash_value
Handle errors in fuse_hash_value function

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Id13cccdd894c43f0df0833fc71e3ff084eb4cc1d
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/194281
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2021-09-22 13:25:03 +02:00
b72fa9b7bf stm32mp: cmd_stm32key: use sub command
Simplify parsing the command argument by using
the macro U_BOOT_CMD_WITH_SUBCMDS.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I55399cf019408c6f6d4f86aa8783c8187b090280
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/194280
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-09-22 13:25:03 +02:00
c05b6ee1e7 stm32mp: stm32prog: handle dfu error
Handle DFU stack error in STM32CubeProgrammer protocol.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I77bcf66a0048289b8a5139cf59266a564d6400ac
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/197161
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-09-22 13:25:03 +02:00
8289d8e398 dfu: add error callback
Add error callback in dfu stack to manage some board specific
behavior on DFU targets.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I36ae186249a121969b9ab6d3a7f62752091cf472
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/197160
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-09-22 13:25:03 +02:00
e6e01e11d4 stm32mp: stm32prog: solve compilation with CONFIG_FIT_SIGNATURE
When CONFIG_FIT_SIGNATURE is activated, CONFIG_LEGACY_IMAGE_FORMAT
is deactivated and the define IMAGE_FORMAT_LEGACY don't exist.

This patch adds the needed check on compilation flag
CONFIG_LEGACY_IMAGE_FORMAT to avoid this error:

cmd_stm32prog.c:81:8: error: ‘IMAGE_FORMAT_LEGACY’ undeclared
(first use in this function); did you mean ‘IMAGE_FORMAT_FIT’?
   81 |    if (IMAGE_FORMAT_LEGACY ==
      |        ^~~~~~~~~~~~~~~~~~~
      |        IMAGE_FORMAT_FIT

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I44c0cbd50fa01f82729d1d6d435d0f663b9e7dcb
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/204244
2021-09-22 13:25:03 +02:00
ada914b20f stm32mp: stm32prog: add support of initrd in flashlayout
Add the support in command stm32prog of kernel load and start
with initrd file, identify by the partition Type "Bynary" in
the flashlayout.tsv, for example:

- 0x01 fsbl	Binary none 0x0 tfa.stm32
- 0x03 fip	Binary none 0x0 fip.bin
P 0x10 kernel System ram0 0xC2000000 uImage.bin
P 0x11 dtb FileSystem ram0 0xC4000000 board.dtb
P 0x12 initrd Binary ram0 0xC4400000 <initrd>

The <initrd> file can be a legacy image "uInitrd", generated
with mkimage, or a RAW initrd image "initrd.gz".

After a DFU detach the bootm command with be executed
with the associated address, for example:

$> bootm 0xC2000000 0xC4400000:<size> 0xC4000000

When the "Binary" parttion type is absent, the 'bootm'
with boot the kernel wihtout ramdisk, for example:

$> bootm 0xC2000000 - 0xC4000000

With this paths, it is no more mandatory to generate FIT
including the kernel, DT and initrd:

- 0x01 fsbl Binary none 0x0 tfa.stm32
- 0x03 fip Binary none 0x0 fip.bin
P 0x10 fit System ram0 0xC2000000 fit.bin

Change-Id: I6f9c5a83cfe16a49ab3f724cc0be3b59f4bcd05c
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/204242
Reviewed-by: MPUOSTL
2021-09-22 13:25:03 +02:00
f6c1d336b4 stm32mp: stm32prog: change one message level to debug
Move the message "Invalid or missing layout file."
to debug level as it is a normal behavor and not a error
and add the missing '\n'.

this patch avoid strange trace :
  Boot over usb0!
  Invalid or missing layout file.DFU alt info setting: done
  #

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I356522a80eec573678c8a84e06f1dbba4b380f29
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/198978
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Tested-by: Sebastien PASDELOUP <sebastien.pasdeloup-ext@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201228
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-09-22 13:25:02 +02:00
8d55486192 stm32mp: stm32prog: use get_cpu_dev for GetID command
Use get_cpu_dev() in uart getID command and remove the defines
DEVICE_ID_BYTE1 and 2 defines.

This patch prepare the support for new SOC family.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I874b9d67ab66c4a1b44c880721f697effa226c5b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/198884
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201227
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-09-22 13:25:02 +02:00
491269d2cd stm32mp: stm32prog: correctly handle DM_PMIC
Correctly handle number of alternate when DM_PMIC is not activated.
This patch remove he last UNKNOWN partition in this case.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Id5ec1c084e307f296256a9764772f23492ee4766
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/198386
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201226
2021-09-22 13:25:02 +02:00
a66185a32a stm32mp: stm32prog: handle the next phase after USB re-enumeration
Handle the second USB enumeration only when the flashlayout is received
and when phase is PHASE_FLASHLAYOUT. This patch removes the call of
stm32prog_next_phase as it is already done in stm32prog_dfu_init().

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ic81eb7eb5bd44c0d9022eb4b7aed823a934eecda
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/198145
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201225
2021-09-22 13:25:02 +02:00
bb1048c697 stm32mp: update uart number in trace of serial device not found
Align the uart number in the trace of setup_boot_mode() with the name of
the uart/usartt device (start at 1) and not with instance value (start at
0) the serial device sequence number or the index in serial_addr[].

Fixes: 9af6dce609 ("stm32mp: stm32prog: replace alias by serial
device sequence number")

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Iad88039569017850ed77dfae267b261f8efc8ad7
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/197372
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-09-22 13:25:02 +02:00
447b2d8077 stm32mp: call lmb_init_and_reserve when data cache is activated
The device tree parsing done in lmb_init_and_reserve() take a
long time when it is executed without data cache.

To avoid this issue, this patch moves the lmb initialization in
enable_caches() and the lmb varaible becomes a static struct.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I67337656abbb169c7ca11bd6d216cb7b8ccefadf
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201224
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-09-22 13:25:02 +02:00
09d0fdb70b stm32mp: Increase the reserved memory in board_get_usable_ram_top
Add 8M for the U-Boot reserved memory (display, fdt, gd, ...).

Without this patch the device tree, located before the MALLOC area
is not tagged cacheable just after relocation, before mmu reconfiguration.

This patch reduces the duration for device tree parsing in
lmb_init_and_reserve.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Iacc4c98187ccfabfd7b72068ad27ad1581bd4cda
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201223
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-09-22 13:25:02 +02:00
cc0c6678b3 stm32mp: 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 where predictive read access on secure DDR
OP-TEE reserved area are caught by firewall.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ie201fe9dca554a20debef8d5977ff179db39f406
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201222
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-09-22 13:25:02 +02:00
fc202f138e arm: remove set_dacr/get_dacr functions
Remove the unused function set_dacr/get_dacr

Serie-cc: Ard Biesheuvel <ardb@kernel.org>
Serie-cc: R Sricharan <r.sricharan@ti.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I9e7089b60ce4ced76429882e8f19f549de7e11fb
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201221
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-09-22 13:25:02 +02:00
731bc0cf93 arm: cp15: remove weak function arm_init_domains
Remove the unused weak function arm_init_domains used to change the
DACR value.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ib32061f8d5bd96afb1a641107fef22ae96e05280
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201220
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-09-22 13:25:02 +02:00
c17d0f4d1c arm: omap2: remove arm_init_domains
Remove the arm_init_domains and the DACR update, as it is now done
in ARMv7 CP15 level.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I70595b1999985446f2156eb37b3d973ba489c82c
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201219
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-09-22 13:25:02 +02:00
afb75ee8f1 arm: cp15: update DACR value to activate access control
Update the initial value of Domain Access Control Register (DACR)
and set by default the access permission to client (DACR_Dn_CLIENT = 1U)
for each of the 16 domains and no more to all-supervisor
(DACR_Dn_MANAGER = 3U).

This patch allows to activate the domain checking in MMU against the
permission bits in the translation tables and avoids prefetching issue
on ARMv7 [1].

Today it was already done for OMAP2 architecture
./arch/arm/mach-omap2/omap-cache.c::arm_init_domains
introduced by commit de63ac278c ("ARM: mmu: Set domain permissions
to client access") which fixes lot of speculative prefetch aborts seen
on OMAP5 secure devices.

[1] https://developer.arm.com/documentation/ddi0406/b/System-Level-Architecture/Virtual-Memory-System-Architecture--VMSA-/Memory-access-control/The-Execute-Never--XN--attribute-and-instruction-prefetching

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reported-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I7ab5a1fc95ca9fae01a4ec194a67374ba6872638
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201218
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-09-22 13:25:02 +02:00
d2db468576 arm: cosmetic: align TTB_SECT define value
Align TTB_SECT define value with previous value.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ic523a7db6fe8e4ee710cf77f0986c73bdb21b103
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201217
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-09-22 13:25:02 +02:00
2965ca0343 arm: remove TTB_SECT_XN_MASK in DCACHE_WRITETHROUGH
The normal memory (other that DCACHE_OFF) should be executable by default,
only the device memory (DCACHE_OFF) used for peripheral access should have
the bit execute never (TTB_SECT_XN_MASK).

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ic60984b860abed150b9bead538770cd1b6d930fe
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201216
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-09-22 13:25:02 +02:00
c763b5eceb stm32mp: update the mmu configuration for SPL and prereloc
Overidde the weak function dram_bank_mmu_setup() to set the DDR
(preloc case) or the SYSRAM (in SPL case) executable before to enable
the MMU and configure DACR.

This weak function is called in dcache_enable/mmu_setup.

This patchs avoids a permission access issue when the DDR is marked
executable (by calling mmu_set_region_dcache_behaviour with
DCACHE_DEFAULT_OPTION) after MMU setup and domain access permission
activation with DACR in dcache_enable.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I89418f0518a81f98643b36c248b006e596950c25
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201215
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-09-22 13:25:02 +02:00
d015f8127f stm32mp: update MMU config before the relocation
Mark the top of ram, used for relocated U-Boot as a normal memory
(cacheable and executable) to avoid permission access issue when
U-Boot jumps to this relocated code.

When MMU is activated in pre-reloc stage; only the beginning of
DDR is marked executable.

This patch avoids access issue when DACR is correctly managed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Id05ed63c4c424d0307d757026ab2f22621b5481b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201214
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
2021-09-22 13:25:02 +02:00
c7cc7526c3 scmi: correctly configure MMU for SCMI buffer
Align the MMU area for SCMI shared buffer on section size.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Change-Id: Ie4df1c787d51eb06945ee580b4ff5248c609ab7b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/189783
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>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/201213
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@foss.st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-09-22 13:25:02 +02:00
50e9cd1b89 spi: stm32_qspi: Fix short data write operation
TCF flag only means that all data was sent to FIFO. To check if the
data was sent out of FIFO we should also wait for the BUSY flag to be
cleared. Otherwise there is a race condition which can lead to
inability to write short (one byte long) data.

[backport of 88f7ca03b4 ("spi: stm32_qspi: Fix short data write
operation")]

Signed-off-by: Daniil Stas <daniil.stas@posteo.net>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: Ic4dc408412552f885757dd7b46685c6c5087b574
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/207265
Tested-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Reviewed-by: MPUOSTL
Reviewed-by: Christophe KERELLO <christophe.kerello@st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-09-22 13:25:02 +02:00
d306020222 configs: stm32mp: activate command rng
Activate the command rng with CONFIG_CMD_RNG, used to test
the rng driver

Change-Id: Ie6808c79e8d3fc567c03ce44ff9dbfc44ee105d3
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/199426
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-09-22 13:25:02 +02:00
f7fd427d1d configs: stm32mp1: add fdtoverlay_addr_r
Add the variable used by PXE command for fdtoverlays support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I5e93758388130e77d97fc9904105c8e69363705b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/203289
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2021-09-22 13:25:02 +02:00
5a99604863 cmd: pxe: add support for FDT overlays
This adds support for specifying FDT overlays in an extlinux/pxelinux
configuration file.

Without this, there is no simple way to apply overlays when the kernel
and fdt is loaded by the pxe command.

This change adds the 'fdtoverlays' keyword for a label, supporting multiple
overlay files to be applied on top of the fdt specified in the 'fdt' or
'devicetree' keyword.

Example:
  label linux
    kernel /Image
    fdt /soc-board.dtb
    fdtoverlays /soc-board-function.dtbo
    append console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait

This code makes usage of a new variable called fdtoverlay_addr_r used to load
the overlay files without overwritting anything important.

[backport of commit 69076dff22 ("cmd: pxe: add support for FDT overlays")]
Cc: Tom Rini <trini@konsulko.com>
Cc: Andre Heider <a.heider@gmail.com>
Cc: Jernej Škrabec <jernej.skrabec@siol.net>
Cc: Jonas Karlman <jonas@kwiboo.se>
Tested-by: Jernej Škrabec <jernej.skrabec@siol.net>
Reviewed-by: Jernej Škrabec <jernej.skrabec@siol.net>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Change-Id: I8f216382a5c265fd76fd191fda4fc530ad16a5e8
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/200115
Reviewed-by: CIBUILD <MDG-smet-aci-builds@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-09-22 13:25:02 +02:00
dd12fc4a67 led: gpio: Default to using node name if label is absent
This more closely mirrors Linux's behaviour, and will make it easier to
transition to using function+color in the future.

[backport of commit aaa3645e16 ("led: gpio: Default to using node name
 if label is absent")]

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Change-Id: I26e88142161df99faa7d7cd34c5bcb00f08c06b4
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/192821
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/203293
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2021-09-22 13:25:02 +02:00
943db903e1 stm32mp1: ram: add read valid training support
Add the read data eye training = training for optimal read valid placement
(RVTRN) when the built-in calibration is executed for LPDRR2 and LPDDR3.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I1a0a5850a0ac39ae33620ed14822892c394b1a98
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/219143
2021-09-22 13:25:02 +02:00
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
214 changed files with 9757 additions and 2669 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-r2.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

@ -176,9 +176,6 @@ void mmu_page_table_flush(unsigned long start, unsigned long stop)
{
}
void arm_init_domains(void)
{
}
#endif /* #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) */
#if !CONFIG_IS_ENABLED(SYS_ICACHE_OFF)

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

@ -315,6 +315,7 @@
clocks = <&rcc 1 CLK_I2C1>;
#address-cells = <1>;
#size-cells = <0>;
i2c-analog-filter;
status = "disabled";
};
@ -327,6 +328,7 @@
clocks = <&rcc 1 CLK_I2C2>;
#address-cells = <1>;
#size-cells = <0>;
i2c-analog-filter;
status = "disabled";
};
@ -339,6 +341,7 @@
clocks = <&rcc 1 CLK_I2C3>;
#address-cells = <1>;
#size-cells = <0>;
i2c-analog-filter;
status = "disabled";
};
@ -351,6 +354,7 @@
clocks = <&rcc 1 CLK_I2C4>;
#address-cells = <1>;
#size-cells = <0>;
i2c-analog-filter;
status = "disabled";
};

View File

@ -106,6 +106,7 @@
<32>;
resets = <&rcc STM32H7_APB1L_RESET(I2C1)>;
clocks = <&rcc I2C1_CK>;
i2c-analog-filter;
status = "disabled";
};
@ -118,6 +119,7 @@
<34>;
resets = <&rcc STM32H7_APB1L_RESET(I2C2)>;
clocks = <&rcc I2C2_CK>;
i2c-analog-filter;
status = "disabled";
};
@ -130,6 +132,7 @@
<73>;
resets = <&rcc STM32H7_APB1L_RESET(I2C3)>;
clocks = <&rcc I2C3_CK>;
i2c-analog-filter;
status = "disabled";
};
@ -349,6 +352,7 @@
<96>;
resets = <&rcc STM32H7_APB4_RESET(I2C4)>;
clocks = <&rcc I2C4_CK>;
i2c-analog-filter;
status = "disabled";
};

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,448 @@
// 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>, <&rcc CEC>;
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_fmc: memory-controller@58002000 {
compatible = "rproc-srm-dev";
reg = <0x5800200 0x1000>;
clocks = <&rcc FMC_K>;
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,153 @@
// 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_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;
};
&bsec {
clocks = <&rcc BSEC>;
};
&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 = <0>;
};
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 = <0>;
};
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>;
st,fastboot-gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
#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"
@ -15,11 +16,6 @@
model = "STMicroelectronics STM32MP157A-DK1 Discovery Board";
compatible = "st,stm32mp157a-dk1", "st,stm32mp157";
aliases {
ethernet0 = &ethernet0;
serial0 = &uart4;
};
chosen {
stdout-path = "serial0:115200n8";
};

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 | GPIO_PULL_UP)>;
st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
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,83 @@
// 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";
};
};
&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,32 @@
#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;
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 +54,7 @@
};
};
panel@0 {
panel_otm8009a: panel-otm8009a@0 {
compatible = "orisetech,otm8009a";
reg = <0>;
reset-gpios = <&gpioe 4 GPIO_ACTIVE_LOW>;
@ -62,6 +70,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 +90,8 @@
interrupt-controller;
touchscreen-size-x = <480>;
touchscreen-size-y = <800>;
panel = <&panel_otm8009a>;
vcc-supply = <&v3v3>;
status = "okay";
};
};
@ -84,3 +106,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";
@ -16,92 +15,28 @@
chosen {
stdout-path = "serial0:115200n8";
};
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";
};
};
&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 +52,7 @@
};
};
panel-dsi@0 {
panel_dsi: panel-dsi@0 {
compatible = "raydium,rm68200";
reg = <0>;
reset-gpios = <&gpiof 15 GPIO_ACTIVE_LOW>;
@ -133,229 +68,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,22 @@
// 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";
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,83 @@
// 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";
};
};
&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,154 @@
// 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 {
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,84 @@
// 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";
};
};
&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,19 @@
* 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;
serial0 = &uart4;
serial1 = &usart3;
serial2 = &uart7;
};
memory@c0000000 {
device_type = "memory";
reg = <0xc0000000 0x20000000>;
@ -42,6 +51,12 @@
no-map;
};
mcu_rsc_table: mcu_rsc_table@10048000 {
compatible = "shared-dma-pool";
reg = <0x10048000 0x8000>;
no-map;
};
mcuram: mcuram@30000000 {
compatible = "shared-dma-pool";
reg = <0x30000000 0x40000>;
@ -62,7 +77,7 @@
led {
compatible = "gpio-leds";
blue {
led-blue {
label = "heartbeat";
gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
@ -72,7 +87,7 @@
sound {
compatible = "audio-graph-card";
label = "STM32MP1-DK";
label = "STM32MP15-DK";
routing =
"Playback" , "MCLK",
"Capture" , "MCLK",
@ -80,6 +95,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 +150,6 @@
status = "okay";
};
&dts {
status = "okay";
};
&cpu0{
cpu-supply = <&vddcore>;
};
@ -128,6 +158,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 +182,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 +199,10 @@
contiguous-area = <&gpu_reserved>;
};
&hash1 {
status = "okay";
};
&i2c1 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2c1_pins_a>;
@ -238,37 +290,52 @@
/delete-property/dmas;
/delete-property/dma-names;
typec: stusb1600@28 {
stusb1600@28 {
compatible = "st,stusb1600";
reg = <0x28>;
interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
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 +424,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 +459,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";
@ -433,11 +514,12 @@
&m4_rproc {
memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>,
<&vdev0vring1>, <&vdev0buffer>;
<&vdev0vring1>, <&vdev0buffer>, <&mcu_rsc_table>;
mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
mbox-names = "vq0", "vq1", "shutdown";
interrupt-parent = <&exti>;
interrupts = <68 1>;
wakeup-source;
status = "okay";
};
@ -465,8 +547,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 +604,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 +711,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 +763,22 @@
&usbphyc_port0 {
phy-supply = <&vdd_usb>;
st,phy-tuning = <&usb_phy_tuning>;
/*
* Hack to keep hub active until all connected devices are suspended
* otherwise the hub will be powered off as soon as the v3v3 is disabled
* and it can disturb connected devices.
*/
connector {
compatible = "usb-a-connector";
vbus-supply = <&v3v3>;
};
};
&usbphyc_port1 {
phy-supply = <&vdd_usb>;
st,phy-tuning = <&usb_phy_tuning>;
};
&vrefbuf {

View File

@ -0,0 +1,419 @@
// 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;
};
mcu_rsc_table: mcu_rsc_table@10048000 {
compatible = "shared-dma-pool";
reg = <0x10048000 0x8000>;
no-map;
};
mcuram: mcuram@30000000 {
compatible = "shared-dma-pool";
reg = <0x30000000 0x40000>;
no-map;
};
retram: retram@38000000 {
compatible = "shared-dma-pool";
reg = <0x38000000 0x10000>;
no-map;
};
};
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>, <&mcu_rsc_table>;
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,696 @@
// 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;
serial1 = &usart3;
};
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>;
/*
* Hack to keep hub active until all connected devices are suspended
* otherwise the hub will be powered off as soon as the v3v3 is disabled
* and it can disturb connected devices.
*/
connector {
compatible = "usb-a-connector";
vbus-supply = <&v3v3>;
};
};
&usbphyc_port1 {
st,phy-tuning = <&usb_phy_tuning>;
};

View File

@ -114,6 +114,4 @@ struct stm32_gpio_priv {
unsigned int gpio_range;
};
int stm32_offset_to_index(struct udevice *dev, unsigned int offset);
#endif /* _GPIO_H_ */

View File

@ -35,7 +35,6 @@ void l2_cache_disable(void);
void set_section_dcache(int section, enum dcache_option option);
void arm_init_before_mmu(void);
void arm_init_domains(void);
void cpu_cache_initialization(void);
void dram_bank_mmu_setup(int bank);

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

@ -397,20 +397,6 @@ static inline void set_cr(unsigned int val)
isb();
}
static inline unsigned int get_dacr(void)
{
unsigned int val;
asm("mrc p15, 0, %0, c3, c0, 0 @ get DACR" : "=r" (val) : : "cc");
return val;
}
static inline void set_dacr(unsigned int val)
{
asm volatile("mcr p15, 0, %0, c3, c0, 0 @ set DACR"
: : "r" (val) : "cc");
isb();
}
#ifdef CONFIG_ARMV7_LPAE
/* Long-Descriptor Translation Table Level 1/2 Bits */
#define TTB_SECT_XN_MASK (1ULL << 54)
@ -458,6 +444,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),
@ -475,7 +462,7 @@ enum dcache_option {
#define TTB_SECT_XN_MASK (1 << 4)
#define TTB_SECT_C_MASK (1 << 3)
#define TTB_SECT_B_MASK (1 << 2)
#define TTB_SECT (2 << 0)
#define TTB_SECT (2 << 0)
/*
* Short-descriptor format memory region attributes, without TEX remap
@ -488,8 +475,9 @@ 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_WRITETHROUGH = TTB_SECT_DOMAIN(0) | TTB_SECT | TTB_SECT_C_MASK,
DCACHE_WRITEBACK = DCACHE_WRITETHROUGH | TTB_SECT_B_MASK,
DCACHE_WRITEALLOC = DCACHE_WRITEBACK | TTB_SECT_TEX(1),
};
@ -497,6 +485,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>
@ -21,10 +22,6 @@ __weak void arm_init_before_mmu(void)
{
}
__weak void arm_init_domains(void)
{
}
static void set_section_phys(int section, phys_addr_t phys,
enum dcache_option option)
{
@ -96,27 +93,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 */
@ -202,11 +205,12 @@ static inline void mmu_setup(void)
asm volatile("mcr p15, 0, %0, c2, c0, 0"
: : "r" (gd->arch.tlb_addr) : "memory");
#endif
/* Set the access control to all-supervisor */
/*
* initial value of Domain Access Control Register (DACR)
* Set the access control to client (1U) for each of the 16 domains
*/
asm volatile("mcr p15, 0, %0, c3, c0, 0"
: : "r" (~0));
arm_init_domains();
: : "r" (0x55555555));
/* and enable the mmu */
reg = get_cr(); /* get control reg. */
@ -313,6 +317,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 +338,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

@ -40,9 +40,6 @@ DECLARE_GLOBAL_DATA_PTR;
#define ARMV7_DCACHE_POLICY DCACHE_WRITEBACK & ~TTB_SECT_XN_MASK
#endif
#define ARMV7_DOMAIN_CLIENT 1
#define ARMV7_DOMAIN_MASK (0x3 << 0)
void enable_caches(void)
{
@ -66,17 +63,3 @@ void dram_bank_mmu_setup(int bank)
for (i = start; i < end; i++)
set_section_dcache(i, ARMV7_DCACHE_POLICY);
}
void arm_init_domains(void)
{
u32 reg;
reg = get_dacr();
/*
* Set DOMAIN to client access so that all permissions
* set in pagetables are validated by the mmu.
*/
reg &= ~ARMV7_DOMAIN_MASK;
reg |= ARMV7_DOMAIN_CLIENT;
set_dacr(reg);
}

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,29 +128,14 @@ 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
default n
help
fuse public key hash in corresponding fuse used to authenticate
binary.
This command is used to evaluate the secure boot on stm32mp SOC,
it is deactivated by default in real products.
config PRE_CON_BUF_ADDR
default 0xC02FF000
@ -164,6 +169,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

@ -10,13 +10,30 @@
#include <dm/device.h>
#include <dm/uclass.h>
#define STM32_OTP_HASH_KEY_START 24
#define STM32_OTP_HASH_KEY_SIZE 8
/* Closed device : bit 6 of OPT0*/
#define STM32_OTP_CLOSE_ID 0
#define STM32_OTP_CLOSE_MASK BIT(6)
/* HASH of key: 8 OTPs, starting with OTP24) */
#define STM32_OTP_HASH_KEY_START 24
#define STM32_OTP_HASH_KEY_SIZE 8
static int get_misc_dev(struct udevice **dev)
{
int ret;
ret = uclass_get_device_by_driver(UCLASS_MISC, DM_GET_DRIVER(stm32mp_bsec), dev);
if (ret)
pr_err("Can't find stm32mp_bsec driver\n");
return ret;
}
static void read_hash_value(u32 addr)
{
int i;
printf("Read KEY at 0x%x\n", addr);
for (i = 0; i < STM32_OTP_HASH_KEY_SIZE; i++) {
printf("OTP value %i: %x\n", STM32_OTP_HASH_KEY_START + i,
__be32_to_cpu(*(u32 *)addr));
@ -24,32 +41,101 @@ static void read_hash_value(u32 addr)
}
}
static void fuse_hash_value(u32 addr, bool print)
static int read_hash_otp(bool print, bool *locked, bool *closed)
{
struct udevice *dev;
int i, word, ret;
int nb_invalid = 0, nb_zero = 0, nb_lock = 0;
u32 val, lock;
bool status;
ret = get_misc_dev(&dev);
if (ret)
return ret;
for (i = 0, word = STM32_OTP_HASH_KEY_START; i < STM32_OTP_HASH_KEY_SIZE; i++, word++) {
ret = misc_read(dev, STM32_BSEC_OTP(word), &val, 4);
if (ret != 4)
val = ~0x0;
ret = misc_read(dev, STM32_BSEC_LOCK(word), &lock, 4);
if (ret != 4)
lock = -1;
if (print)
printf("OTP HASH %i: %x lock : %d\n", word, val, lock);
if (val == ~0x0)
nb_invalid++;
else if (val == 0x0)
nb_zero++;
if (lock == 1)
nb_lock++;
}
word = STM32_OTP_CLOSE_ID;
ret = misc_read(dev, STM32_BSEC_OTP(word), &val, 4);
if (ret != 4)
val = 0x0;
ret = misc_read(dev, STM32_BSEC_LOCK(word), &lock, 4);
if (ret != 4)
lock = -1;
status = (val & STM32_OTP_CLOSE_MASK) == STM32_OTP_CLOSE_MASK;
if (closed)
*closed = status;
if (print)
printf("OTP %d: closed status: %d lock : %d\n", word, status, lock);
status = (nb_lock == STM32_OTP_HASH_KEY_SIZE);
if (locked)
*locked = status;
if (!status && print)
printf("HASK key is not locked!\n");
if (nb_invalid == STM32_OTP_HASH_KEY_SIZE) {
if (print)
printf("HASK key is invalid!\n");
return -EINVAL;
}
if (nb_zero == STM32_OTP_HASH_KEY_SIZE) {
if (print)
printf("HASK key is free!\n");
return -ENOENT;
}
return 0;
}
static int fuse_hash_value(u32 addr, bool print)
{
struct udevice *dev;
u32 word, val;
int i, ret;
ret = uclass_get_device_by_driver(UCLASS_MISC,
DM_GET_DRIVER(stm32mp_bsec),
&dev);
if (ret) {
pr_err("Can't find stm32mp_bsec driver\n");
return;
}
ret = get_misc_dev(&dev);
if (ret)
return ret;
for (i = 0; i < STM32_OTP_HASH_KEY_SIZE; i++) {
if (print)
printf("Fuse OTP %i : %x\n",
STM32_OTP_HASH_KEY_START + i,
__be32_to_cpu(*(u32 *)addr));
word = STM32_OTP_HASH_KEY_START + i;
for (i = 0, word = STM32_OTP_HASH_KEY_START;
i < STM32_OTP_HASH_KEY_SIZE;
i++, word++, addr += 4) {
val = __be32_to_cpu(*(u32 *)addr);
misc_write(dev, STM32_BSEC_OTP(word), &val, 4);
if (print)
printf("Fuse OTP %i : %x\n", word, val);
addr += 4;
ret = misc_write(dev, STM32_BSEC_OTP(word), &val, 4);
if (ret != 4) {
printf("Fuse OTP %i failed\n", word);
return ret;
}
/* on success, lock the OTP for HASH key */
val = 1;
ret = misc_write(dev, STM32_BSEC_LOCK(word), &val, 4);
if (ret != 4) {
printf("Lock OTP %i failed\n", word);
return ret;
}
}
return 0;
}
static int confirm_prog(void)
@ -66,36 +152,113 @@ static int confirm_prog(void)
return 0;
}
static int do_stm32key(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
static int do_stm32key_read(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
u32 addr;
const char *op = argc >= 2 ? argv[1] : NULL;
int confirmed = argc > 3 && !strcmp(argv[2], "-y");
argc -= 2 + confirmed;
argv += 2 + confirmed;
if (argc == 1) {
read_hash_otp(true, NULL, NULL);
return CMD_RET_SUCCESS;
}
if (argc < 1)
return CMD_RET_USAGE;
addr = simple_strtoul(argv[0], NULL, 16);
addr = simple_strtoul(argv[1], NULL, 16);
if (!addr)
return CMD_RET_USAGE;
if (!strcmp(op, "read"))
read_hash_value(addr);
if (!strcmp(op, "fuse")) {
if (!confirmed && !confirm_prog())
return CMD_RET_FAILURE;
fuse_hash_value(addr, !confirmed);
}
read_hash_value(addr);
return CMD_RET_SUCCESS;
}
U_BOOT_CMD(stm32key, 4, 1, do_stm32key,
"Fuse ST Hash key",
"read <addr>: Read the hash store at addr in memory\n"
"stm32key fuse [-y] <addr> : Fuse hash store at addr in otp\n");
static int do_stm32key_fuse(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
u32 addr;
bool yes = false, lock, closed;
if (argc < 2)
return CMD_RET_USAGE;
if (argc == 3) {
if (strcmp(argv[1], "-y"))
return CMD_RET_USAGE;
yes = true;
}
addr = simple_strtoul(argv[argc - 1], NULL, 16);
if (!addr)
return CMD_RET_USAGE;
if (read_hash_otp(!yes, &lock, &closed) != -ENOENT) {
printf("Error: can't fuse again the OTP\n");
return CMD_RET_FAILURE;
}
if (lock || closed) {
printf("Error: invalid OTP configuration (lock=%d, closed=%d)\n", lock, closed);
return CMD_RET_FAILURE;
}
if (!yes && !confirm_prog())
return CMD_RET_FAILURE;
if (fuse_hash_value(addr, !yes))
return CMD_RET_FAILURE;
printf("Hash key updated !\n");
return CMD_RET_SUCCESS;
}
static int do_stm32key_close(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
bool yes, lock, closed;
struct udevice *dev;
u32 val;
int ret;
yes = false;
if (argc == 2) {
if (strcmp(argv[1], "-y"))
return CMD_RET_USAGE;
yes = true;
}
if (read_hash_otp(!yes, &lock, &closed))
return CMD_RET_FAILURE;
if (closed) {
printf("Error: already closed!\n");
return CMD_RET_FAILURE;
}
if (!lock)
printf("Warning: OTP not locked, revocation is possible!\n");
if (!yes && !confirm_prog())
return CMD_RET_FAILURE;
ret = get_misc_dev(&dev);
if (ret)
return CMD_RET_FAILURE;
val = STM32_OTP_CLOSE_MASK;
ret = misc_write(dev, STM32_BSEC_OTP(STM32_OTP_CLOSE_ID), &val, 4);
if (ret != 4) {
printf("Error: can't update OTP\n");
return CMD_RET_FAILURE;
}
printf("Device is closed !\n");
return CMD_RET_SUCCESS;
}
static char stm32key_help_text[] =
"read [<addr>]: Read the hash stored at addr in memory or in OTP\n"
"stm32key fuse [-y] <addr> : Fuse hash stored at addr in OTP\n"
"stm32key close [-y] : Close the device, the hash stored in OTP\n";
U_BOOT_CMD_WITH_SUBCMDS(stm32key, "Fuse ST Hash key", stm32key_help_text,
U_BOOT_SUBCMD_MKENT(read, 2, 0, do_stm32key_read),
U_BOOT_SUBCMD_MKENT(fuse, 3, 0, do_stm32key_fuse),
U_BOOT_SUBCMD_MKENT(close, 2, 0, do_stm32key_close));

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

@ -45,14 +45,13 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc,
bool reset = false;
struct image_header_s header;
struct stm32prog_data *data;
u32 uimage, dtb;
if (argc < 3 || argc > 5)
return CMD_RET_USAGE;
if (!strcmp(argv[1], "usb"))
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 +72,18 @@ 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");
#if defined(CONFIG_LEGACY_IMAGE_FORMAT)
/* 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");
#endif
}
}
if (IS_ENABLED(CONFIG_DM_VIDEO))
@ -97,7 +99,7 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc,
ret = stm32prog_init(data, addr, size);
if (ret)
printf("Invalid or missing layout file.");
log_debug("Invalid or missing layout file at 0x%lx.\n", addr);
/* prepare DFU for device read/write */
ret = stm32prog_dfu_init(data);
@ -118,21 +120,23 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc,
goto cleanup;
}
uimage = data->uimage;
dtb = data->dtb;
stm32prog_clean(data);
free(stm32prog_data);
stm32prog_data = NULL;
puts("Download done\n");
if (uimage) {
if (data->uimage) {
char boot_addr_start[20];
char dtb_addr[20];
char initrd_addr[40];
char *bootm_argv[5] = {
"bootm", boot_addr_start, "-", dtb_addr, NULL
};
u32 uimage = data->uimage;
u32 dtb = data->dtb;
u32 initrd = data->initrd;
if (!dtb)
bootm_argv[3] = env_get("fdtcontroladdr");
else
@ -141,8 +145,15 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc,
snprintf(boot_addr_start, sizeof(boot_addr_start) - 1,
"0x%x", uimage);
printf("Booting kernel at %s - %s...\n\n\n",
boot_addr_start, bootm_argv[3]);
if (initrd) {
snprintf(initrd_addr, sizeof(initrd_addr) - 1, "0x%x:0x%x",
initrd, data->initrd_size);
bootm_argv[2] = initrd_addr;
}
printf("Booting kernel at %s %s %s...\n\n\n",
boot_addr_start, bootm_argv[2], bootm_argv[3]);
/* Try bootm for legacy and FIT format image */
if (genimg_get_format((void *)uimage) != IMAGE_FORMAT_INVALID)
do_bootm(cmdtp, 0, 4, bootm_argv);
@ -166,14 +177,15 @@ cleanup:
}
U_BOOT_CMD(stm32prog, 5, 0, do_stm32prog,
"start communication with tools STM32Cubeprogrammer",
"<link> <dev> [<addr>] [<size>]\n"
"start communication with tools STM32Cubeprogrammer on <link> with Flashlayout at <addr>",
"<link> = serial|usb\n"
"<dev> = device instance\n"
"<addr> = address of flashlayout\n"
"<size> = size of flashlayout\n"
" <link> = serial|usb\n"
" <dev> = device instance\n"
" <addr> = address of flashlayout\n"
" <size> = size of flashlayout (optional for image with STM32 header)\n"
);
#ifdef CONFIG_STM32MP15x_STM32IMAGE
bool stm32prog_get_tee_partitions(void)
{
if (stm32prog_data)
@ -181,6 +193,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;
}
@ -1130,7 +1153,10 @@ static int dfu_init_entities(struct stm32prog_data *data)
struct dfu_entity *dfu;
int alt_nb;
alt_nb = 3; /* number of virtual = CMD, OTP, PMIC*/
alt_nb = 2; /* number of virtual = CMD, OTP*/
if (CONFIG_IS_ENABLED(DM_PMIC))
alt_nb++; /* PMIC NVMEM*/
if (data->part_nb == 0)
alt_nb++; /* +1 for FlashLayout */
else
@ -1176,13 +1202,13 @@ static int dfu_init_entities(struct stm32prog_data *data)
}
if (!ret)
ret = stm32prog_alt_add_virt(dfu, "virtual", PHASE_CMD, 512);
ret = stm32prog_alt_add_virt(dfu, "virtual", PHASE_CMD, CMD_SIZE);
if (!ret)
ret = stm32prog_alt_add_virt(dfu, "OTP", PHASE_OTP, 512);
ret = stm32prog_alt_add_virt(dfu, "OTP", PHASE_OTP, OTP_SIZE);
if (!ret && CONFIG_IS_ENABLED(DM_PMIC))
ret = stm32prog_alt_add_virt(dfu, "PMIC", PHASE_PMIC, 8);
ret = stm32prog_alt_add_virt(dfu, "PMIC", PHASE_PMIC, PMIC_SIZE);
if (ret)
stm32prog_err("dfu init failed: %d", ret);
@ -1410,7 +1436,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 +1446,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;
@ -1451,7 +1479,7 @@ error:
return ret;
}
static void stm32prog_end_phase(struct stm32prog_data *data)
static void stm32prog_end_phase(struct stm32prog_data *data, u64 offset)
{
if (data->phase == PHASE_FLASHLAYOUT) {
if (parse_flash_layout(data, STM32_DDR_BASE, 0))
@ -1467,6 +1495,10 @@ static void stm32prog_end_phase(struct stm32prog_data *data)
data->uimage = data->cur_part->addr;
if (data->cur_part->part_type == PART_FILESYSTEM)
data->dtb = data->cur_part->addr;
if (data->cur_part->part_type == PART_BINARY) {
data->initrd = data->cur_part->addr;
data->initrd_size = offset;
}
}
if (CONFIG_IS_ENABLED(MMC) &&
@ -1706,7 +1738,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 */
@ -1726,7 +1757,7 @@ void dfu_flush_callback(struct dfu_entity *dfu)
if (dfu->dev_type == DFU_DEV_RAM) {
if (dfu->alt == 0 &&
stm32prog_data->phase == PHASE_FLASHLAYOUT) {
stm32prog_end_phase(stm32prog_data);
stm32prog_end_phase(stm32prog_data, dfu->offset);
/* waiting DFU DETACH for reenumeration */
}
}
@ -1735,7 +1766,7 @@ void dfu_flush_callback(struct dfu_entity *dfu)
return;
if (dfu->alt == stm32prog_data->cur_part->alt_id) {
stm32prog_end_phase(stm32prog_data);
stm32prog_end_phase(stm32prog_data, dfu->offset);
stm32prog_next_phase(stm32prog_data);
}
}
@ -1755,3 +1786,17 @@ void dfu_initiated_callback(struct dfu_entity *dfu)
pr_debug("dfu offset = 0x%llx\n", dfu->offset);
}
}
void dfu_error_callback(struct dfu_entity *dfu, const char *msg)
{
struct stm32prog_data *data = stm32prog_data;
if (!stm32prog_data)
return;
if (!stm32prog_data->cur_part)
return;
if (dfu->alt == stm32prog_data->cur_part->alt_id)
stm32prog_err(msg);
}

View File

@ -19,6 +19,7 @@
#define DEFAULT_ADDRESS 0xFFFFFFFF
#define CMD_SIZE 512
#define OTP_SIZE 1024
#define PMIC_SIZE 8
@ -37,8 +38,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 +122,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 +135,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;
@ -141,6 +145,8 @@ struct stm32prog_data {
/* bootm information */
u32 uimage;
u32 dtb;
u32 initrd;
u32 initrd_size;
};
extern struct stm32prog_data *stm32prog_data;
@ -160,8 +166,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 +183,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

@ -10,6 +10,7 @@
#include <malloc.h>
#include <serial.h>
#include <watchdog.h>
#include <asm/arch/sys_proto.h>
#include <dm/lists.h>
#include <dm/device-internal.h>
#include <linux/delay.h>
@ -18,8 +19,7 @@
/* - configuration part -----------------------------*/
#define USART_BL_VERSION 0x40 /* USART bootloader version V4.0*/
#define UBOOT_BL_VERSION 0x03 /* bootloader version V0.3*/
#define DEVICE_ID_BYTE1 0x05 /* MSB byte of device ID*/
#define DEVICE_ID_BYTE2 0x00 /* LSB byte of device ID*/
#define USART_RAM_BUFFER_SIZE 256 /* Size of USART_RAM_Buf buffer*/
/* - Commands -----------------------------*/
@ -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)
@ -513,10 +435,12 @@ static void get_version_command(struct stm32prog_data *data)
*/
static void get_id_command(struct stm32prog_data *data)
{
u32 cpu = get_cpu_dev();
/* Send Device IDCode */
stm32prog_serial_putc(0x1);
stm32prog_serial_putc(DEVICE_ID_BYTE1);
stm32prog_serial_putc(DEVICE_ID_BYTE2);
stm32prog_serial_putc((cpu >> 8) & 0xFF);
stm32prog_serial_putc(cpu & 0xFF);
stm32prog_serial_result(ACK_BYTE);
}
@ -645,14 +569,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 +608,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 +657,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 +675,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

@ -178,7 +178,7 @@ int stm32prog_get_medium_size_virt(struct dfu_entity *dfu, u64 *size)
switch (dfu->data.virt.dev_num) {
case PHASE_CMD:
*size = 512;
*size = CMD_SIZE;
break;
case PHASE_OTP:
*size = OTP_SIZE;
@ -207,13 +207,10 @@ bool stm32prog_usb_loop(struct stm32prog_data *data, int dev)
if (stm32prog_data->phase == PHASE_FLASHLAYOUT) {
ret = run_usb_dnl_gadget(dev, "usb_dnl_dfu");
if (ret || stm32prog_data->phase == PHASE_DO_RESET)
if (ret || stm32prog_data->phase != PHASE_FLASHLAYOUT)
return ret;
/* prepare the second enumeration with the FlashLayout */
if (stm32prog_data->phase == PHASE_FLASHLAYOUT)
stm32prog_dfu_init(data);
/* found next selected partition */
stm32prog_next_phase(data);
stm32prog_dfu_init(data);
}
ret = run_usb_dnl_gadget(dev, "usb_dnl_dfu");

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

@ -9,6 +9,7 @@
#include <env.h>
#include <init.h>
#include <log.h>
#include <lmb.h>
#include <misc.h>
#include <net.h>
#include <asm/io.h>
@ -86,6 +87,8 @@
*/
u8 early_tlb[PGTABLE_SIZE] __section(".data") __aligned(0x4000);
struct lmb lmb;
#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
#ifndef CONFIG_TFABOOT
static void security_init(void)
@ -207,6 +210,44 @@ u32 get_bootmode(void)
TAMP_BOOT_MODE_SHIFT;
}
/*
* weak function overidde: set the DDR/SYSRAM executable before to enable the
* MMU and configure DACR, for early early_enable_caches (SPL or pre-reloc)
*/
void dram_bank_mmu_setup(int bank)
{
struct bd_info *bd = gd->bd;
int i;
phys_addr_t start;
phys_size_t size;
bool use_lmb = false;
enum dcache_option option;
if (IS_ENABLED(CONFIG_SPL_BUILD)) {
#ifdef CONFIG_SPL
start = ALIGN_DOWN(STM32_SYSRAM_BASE, MMU_SECTION_SIZE);
size = ALIGN(STM32_SYSRAM_SIZE, MMU_SECTION_SIZE);
#endif
} else if (gd->flags & GD_FLG_RELOC) {
/* bd->bi_dram is available only after relocation */
start = bd->bi_dram[bank].start;
size = bd->bi_dram[bank].size;
use_lmb = true;
} else {
/* mark cacheable and executable the beggining of the DDR */
start = STM32_DDR_BASE;
size = CONFIG_DDR_CACHEABLE_SIZE;
}
for (i = start >> MMU_SECTION_SHIFT;
i < (start >> MMU_SECTION_SHIFT) + (size >> MMU_SECTION_SHIFT);
i++) {
option = DCACHE_DEFAULT_OPTION;
if (use_lmb && lmb_is_reserved_flags(&lmb, i << MMU_SECTION_SHIFT, LMB_NOMAP))
option = INVALID_ENTRY;
set_section_dcache(i, option);
}
}
/*
* initialize the MMU and activate cache in SPL or in U-Boot pre-reloc stage
* MMU/TLB is updated in enable_caches() for U-Boot after relocation
@ -219,19 +260,13 @@ 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
/* enable MMU (default configuration) */
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),
DCACHE_DEFAULT_OPTION);
else
mmu_set_region_dcache_behaviour(STM32_DDR_BASE, STM32_DDR_SIZE,
DCACHE_DEFAULT_OPTION);
}
/*
@ -260,7 +295,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) && \
@ -274,6 +310,9 @@ int arch_cpu_init(void)
void enable_caches(void)
{
/* parse device tree when data cache is still activated */
lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob);
/* I-cache is already enabled in start.S: icache_enable() not needed */
/* deactivate the data cache, early enabled in arch_cpu_init() */
@ -460,7 +499,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 +508,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 + 1, 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");
@ -509,7 +552,9 @@ static void setup_boot_mode(void)
env_set("boot_instance", "0");
break;
default:
pr_debug("unexpected boot mode = %x\n", boot_mode);
env_set("boot_device", "invalid");
env_set("boot_instance", "");
log_err("unexpected boot mode = %x\n", boot_mode);
break;
}

View File

@ -10,6 +10,7 @@
#include <lmb.h>
#include <log.h>
#include <ram.h>
#include <asm/system.h>
DECLARE_GLOBAL_DATA_PTR;
@ -38,17 +39,27 @@ int dram_init(void)
ulong board_get_usable_ram_top(ulong total_size)
{
phys_size_t size;
phys_addr_t reg;
struct lmb lmb;
if (!total_size)
return gd->ram_top;
/* found enough not-reserved memory to relocated U-Boot */
lmb_init(&lmb);
lmb_add(&lmb, gd->ram_base, gd->ram_size);
boot_fdt_add_mem_rsv_regions(&lmb, (void *)gd->fdt_blob);
reg = lmb_alloc(&lmb, CONFIG_SYS_MALLOC_LEN + total_size, SZ_4K);
/* add 8M for reserved memory for display, fdt, gd,... */
size = ALIGN(SZ_8M + CONFIG_SYS_MALLOC_LEN + total_size, MMU_SECTION_SIZE),
reg = lmb_alloc(&lmb, size, MMU_SECTION_SIZE);
if (reg)
return ALIGN(reg + CONFIG_SYS_MALLOC_LEN + total_size, SZ_4K);
if (!reg)
reg = gd->ram_top - size;
return gd->ram_top;
/* before relocation, mark the U-Boot memory as cacheable by default */
if (!(gd->flags & GD_FLG_RELOC))
mmu_set_region_dcache_behaviour(reg, size, DCACHE_DEFAULT_OPTION);
return reg + size;
}

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

@ -4,6 +4,7 @@
*/
#include <common.h>
#include <clk.h>
#include <dm.h>
#include <syscon.h>
#include <asm/arch/stm32.h>
@ -14,9 +15,22 @@ static const struct udevice_id stm32mp_syscon_ids[] = {
{ }
};
static int stm32mp_syscon_probe(struct udevice *dev)
{
struct clk_bulk clk_bulk;
int ret;
ret = clk_get_bulk(dev, &clk_bulk);
if (!ret)
clk_enable_bulk(&clk_bulk);
return 0;
}
U_BOOT_DRIVER(syscon_stm32mp) = {
.name = "stmp32mp_syscon",
.id = UCLASS_SYSCON,
.of_match = stm32mp_syscon_ids,
.bind = dm_scan_fdt_dev,
.probe = stm32mp_syscon_probe,
};

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

@ -551,9 +551,6 @@ int board_init(void)
/* address of boot parameters */
gd->bd->bi_boot_params = STM32_DDR_BASE + 0x100;
if (CONFIG_IS_ENABLED(DM_GPIO_HOG))
gpio_hog_probe_all();
board_key_check();
#ifdef CONFIG_DM_REGULATOR
@ -610,7 +607,7 @@ void board_quiesce_devices(void)
/* eth init function : weak called in eqos driver */
int board_interface_eth_init(struct udevice *dev,
phy_interface_t interface_type)
phy_interface_t interface_type, ulong rate)
{
u8 *syscfg;
u32 value;
@ -618,11 +615,11 @@ int board_interface_eth_init(struct udevice *dev,
bool eth_ref_clk_sel_reg = false;
/* Gigabit Ethernet 125MHz clock selection. */
eth_clk_sel_reg = dev_read_bool(dev, "st,eth_clk_sel");
eth_clk_sel_reg = dev_read_bool(dev, "st,eth-clk-sel");
/* Ethernet 50Mhz RMII clock selection */
eth_ref_clk_sel_reg =
dev_read_bool(dev, "st,eth_ref_clk_sel");
dev_read_bool(dev, "st,eth-ref-clk-sel");
syscfg = (u8 *)syscon_get_first_range(STM32MP_SYSCON_SYSCFG);

View File

@ -485,7 +485,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
* should be more intelligent, and e.g. only do this if no enabled DT
* node exists for the "real" graphics driver.
*/
lcd_dt_simplefb_add_node(blob);
fdt_simplefb_add_node(blob);
#ifdef CONFIG_EFI_LOADER
/* Reserve the spin table */

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

@ -10,11 +10,13 @@
#include <dm.h>
#include <env.h>
#include <env_internal.h>
#include <fdt_simplefb.h>
#include <fdt_support.h>
#include <g_dnl.h>
#include <generic-phy.h>
#include <hang.h>
#include <i2c.h>
#include <regmap.h>
#include <init.h>
#include <led.h>
#include <log.h>
@ -66,16 +68,6 @@
#define SYSCFG_CMPENSETR_MPU_EN BIT(0)
#define SYSCFG_PMCSETR_ETH_CLK_SEL BIT(16)
#define SYSCFG_PMCSETR_ETH_REF_CLK_SEL BIT(17)
#define SYSCFG_PMCSETR_ETH_SELMII BIT(20)
#define SYSCFG_PMCSETR_ETH_SEL_MASK GENMASK(23, 21)
#define SYSCFG_PMCSETR_ETH_SEL_GMII_MII 0
#define SYSCFG_PMCSETR_ETH_SEL_RGMII BIT(21)
#define SYSCFG_PMCSETR_ETH_SEL_RMII BIT(23)
/*
* Get a global data pointer
*/
@ -101,7 +93,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";
@ -153,6 +147,7 @@ static void board_key_check(void)
debug("%s: could not find a /config/st,fastboot-gpios\n",
__func__);
} else {
udelay(20);
if (dm_gpio_get_value(&gpio)) {
puts("Fastboot key pressed, ");
boot_mode = BOOT_FASTBOOT;
@ -167,6 +162,7 @@ static void board_key_check(void)
debug("%s: could not find a /config/st,stm32prog-gpios\n",
__func__);
} else {
udelay(20);
if (dm_gpio_get_value(&gpio)) {
puts("STM32Programmer key pressed, ");
boot_mode = BOOT_STM32PROG;
@ -288,42 +284,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 +319,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 +331,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 +598,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;
@ -627,9 +643,6 @@ int board_init(void)
/* address of boot parameters */
gd->bd->bi_boot_params = STM32_DDR_BASE + 0x100;
if (CONFIG_IS_ENABLED(DM_GPIO_HOG))
gpio_hog_probe_all();
board_key_check();
if (board_is_ev1())
@ -707,74 +720,112 @@ void board_quiesce_devices(void)
setup_led(LEDST_OFF);
}
/* CLOCK feed to PHY*/
#define ETH_CK_F_25M 25000000
#define ETH_CK_F_50M 50000000
#define ETH_CK_F_125M 125000000
struct stm32_syscfg_pmcsetr {
u32 syscfg_clr_off;
u32 eth1_clk_sel;
u32 eth1_ref_clk_sel;
u32 eth1_sel_mii;
u32 eth1_sel_rgmii;
u32 eth1_sel_rmii;
u32 eth2_clk_sel;
u32 eth2_ref_clk_sel;
u32 eth2_sel_rgmii;
u32 eth2_sel_rmii;
};
const struct stm32_syscfg_pmcsetr stm32mp15_syscfg_pmcsetr = {
.syscfg_clr_off = 0x44,
.eth1_clk_sel = BIT(16),
.eth1_ref_clk_sel = BIT(17),
.eth1_sel_mii = BIT(20),
.eth1_sel_rgmii = BIT(21),
.eth1_sel_rmii = BIT(23),
.eth2_clk_sel = 0,
.eth2_ref_clk_sel = 0,
.eth2_sel_rgmii = 0,
.eth2_sel_rmii = 0
};
#define SYSCFG_PMCSETR_ETH_MASK GENMASK(23, 16)
#define SYSCFG_PMCR_ETH_SEL_GMII 0
/* eth init function : weak called in eqos driver */
int board_interface_eth_init(struct udevice *dev,
phy_interface_t interface_type)
phy_interface_t interface_type, ulong rate)
{
u8 *syscfg;
struct regmap *regmap;
uint regmap_mask;
int ret;
u32 value;
bool eth_clk_sel_reg = false;
bool eth_ref_clk_sel_reg = false;
bool ext_phyclk, eth_clk_sel_reg, eth_ref_clk_sel_reg;
const struct stm32_syscfg_pmcsetr *pmcsetr;
/* Ethernet PHY have no crystal */
ext_phyclk = dev_read_bool(dev, "st,ext-phyclk");
/* Gigabit Ethernet 125MHz clock selection. */
eth_clk_sel_reg = dev_read_bool(dev, "st,eth_clk_sel");
eth_clk_sel_reg = dev_read_bool(dev, "st,eth-clk-sel");
/* Ethernet 50Mhz RMII clock selection */
eth_ref_clk_sel_reg =
dev_read_bool(dev, "st,eth_ref_clk_sel");
eth_ref_clk_sel_reg = dev_read_bool(dev, "st,eth-ref-clk-sel");
syscfg = (u8 *)syscon_get_first_range(STM32MP_SYSCON_SYSCFG);
pmcsetr = &stm32mp15_syscfg_pmcsetr;
if (!syscfg)
regmap = syscon_regmap_lookup_by_phandle(dev, "st,syscon");
if (!IS_ERR(regmap)) {
u32 fmp[3];
ret = dev_read_u32_array(dev, "st,syscon", fmp, 3);
if (ret)
/* If no mask in DT, it is MP15 (backward compatibility) */
regmap_mask = SYSCFG_PMCSETR_ETH_MASK;
else
regmap_mask = fmp[2];
} else {
return -ENODEV;
}
switch (interface_type) {
case PHY_INTERFACE_MODE_MII:
value = SYSCFG_PMCSETR_ETH_SEL_GMII_MII |
SYSCFG_PMCSETR_ETH_REF_CLK_SEL;
debug("%s: PHY_INTERFACE_MODE_MII\n", __func__);
value = pmcsetr->eth1_sel_mii;
log_debug("PHY_INTERFACE_MODE_MII\n");
break;
case PHY_INTERFACE_MODE_GMII:
if (eth_clk_sel_reg)
value = SYSCFG_PMCSETR_ETH_SEL_GMII_MII |
SYSCFG_PMCSETR_ETH_CLK_SEL;
else
value = SYSCFG_PMCSETR_ETH_SEL_GMII_MII;
debug("%s: PHY_INTERFACE_MODE_GMII\n", __func__);
value = SYSCFG_PMCR_ETH_SEL_GMII;
log_debug("PHY_INTERFACE_MODE_GMII\n");
break;
case PHY_INTERFACE_MODE_RMII:
if (eth_ref_clk_sel_reg)
value = SYSCFG_PMCSETR_ETH_SEL_RMII |
SYSCFG_PMCSETR_ETH_REF_CLK_SEL;
else
value = SYSCFG_PMCSETR_ETH_SEL_RMII;
debug("%s: PHY_INTERFACE_MODE_RMII\n", __func__);
value = pmcsetr->eth1_sel_rmii;
if (rate == ETH_CK_F_50M && (eth_clk_sel_reg || ext_phyclk))
value |= pmcsetr->eth1_ref_clk_sel;
log_debug("PHY_INTERFACE_MODE_RMII\n");
break;
case PHY_INTERFACE_MODE_RGMII:
case PHY_INTERFACE_MODE_RGMII_ID:
case PHY_INTERFACE_MODE_RGMII_RXID:
case PHY_INTERFACE_MODE_RGMII_TXID:
if (eth_clk_sel_reg)
value = SYSCFG_PMCSETR_ETH_SEL_RGMII |
SYSCFG_PMCSETR_ETH_CLK_SEL;
else
value = SYSCFG_PMCSETR_ETH_SEL_RGMII;
debug("%s: PHY_INTERFACE_MODE_RGMII\n", __func__);
value = pmcsetr->eth1_sel_rgmii;
if (rate == ETH_CK_F_125M && (eth_clk_sel_reg || ext_phyclk))
value |= pmcsetr->eth1_clk_sel;
log_debug("PHY_INTERFACE_MODE_RGMII\n");
break;
default:
debug("%s: Do not manage %d interface\n",
__func__, interface_type);
log_debug("Do not manage %d interface\n", interface_type);
/* Do not manage others interfaces */
return -EINVAL;
}
/* clear and set ETH configuration bits */
writel(SYSCFG_PMCSETR_ETH_SEL_MASK | SYSCFG_PMCSETR_ETH_SELMII |
SYSCFG_PMCSETR_ETH_REF_CLK_SEL | SYSCFG_PMCSETR_ETH_CLK_SEL,
syscfg + SYSCFG_PMCCLRR);
writel(value, syscfg + SYSCFG_PMCSETR);
/* Need to update PMCCLRR (clear register) */
regmap_write(regmap, pmcsetr->syscfg_clr_off, regmap_mask);
return 0;
ret = regmap_update_bits(regmap, SYSCFG_PMCSETR, regmap_mask, value);
return ret;
}
enum env_location env_get_location(enum env_operation op, int prio)
@ -832,10 +883,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 +906,17 @@ 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));
if (CONFIG_IS_ENABLED(FDT_SIMPLEFB))
fdt_simplefb_add_node_and_mem_rsv(blob);
return 0;
}

View File

@ -13,6 +13,8 @@
#include <mapmem.h>
#include <lcd.h>
#include <net.h>
#include <fdt_support.h>
#include <linux/libfdt.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include <errno.h>
@ -284,6 +286,9 @@ static void label_destroy(struct pxe_label *label)
if (label->fdtdir)
free(label->fdtdir);
if (label->fdtoverlays)
free(label->fdtoverlays);
free(label);
}
@ -331,6 +336,92 @@ static int label_localboot(struct pxe_label *label)
return run_command_list(localcmd, strlen(localcmd), 0);
}
/*
* Loads fdt overlays specified in 'fdtoverlays'.
*/
#ifdef CONFIG_OF_LIBFDT_OVERLAY
static void label_boot_fdtoverlay(struct cmd_tbl *cmdtp, struct pxe_label *label)
{
char *fdtoverlay = label->fdtoverlays;
struct fdt_header *working_fdt;
char *fdtoverlay_addr_env;
ulong fdtoverlay_addr;
ulong fdt_addr;
int err;
/* Get the main fdt and map it */
fdt_addr = simple_strtoul(env_get("fdt_addr_r"), NULL, 16);
working_fdt = map_sysmem(fdt_addr, 0);
err = fdt_check_header(working_fdt);
if (err)
return;
/* Get the specific overlay loading address */
fdtoverlay_addr_env = env_get("fdtoverlay_addr_r");
if (!fdtoverlay_addr_env) {
printf("Invalid fdtoverlay_addr_r for loading overlays\n");
return;
}
fdtoverlay_addr = simple_strtoul(fdtoverlay_addr_env, NULL, 16);
/* Cycle over the overlay files and apply them in order */
do {
struct fdt_header *blob;
char *overlayfile;
char *end;
int len;
/* Drop leading spaces */
while (*fdtoverlay == ' ')
++fdtoverlay;
/* Copy a single filename if multiple provided */
end = strstr(fdtoverlay, " ");
if (end) {
len = (int)(end - fdtoverlay);
overlayfile = malloc(len + 1);
strncpy(overlayfile, fdtoverlay, len);
overlayfile[len] = '\0';
} else
overlayfile = fdtoverlay;
if (!strlen(overlayfile))
goto skip_overlay;
/* Load overlay file */
err = get_relfile_envaddr(cmdtp, overlayfile,
"fdtoverlay_addr_r");
if (err < 0) {
printf("Failed loading overlay %s\n", overlayfile);
goto skip_overlay;
}
/* Resize main fdt */
fdt_shrink_to_minimum(working_fdt, 8192);
blob = map_sysmem(fdtoverlay_addr, 0);
err = fdt_check_header(blob);
if (err) {
printf("Invalid overlay %s, skipping\n",
overlayfile);
goto skip_overlay;
}
err = fdt_overlay_apply_verbose(working_fdt, blob);
if (err) {
printf("Failed to apply overlay %s, skipping\n",
overlayfile);
goto skip_overlay;
}
skip_overlay:
if (end)
free(overlayfile);
} while ((fdtoverlay = strstr(fdtoverlay, " ")));
}
#endif
/*
* Boot according to the contents of a pxe_label.
*
@ -525,6 +616,11 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
label->name);
goto cleanup;
}
#ifdef CONFIG_OF_LIBFDT_OVERLAY
if (label->fdtoverlays)
label_boot_fdtoverlay(cmdtp, label);
#endif
} else {
bootm_argv[3] = NULL;
}
@ -582,6 +678,7 @@ enum token_type {
T_INCLUDE,
T_FDT,
T_FDTDIR,
T_FDTOVERLAYS,
T_ONTIMEOUT,
T_IPAPPEND,
T_BACKGROUND,
@ -616,6 +713,7 @@ static const struct token keywords[] = {
{"fdt", T_FDT},
{"devicetreedir", T_FDTDIR},
{"fdtdir", T_FDTDIR},
{"fdtoverlays", T_FDTOVERLAYS},
{"ontimeout", T_ONTIMEOUT,},
{"ipappend", T_IPAPPEND,},
{"background", T_BACKGROUND,},
@ -1048,6 +1146,11 @@ static int parse_label(char **c, struct pxe_menu *cfg)
err = parse_sliteral(c, &label->fdtdir);
break;
case T_FDTOVERLAYS:
if (!label->fdtoverlays)
err = parse_sliteral(c, &label->fdtoverlays);
break;
case T_LOCALBOOT:
label->localboot = 1;
err = parse_integer(c, &label->localboot_val);

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