Commit Graph

75341 Commits

Author SHA1 Message Date
ccb3a05989 video: add support of panel Rocktech HX8394
Support for Rocktech HX8394 720p dsi 2dl video mode panel.
This panel driver is based on the Linux Kernel driver from
drivers/gpu/drm/panel/panel-rocktech-hx8394.c.

Change-Id: I116af7c59e8e77217337b25d27beb45d08028500
Signed-off-by: Yannick FERTRE <yannick.fertre@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/236113
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>
2022-05-25 16:01:02 +02:00
4a22117825 board: st: common: fix the error messages in stboard command
Add missing \n at the end of the error trace

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Id540e65885e62d3a51328b7f4205a137cd249537
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/244757
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-05-25 16:01:02 +02:00
ab357b2439 board: stm32mp1: add detection of GC2145 camera sensor
Detect the GC2145 camera sensor connected to the stm32mp135f-dk
board in order to enable instead the OV5640 if the GC2145 isn't
detected via I2C.  For that purpose, necessary dependencies
(regulator / gpio) are enabled and GC2145 ID registers are checked
to determine if the GC2145 is attached or not.  If it isn't found,
then the device-tree is updated (camera nodes status & stmipid02
CSI bridge remote node phandle) to enable the OV5640 sensor
and the remote-endpoint property setting in the ov5640 to
make it point to the stmipi endpoint node.
This remote-endpoint property is not setted within the DT by
default in order to avoid a non birectionnal graph connection
warning during DT build.

Change-Id: If56f670e530158d21926148eadb9ec004797ac20
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/242645
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/245022
2022-05-25 16:01:02 +02:00
83a972e588 board: st: stm32mp1: touchscreen detection for stm32mp15 dk2 board
Add I2C touchscreen detection for DK2 board only.

Signed-off-by: Yannick FERTRE <yannick.fertre@foss.st.com>
Change-Id: I8356297906cdf741476c31d01cea0e3510ec8cfe
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/241991
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>
2022-05-25 16:01:02 +02:00
3ed350c2a1 configs: stm32mp1: set the console variable for extlinux.conf
Set the environment variable "console", used in extlinux.conf file when it
is generated by YOCTO in OpenSTLinux distribution:

UBOOT_EXTLINUX_CONSOLE ??= "console=${console},${baudrate}"

With these 2 variables, U-Boot give dynamically the used console and
baudrate in the Linux kernel bootargs.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I23ed8b36e294031f1f614d2304ea17085f075612
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/241463
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-05-25 16:01:02 +02:00
3076f946b7 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/+/240655
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Philippe CORNU <philippe.cornu@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:02 +02:00
c92351ea00 stm32mp: stm32prog: handle flashlayout without STM32 image header
Accept flashlayout without header in alternate 0, to simplify
the support of stm32prog command with dfu-util.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I8052625ddd2a94516d82b9b7472a34ba52fbc2fa
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/240548
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2022-05-25 16:01:02 +02:00
f4037f75b6 stm32mp: stm32prog: handle U-Boot script in flashlayout alternate
Update the stm32prog command to allow the reception of U-Boot script in
the FlashLayout alternate during the first USB enumeration.

This patch is aligned with the last TF-A behavior: the Flashlayout
is now loaded by U-Boot; it is no more present at STM32_DDR_BASE when
the stm32prog is launched after a serial boot, on UART or on USB.

The received script must be a U-Boot legacy image, no more need to add
a stm32image header.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I08598ebf2b427ac25eaf56e05799ac8d2dc42947
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/240544
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2022-05-25 16:01:02 +02:00
4e4356e9c5 stm32mp: stm32prog: handle interruption during the first enumeration
When a interruption is received during the first USB enumeration
used to received the FlashLayout, with handle ctrl-c, the second
enumeration is not needed and the result for stm32prog_usb_loop
is false (reset is not needed).

This patch avoid the need of a second ctrl to interrupt the command
stm32prog.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ie76b6efe731c9d721b794d9ad6b394b38492a4df
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/240543
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2022-05-25 16:01:02 +02:00
ef28f3f0a6 ARM: stm32mp: skip ft_system_setup when the soc node is absent
The function ft_system_setup should don't return an error when the
/soc node is absent in the provided device tree but just skip the
updates.

This patch solves an issue when the U-Boot pytests is executed on board.

Signed-off-by: Sebastien Pasdeloup <sebastien.pasdeloup-ext@st.com>
Change-Id: Ic7fcf7558ba1c08e031b54acd7b9f3544addb1d8
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/234562
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>
2022-05-25 16:01:02 +02:00
699d8964ba dts: stm32mp1: use a specific GPT partition for environment
As the fip partition is duplicated in eMCC/SDCard for the firmware
update support in TF-A: "fip-a" and "fip-b",  the U-Boot use a dedicated
partition named "u-boot-env" to avoid issue when the FIP is updated by
the update agent.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I1fa341f578929363fb0f0194600009f6c6c9e8a8
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/238557
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-05-25 16:01:02 +02:00
d64ea4cb86 stm32mp: update MTD partitions for TF-A firmware update support
Add in MTD partitions the new partitions needed by TF-A firmware update:
- metadata to save the TF-A information: 2 copy
- fip-a / fip-b: two FIP slots, used for system A/B (seamless) update
- the previous "fsbl" partition with 2 copy of TFA is replaced
  by 2 partitions (only one copy in each MTD partition) to simplify
  the update: no need to managed this copy on update, need to update the
  two partition (skip bad block for NAND)

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ie51edf3fe13dabb66fde99eaf781fdd7b1990e3c
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/238556
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Nicolas TOROMANOFF <nicolas.toromanoff@st.com>
Tested-by: Nicolas TOROMANOFF <nicolas.toromanoff@st.com>
2022-05-25 16:01:02 +02:00
2f74425e8b stm32mp: stm32prog: add support of UUID for FIP partition
Add support of UUID for FIP parttion, required by Firmware update
support in TF-A:
- UUID TYPE for FIP partition: 19d5df83-11b0-457b-be2c-7559c13142a5
- "fip-a" partition UUID: 4fd84c93-54ef-463f-a7ef-ae25ff887087
- "fip-b" partition UUID: 09c54952-d5bf-45af-acee-335303766fb3

This check is done with a new partition type "FIP" associated
at the FIP UUID.

The A/B partition UUID is detected by the partition name:
"fip-a", "fip-b".

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I94e74b521fd55dcc68ab8d000cb93ef48fc12f14
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/238555
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-05-25 16:01:02 +02:00
e117c2ad32 pinctrl: pinctrl_stm32: Update pinmux_mode definition
pinmux_mode[] is linked to gpio_function[] defined in gpio-uclass.c
So reuse the same gpio_func_t enum value

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I284167e444a8b59066bff10ec2f92ac2b26a2d70
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/239115
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
(cherry picked from commit 312fccd8213bcdefe9d353e4b306748e7b49cd0c)
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/239880
Tested-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:02 +02:00
010f0e12ba env: mmc : align erase address and size on erase_grp_size
On eMMC, the erase_grp_size > 1 so the address and size for the erase
block command can be unaligned on erase group size and some strange
trace occurs and the result is not guarantee by MMC devices.

The SD-Card behavior don't change as erase_grp_size = 1 for SD-Card.

For example, on eMMC present on STM32MP15C-EV1, before the patch:

  STM32MP> env erase

  Erasing Environment on MMC...

  Caution! Your devices Erase group is 0x400
  The erase range would be change to 0x2000~0x27ff

  16 blocks erased: OK

  Caution! Your devices Erase group is 0x400
  The erase range would be change to 0x2000~0x23ff

  16 blocks erased: OK
  OK

After this patch:
  STM32MP> env erase
  Erasing Environment on MMC...
  1024 blocks erased at 0x2000: OK
  1024 blocks erased at 0x2000: OK
  OK

Here the 2 copies of U-Boot environment are in the same devices Erase
group: it is erased twice.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I26fa615c6898db0d17024664b17b20412638bfd7
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/238836
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2022-05-25 16:01:02 +02:00
cd3d4a9d1f mmc: fix error message for unaligned erase request
Fix the end address in the message for unaligned erase request in
mmc_berase() when start + blkcnt is aligned to erase_grp_size.

for example:
  - start = 0x2000 - 26
  - count = 26
  - erase_grp_size = 0x400

  Caution! Your devices Erase group is 0x400
  The erase range would be change to 0x2000~0x27ff

But no issue when the end address is not aligned, for example
  - start = 0x2000 - 2 * 26
  - count = 26
  - erase_grp_size = 0x400

  Caution! Your devices Erase group is 0x400
  The erase range would be change to 0x2000~0x23ff

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I5f92544259c3d1dad2df30c9d7762ec7860f07cf
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/238835
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Christophe KERELLO <christophe.kerello@st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2022-05-25 16:01:01 +02:00
8b9a2476b7 stm32mp1: Add support for baudrates higher than 115200 for st-link
On STMicroelectronics boards, the UART can reliably go up to
- 2000000 bauds when connected to the on-board ST-LINK-V2 for STM32MP15
- 12000000 bauds when connected to the external ST-LINKV3 for STM32MP13
Unfortunately U-Boot will fall back to 115200 unless higher rates are
declared via CONFIG_SYS_BAUDRATE_TABLE.

This patch add the support of higher baudrates on STMicroelectronics
boards with ST-LINK.

Cc: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Change-Id: Ie4aa91b7f1b08b59b02853e7f28c2b48445ba0f6
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/241313
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/239497
2022-05-25 16:01:01 +02:00
de79e6949f 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-by: Fabien DESSENNE <fabien.dessenne@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-05-25 16:01:01 +02:00
fba8d6b38c 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-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Fabien DESSENNE <fabien.dessenne@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
0e3c42448a iio: adc: stm32-adc: add support of generic channels binding
Add support of generic IIO channel binding:
./devicetree/bindings/iio/adc/adc.yaml
Keep support of st,adc-channels for backward compatibility.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Change-Id: Ifb433baf31af3661271d98b7c155958aa5f7afdb
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/238839
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>
2022-05-25 16:01:01 +02:00
423ebb16d2 stm32: adc: split channel init into several routines
Split stm32_adc_chan_of_init channel initialization function into
several routines to increase readability and prepare channel
generic binding handling.

Change-Id: Ifdbb454600c4e2d48e6dde70ff5354e4aaff9c17
Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/238838
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>
2022-05-25 16:01:01 +02:00
6ee50e27f0 ARM: stm32mp: add usb_pgood_delay for ST boards
With some USB device, usb_pgood_delay must be used to ensure
a correct detection.
Issue encountered with this USB flash disk :
ID 058f:6387 Alcor Micro Corp. Flash Drive

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I5ea27bfe1d09a754c91a12a15e003a6b5f21e9d1
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/237940
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>
2022-05-25 16:01:01 +02:00
8dfc59ce95 usb: husb: increase HUB_DEBOUNCE_TIMEOUT
Increase HUB_DEBOUNCE_TIMEOUT to 2000 because some usb device
needs around 1.5 or more to make the hub port status to be
connected steadily after being powered off and powered on.

These value is aligned with Linux driver and avoids to configure
"usb_pgood_delay" as a workaround for connection timeout on
some USB device; normally the env variable "usb_pgood_delay" is used
to delay the  first query after power ON and thus the device answer,
not to increase the connection timeout delay.

Commit-notes:
Hi,

I think this patch solves a general issue because a 1s timeout for
USB connection is too short on problematic USB keys.
The issue was introduced by the commit c998da0d67 ("usb: Change
power-on / scanning timeout handling")

Patch in usb_hub allow to avoid patch in each board/driver.

for example, commit 0417169054 ("imx: ventana: add usb_pgood_delay
2sec default") => use pgood_delay = 2s !?

("ARM: stm32: Increase USB power-good delay on DHSOM")
https://patchwork.ozlabs.org/project/uboot/patch/20211113022444.231801-1-marex@denx.de/

or commit 2bf352f0c1 ("usb: dwc2: Add delay to fix the USB
detection problem on SoCFPGA") => patch in USB DWC2 driver to add
a timeout in driver

the commit 319418c01c ("usb: hub: allow pgood_delay to be
specified via env") => introduce env variable for warm-up times

Patrick

END

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I5eabf3f9fdbbaf763cd44e9c018cb5b74a0c65ac
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/236836
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-05-25 16:01:01 +02:00
1d337aa8dc usb: hub: introduce HUB_DEBOUNCE_TIMEOUT
Introduce define for connection timeout, named HUB_DEBOUNCE_TIMEOUT
as in linux kernel drivers/usb/core/hub.c

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ic02e6fb44225d1cfe15506c7c85f70a0893fb880
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/236835
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Tested-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
2022-05-25 16:01:01 +02:00
d8c511144a ARM: dts: stm32mp15: remove addon for st,stm32-sdmmc2 compatible
Remove the U-Boot specific add-on for SDMMCv2 IP used in the STM32MP15
as this compatible "st,stm32-sdmmc2" is present in kernel device
tree v5.15-stm32mp-r1.

This patch reduces the device tree difference with kernel device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I1c465a221cb3da2c7b54cbf8467a0f97ba6f397e
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/195269
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-05-25 16:01:01 +02:00
c189609d33 mmc: stm32_sdmmc2: introduce of_to_plat ops
Add the uclass ops of_to_plat to parse the device tree properties
to respect the expected sequence by the driver model.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ie868aca1e057629eb212dcc3c8f463c00d01ccb7
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/235573
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Yann GAUTIER <yann.gautier@foss.st.com>
Reviewed-by: Christophe KERELLO <christophe.kerello@st.com>
2022-05-25 16:01:01 +02:00
9bbe98426b mmc: stm32_sdmmc2: remove privdata
All the elements of privdata are static and build from device tree,
they are moved in platdata to prepare the support of ops
of_to_plat.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Id78f6e3f0b5deebedc6e5f54dd99b855a163fd2c
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/235572
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Yann GAUTIER <yann.gautier@foss.st.com>
Reviewed-by: Christophe KERELLO <christophe.kerello@st.com>
2022-05-25 16:01:01 +02:00
3e6ec74c43 mmc: stm32_sdmmc2: cosmetic: rename stm32_sdmmc_bind
Rename stm32_sdmmc_bind to stm32_sdmmc2_bind as all oter function
in SDMMCv2 driver

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Idba00f2816d362a1675c8c74eac80400cb2e4de7
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/235571
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Yann GAUTIER <yann.gautier@foss.st.com>
Reviewed-by: Christophe KERELLO <christophe.kerello@st.com>
2022-05-25 16:01:01 +02:00
6ee1aad5b6 net: dwc_eth_qos: restore support of not cache-aligned descriptor
Solve a issue with AXI_WIDTH_32 on a the 64 bytes cache line platform;
in this case the requested descriptor padding length should be 12 but the
associated parameter EQOS_DMA_CH0_CONTROL.DSL is limited at 3bits = 7.

As the DMA descriptor can't be correctly aligned with the cache line,
the maintenance of each descriptor can't be guarantee by a simple cache
line operation: flush or invalid.

To avoid all the maintenance issues, these descripto need to be allocated
in a NOT CACHEABLE memory, allocated by noncached_alloc() when
CONFIG_SYS_NONCACHED_MEMORY is enable.

This patch don't change the current behavior when the descriptor
can be cache-aligned with the filed "Descriptor Skip Length" of
the DMA channel control register, when eqos->desc_pad = true.

Change-Id: Iada23492743e3af977e07c1f1b8c2f32550436f7
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/236650
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Christophe ROULLIER <christophe.roullier@st.com>
2022-05-25 16:01:01 +02:00
7c0508bcc8 power: regulator: stm32-verfbuf: add support from mp13
Add support for stm32mp13 verfbuf with minimal voltage value
of 1650mV.

Signed-off-by: Pascal Paillet <p.paillet@st.com>
Change-Id: I8fcea9fea3a379dad16816f38b75389f82c55bda
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/235947
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>
2022-05-25 16:01:01 +02:00
b25fc67425 clk: manage CLK_SET_RATE_PARENT flags on clk_set_rate()
Add possibility to propagate rate change up one level

Change-Id: I866d25a89cd351ea75cf7e4605397ebe20a60661
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/235018
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
5186289e66 clk: update clk_clean_rate_cache to use private clk struct
In clk_clean_rate_cache, clk->rate should update the private clock
struct when CCF is activated to save the cached rate value.

When clk_get_parent_rate is called, the cached information
is read from pclk->rate, with pclk = clk_get_parent(clk)
which use dev_get_clk_ptr() to access to private data.

As the cached is read from private clk data, the update should
be done also on it.

Series-cc: Tero Kristo <t-kristo@ti.com>
Series-cc: Tero Kristo <kristo@kernel.org>
Fixes: 6b7fd3128f ("clk: fix set_rate to clean up cached rates for the hierarchy")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ifa06360115ffa3f3307372e6cdd98ec16759d6ba
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/236864
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-05-25 16:01:01 +02:00
97402fc9a3 adc: manage pcsel on end of conversion
Some I/Os are connected to ADC input channels, when the corresponding bit
in PCSEL register are set on STM32H7 and STM32MP15.
PCSEL shouldn't be let enabled when VDDA supply is disabled, to avoid
current leakage. This may occur if the kernel disable the VDDA supply
of the ADC, while the PCSEL remains set, after leaving U-boot.
Clear PCSEL bits after each end of conversion, when relevant, to
prevent this case.

Change-Id: I147f128cd67392220a8924cf407bcdae0e1eb555
Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/233126
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
92f9ee4c50 adc: stm32mp15: probe all adc for calibration on stm32mp15x-dkx
Probe all ADCs on STM32MP15x-DKx boards to support ADC self
calibration.

Depends-on: If9af754d4b91146aafcd9129ba0d618693d75650

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Change-Id: I3f262c54cb05bb0b166ba81d3efbdc02e7ac2e4f
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/231399
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
5f2761e423 adc: stm32: add smart calibration support
Add smart calibration support for STM32MP1.
- STM32MP15x: both linear & offset calibration are supported
- STM32MP13x: Only offset calibration is supported

Linear calibration:
Linear calibration is SoC dependent and does not change over
time. As it is time consuming, do it only once.
Restore calibration data from environment variable to save time.
If no calibration data are found in u-boot environment variables
run a new calibration.

Offset calibration:
This calibration is fast and may vary over time.
Run offset single-ended and differential calibration on each boot.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Change-Id: If8739d96e019d42341901c5da6a83925cc78333a
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/231628
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
b1575c9704 ARM: dts: stm32: Remove u-boot,force-b-session-valid property for stm32mp157a-dk1-u-boot.dtsi
The property u-boot,force-b-session-valid becomes useless, remove it.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I1cc0013b51bd9a0ace665ebc1825edc654c7ca7a
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/232356
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
796429d01e ARM: dts: stm32: Remove u-boot,force-b-session-valid property for stm32mp135f-dk-u-boot.dtsi
The property u-boot,force-b-session-valid becomes useless, remove it.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: Ic21ce52024e4fe98f90332ebbd635fd080d81d6e
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/232355
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
f1ee2f5b66 usb: gadget: dwc2_udc_otg: Make usage of typec_get_driver_from_usb()
Before relying on u-boot,force-b-session-valid property presence to set
force_b_session_valid field, use typec_get_driver_from_usb() which check
if a Type-C connector is present. In this case invoke typec_get_data_role()
which indicates if current data role is DEVICE or HOST.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I3dc5da0c332c5b557a855564985317345d25458f
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/232354
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
d7cf053394 usb: typec: Add typec_get_driver_from_usb() API
The typec_get_driver_from_usb() allows to retrieve a Type-C device from
an USB device.
typec_get_driver_from_usb() checks in USB device node for port and endpoint
sub-node, if exist, retrieve the connector node, probe the associated
Type-C device and return it.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: If564cdf463f3915bec26f17a4717c9ab9d42f692
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/232353
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
7eeb19f152 configs: stm32mp13: Enable STM32G0 relative flags
Enable CONFIG_TYPEC, CONFIG_UCSI and CONFIG_UCSI_STM32G0 flags to be able to
detect USB cable attach/detach on stm32mp13 DK boards.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I4e63ba94d1066fbe9511e0397e1b410c2822eca2
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/232351
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
158eb2b33c usb: typec: ucsi: Add STM32G0 UCSI driver support
STM32GO provides an integrated USB Type-C interface.
It handles UCSI protocol over I2C and supports read and write
UCSI uclass ops.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I309b85859f94f284bb62bc3ce7174cf9f49a5e31
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/232350
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
32a22b57c8 usb: typec: ucsi: Add UCSI uclass support
Implement a minimal UCSI uclass which allows to send request
to UCSI compatible chip. It provides the read() and write() ops.
It offers 3 services:
  - ucsi_is_attached() which informs if Type-C connector is attached
    or not.
  - ucsi_get_data_role() which informs if the Type-C controller acts
    as Device or host.
  - usci_get_nb_connector() which indicates how many connector are
    managed.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I319cf1f49b0980d33e2b47f1b14a513eb4466da5
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/232349
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
892438f57c board: stm32mp1: Update USB Type-C STUSB160x management
Make usage of Type-C uclass API to check if a Type-C device is present.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: Ia9ee03c3e0630c7dc6ac7c9a060f84cf4c32dc9c
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/232348
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
43dbc2d182 configs: stm32mp15: Enable Type-C STUSB160x relative flags
Enable CONFIG_TYPEC and CONFIG_TYPEC_STUSB160X flags.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: Ibdd52ac043fa5dfd4a19aa1e5fc7600852da2ba8
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/232346
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
bc1af77ffc usb: typec: Add support for STUSB160x Type-C controller family
Add STMicroelectronics STUSB160x Type-C controller driver
It supports both Type-C uclass ops (.is_attached and .get_data_role).

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I72077e70ff050e9bc463cb096408fd78bd66f318
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/232345
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
68a4a0b436 board: stm32mp1; Remove TYPEC_STUB160X config from Kconfig
Remove TYPEC_STUSB160X config from board/st/common/Kconfig
before introduction of real stusb160x Type-C driver.
This will avoid the following Kconfig warning:
drivers/usb/typec/Kconfig:15:warning: ignoring type redefinition of 'TYPEC_STUSB160X' from 'tristate' to 'bool'

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: Ia464dcc7e1b5e3c6e8c8ccd8c3ac84d858ae8588
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/232344
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
3e36da694a usb: Add USB_TYPEC uclass
The USB TypeC uclass exposes 3 services:
  - is_attached() which indicates if connector is attached or not
  - get_data_role() which indicates the current controller role
    (Host or Device)
  - get_nb_connector() which indicates the connector number managed

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Change-Id: I296bc3cb8b180e0adb02171ede5db887fb1f5d6b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/232343
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
2022-05-25 16:01:01 +02:00
b6322ffdec board: stm32mp1: update OP-TEE nodes in Linux device tree for SP-MIN
Update the Linux kernel device tree to support boot with TF-A SP-MIN and
without OP-TEE on STM32MP15 platform.

By default the Linux kernel have OP-TEE nodes, including the SCMI agent,
to support the boot with OP-TEE, the default supported boot mode.

For the TF-A SP-MIN support, the OP-TEE nodes need to be dynamically
updated, including the reserved memory and the SCMI agent nodes.

This patch allows to support this legacy mode, boot with TF-A SP-MIN as
secure monitor and without OP-TEE, with the latest device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: I6ba5eb92850869ab08d5c09bf119089fb283a4a8
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/228518
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/236082
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-05-25 16:01:01 +02:00
183f041e38 configs: stm32mp15: increase CONFIG_SYS_MALLOC_F_LEN
Increase the pre-reloc malloc size, requested to support for SCMI
OP-TEE agent.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Iee88574ba7012475245fc9b5d5331aa58c1a074b
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/226786
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Lionel DEBIEVE <lionel.debieve@foss.st.com>
Reviewed-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
Tested-by: Lionel DEBIEVE <lionel.debieve@foss.st.com>
2022-05-25 16:01:01 +02:00
04f2753854 arm: stm32mp: adapt the command stm32key for STM32MP13x
Change the mask of OTP0 used to close the device on STM32MP
- STM32MP15x: bit 6 of OPT0
- STM32MP13x: 0b111111 = 0x3F for OTP_SECURED closed device

And support the 2 keys for STM32MP13x
- PKHTH : Hash of the 8 ECC Public Keys Hashes Table
          (ECDSA is the authentication algorithm)
- EDMK : Encryption/Decryption Master Key

Change-Id: I1431827b62d294343069ff0aa7e59abaacb8bdd5
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/230109
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/242599
2022-05-25 16:01:01 +02:00