Skip to contentSkip to conversation

stm32mp1 patches for v2019.10

PATCH New Patrick Delaunay 1 participant 49 messages Jul 30, 2019

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover stm32mp1 patches for v2019.10

Second serie of patches for stm32mp1 support in U-Boot
- sync device tree with kernel v5.3-rc2
- update configs
- update board stm32mp1
- few ram and clk driver update

Christophe Kerello (1):
mmc: stm32_sdmmc2: reload watchdog

Patrice Chotard (2):
pinctrl: pinctrl_stm32: cosmetic: Reorder include files
stm32mp1: configs: Set bootdelay to 1

Patrick Delaunay (45):
stm32mp1: cosmetic: remove comment
pinctrl: stmfx: update pinconf settings
ARM: dts: stm32mp1: sync device tree with v5.3-rc2
ARM: dts: stm32mp1: DDR config v1.45
ARM: dts: stm32mp1: Add iwdg2 support for SPL
ARM: dts: stm32mp1: Add PSCI node access before relocation
ARM: dts: stm32mp1: add ldtc pre-reloc proper in SOC file
ARM: dts: stm32mp1: add key support on DK1/DK2
ARM: dts: stm32mp1: add pull-up on serial rx of console connected to
STLINK
dt-bindings: clock: stm32mp1: support disabled fixed clock
stpmic1: program pmic to keep only the debug unit on
stm32mp1: configs: remove CONFIG_SYS_HZ
stm32mp1: configs: activate CONFIG_SILENT_CONSOLE
stm32mp1: configs: activate PRE_CONSOLE_BUFFER
stm32mp1: configs: deactivate ARMV7_VIRT for basic boot
stm32mp1: configs: select CONFIG_STM32_SERIAL
stm32mp1: configs: Activate DISABLE_CONSOLE
stm32mp1: configs: support MTDPARTS only if needed
stm32mp1: configs: imply CONFIG_OF_LIBFDT_OVERLAY
stm32mp1: configs: Deactivate SPI_FLASH_BAR
stm32mp1: configs: add CONFIG_DM_VIDEO
stm32mp1: configs: add BACKLIGHT_GPIO support
stm32mp1: configs: add CONFIG_CMD_BMP
stm32mp1: configs: add condition to activate WATCHDOG in SPL
stm32mp1: configs: add altbootcmd
stm32mp1: configs: add spi load support in spl
stm32mp1: board: add environment variable for board id and board rev
stm32mp1: board: enable v1v2_hdmi and v3v3_hdmi regulator on dk2 boot
stm32mp1: board: support of error led on ed1/ev1 board
stm32mp1: board: protect the led function calls
stm32mp1: board: check the boot-source to disable bootdelay
stm32mp1: board: Update the way vdd-supply is retrieved from DT
stm32mp1: board: remove board_check_usb_power when ADC is not
activated
stm32mp1: board: cosmetic: cleanup file
serial: stm32: add Framing error support
serial: stm32: remove unused include
stm32mp1: ram: cosmetic: remove unused prototype
stm32mp1: ram: fix address issue in 2 tests
stm32mp1: ram: update loop management in infinite test
stm32mp1: ram: reload watchdog during ddr test
stm32mp1: ram: add pattern parameter in infinite write test
stm32mp1: Makefile cleanup
stm32mp1: clk: remove debug traces
stm32mp1: clk: use gd to store frequency information
MAINTAINERS: update ARM STM STM32MP and STM32MP1 BOARD

 MAINTAINERS                                      |  19 +-
 arch/arm/Kconfig                                 |   1 +
 arch/arm/dts/stm32mp15-ddr3-1x4Gb-1066-binG.dtsi |   4 +-
 arch/arm/dts/stm32mp15-ddr3-2x4Gb-1066-binG.dtsi |   5 +-
 arch/arm/dts/stm32mp157-pinctrl.dtsi             | 234 +++++++++++++++++++----
 arch/arm/dts/stm32mp157-u-boot.dtsi              |  14 ++
 arch/arm/dts/stm32mp157a-avenger96.dts           |  44 +++--
 arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi         |   4 +
 arch/arm/dts/stm32mp157a-dk1.dts                 |  73 ++++++-
 arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi         |   6 +
 arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi         |  23 +--
 arch/arm/dts/stm32mp157c-ed1.dts                 |  23 ++-
 arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi         |   5 -
 arch/arm/dts/stm32mp157c-ev1.dts                 | 109 ++++++++++-
 arch/arm/dts/stm32mp157c.dtsi                    | 180 +++++++++++++++++
 arch/arm/dts/stm32mp157xaa-pinctrl.dtsi          |  90 +++++++++
 arch/arm/dts/stm32mp157xab-pinctrl.dtsi          |  62 ++++++
 arch/arm/dts/stm32mp157xac-pinctrl.dtsi          |  78 ++++++++
 arch/arm/dts/stm32mp157xad-pinctrl.dtsi          |  62 ++++++
 arch/arm/mach-stm32mp/Kconfig                    |  14 +-
 arch/arm/mach-stm32mp/Makefile                   |   3 +-
 arch/arm/mach-stm32mp/include/mach/stm32.h       |   1 +
 board/st/stm32mp1/Kconfig                        |   4 +
 board/st/stm32mp1/MAINTAINERS                    |   5 +-
 board/st/stm32mp1/spl.c                          |  14 ++
 board/st/stm32mp1/stm32mp1.c                     | 162 ++++++++++++++--
 configs/stm32mp15_basic_defconfig                |   6 +-
 configs/stm32mp15_optee_defconfig                |   5 +-
 configs/stm32mp15_trusted_defconfig              |   5 +-
 doc/device-tree-bindings/clock/st,stm32mp1.txt   |   4 +-
 drivers/clk/clk_stm32mp1.c                       |  37 ++--
 drivers/mmc/stm32_sdmmc2.c                       |   3 +
 drivers/pinctrl/pinctrl-stmfx.c                  |  20 +-
 drivers/pinctrl/pinctrl_stm32.c                  |   4 +-
 drivers/ram/stm32mp1/stm32mp1_ddr.h              |   4 -
 drivers/ram/stm32mp1/stm32mp1_tests.c            |  97 ++++++----
 drivers/serial/serial_stm32.c                    |   5 +-
 drivers/serial/serial_stm32.h                    |   2 +
 include/configs/stm32mp1.h                       |  17 +-
 include/dm/platform_data/serial_stm32.h          |  15 --
 include/power/stpmic1.h                          |   5 +-
 41 files changed, 1250 insertions(+), 218 deletions(-)
 create mode 100644 arch/arm/dts/stm32mp157xaa-pinctrl.dtsi
 create mode 100644 arch/arm/dts/stm32mp157xab-pinctrl.dtsi
 create mode 100644 arch/arm/dts/stm32mp157xac-pinctrl.dtsi
 create mode 100644 arch/arm/dts/stm32mp157xad-pinctrl.dtsi
 delete mode 100644 include/dm/platform_data/serial_stm32.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/48 stm32mp1: cosmetic: remove comment

Remove unnecessary comment.

---

 include/configs/stm32mp1.h | 1 -
 1 file changed, 1 deletion(-)
include/configs/stm32mp1.h +0 -1
index 24f7b9d..1bed570 100644
@@ -52,7 +52,6 @@
 
 /* SPL support */
 #ifdef CONFIG_SPL
-/* BOOTROM load address */
 /* SPL use DDR */
 #define CONFIG_SPL_BSS_START_ADDR	0xC0200000
 #define CONFIG_SPL_BSS_MAX_SIZE		0x00100000
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/48 pinctrl: pinctrl_stm32: cosmetic: Reorder include files

In reply to Patrick Delaunay

From: Patrice Chotard <[email protected]>

Reorder include files

---

 drivers/pinctrl/pinctrl_stm32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/pinctrl_stm32.c +2 -2
index cdbe463..3a235ae 100644
@@ -1,11 +1,11 @@
 #include <common.h>
 #include <dm.h>
-#include <dm/lists.h>
-#include <dm/pinctrl.h>
 #include <hwspinlock.h>
 #include <asm/arch/gpio.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
+#include <dm/lists.h>
+#include <dm/pinctrl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/48 pinctrl: stmfx: update pinconf settings

In reply to Patrick Delaunay

Alignment with kernel driver.

According to the following tab (coming from STMFX datasheet), updates have to done in stmfx_pinctrl_conf_set function:

-"type" has to be set when "bias" is configured as "pull-up or pull-down" -PIN_CONFIG_DRIVE_PUSH_PULL should only be used when gpio is configured as
output. There is so no need to check direction.

  DIR | TYPE | PUPD | MFX GPIO configuration
  ----|------|------|---------------------------------------------------
  1   | 1    | 1    | OUTPUT open drain with internal pull-up resistor
  ----|------|------|---------------------------------------------------
  1   | 1    | 0    | OUTPUT open drain with internal pull-down resistor
  ----|------|------|---------------------------------------------------
  1   | 0    | 0/1  | OUTPUT push pull no pull
  ----|------|------|---------------------------------------------------
  0   | 1    | 1    | INPUT with internal pull-up resistor
  ----|------|------|---------------------------------------------------
  0   | 1    | 0    | INPUT with internal pull-down resistor
  ----|------|------|---------------------------------------------------
  0   | 0    | 1    | INPUT floating
  ----|------|------|---------------------------------------------------
  0   | 0    | 0    | analog (GPIO not used, default setting)

---

 drivers/pinctrl/pinctrl-stmfx.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/pinctrl/pinctrl-stmfx.c +10 -10
index 5431df9..0b5a043 100644
@@ -231,23 +231,23 @@ static int stmfx_pinctrl_conf_set(struct udevice *dev, unsigned int pin,
 	switch (param) {
 	case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT:
 	case PIN_CONFIG_BIAS_DISABLE:
+	case PIN_CONFIG_DRIVE_PUSH_PULL:
+		ret = stmfx_pinctrl_set_type(dev, pin, 0);
+		break;
 	case PIN_CONFIG_BIAS_PULL_DOWN:
+		ret = stmfx_pinctrl_set_type(dev, pin, 1);
+		if (ret)
+			return ret;
 		ret = stmfx_pinctrl_set_pupd(dev, pin, 0);
 		break;
 	case PIN_CONFIG_BIAS_PULL_UP:
+		ret = stmfx_pinctrl_set_type(dev, pin, 1);
+		if (ret)
+			return ret;
 		ret = stmfx_pinctrl_set_pupd(dev, pin, 1);
 		break;
 	case PIN_CONFIG_DRIVE_OPEN_DRAIN:
-		if (dir == GPIOF_OUTPUT)
-			ret = stmfx_pinctrl_set_type(dev, pin, 1);
-		else
-			ret = stmfx_pinctrl_set_type(dev, pin, 0);
-		break;
-	case PIN_CONFIG_DRIVE_PUSH_PULL:
-		if (dir == GPIOF_OUTPUT)
-			ret = stmfx_pinctrl_set_type(dev, pin, 0);
-		else
-			ret = stmfx_pinctrl_set_type(dev, pin, 1);
+		ret = stmfx_pinctrl_set_type(dev, pin, 1);
 		break;
 	case PIN_CONFIG_OUTPUT:
 		ret = stmfx_gpio_direction_output(plat->gpio, pin, arg);
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/48 ARM: dts: stm32mp1: sync device tree with v5.3-rc2

In reply to Patrick Delaunay

Synchronize device tree with v5.3-rc2 label and
update the associated u-boot dtsi.

---

 arch/arm/dts/stm32mp157-pinctrl.dtsi     | 234 ++++++++++++++++++++++++++-----
 arch/arm/dts/stm32mp157a-avenger96.dts   |  39 +++---
 arch/arm/dts/stm32mp157a-dk1.dts         |  68 ++++++++-
 arch/arm/dts/stm32mp157c-ed1.dts         |  18 ++-
 arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi |   5 -
 arch/arm/dts/stm32mp157c-ev1.dts         | 109 +++++++++++++-
 arch/arm/dts/stm32mp157c.dtsi            | 180 ++++++++++++++++++++++++
 arch/arm/dts/stm32mp157xaa-pinctrl.dtsi  |  90 ++++++++++++
 arch/arm/dts/stm32mp157xab-pinctrl.dtsi  |  62 ++++++++
 arch/arm/dts/stm32mp157xac-pinctrl.dtsi  |  78 +++++++++++
 arch/arm/dts/stm32mp157xad-pinctrl.dtsi  |  62 ++++++++
 11 files changed, 885 insertions(+), 60 deletions(-)
 create mode 100644 arch/arm/dts/stm32mp157xaa-pinctrl.dtsi
 create mode 100644 arch/arm/dts/stm32mp157xab-pinctrl.dtsi
 create mode 100644 arch/arm/dts/stm32mp157xac-pinctrl.dtsi
 create mode 100644 arch/arm/dts/stm32mp157xad-pinctrl.dtsi
arch/arm/dts/stm32mp157-pinctrl.dtsi +201 -33
index 9bae850..4367e8d 100644
@@ -25,8 +25,7 @@
 				reg = <0x0 0x400>;
 				clocks = <&rcc GPIOA>;
 				st,bank-name = "GPIOA";
-				ngpios = <16>;
-				gpio-ranges = <&pinctrl 0 0 16>;
+				status = "disabled";
 			};
 
 			gpiob: gpio at 50003000 {
@@ -37,8 +36,7 @@
 				reg = <0x1000 0x400>;
 				clocks = <&rcc GPIOB>;
 				st,bank-name = "GPIOB";
-				ngpios = <16>;
-				gpio-ranges = <&pinctrl 0 16 16>;
+				status = "disabled";
 			};
 
 			gpioc: gpio at 50004000 {
@@ -49,8 +47,7 @@
 				reg = <0x2000 0x400>;
 				clocks = <&rcc GPIOC>;
 				st,bank-name = "GPIOC";
-				ngpios = <16>;
-				gpio-ranges = <&pinctrl 0 32 16>;
+				status = "disabled";
 			};
 
 			gpiod: gpio at 50005000 {
@@ -61,8 +58,7 @@
 				reg = <0x3000 0x400>;
 				clocks = <&rcc GPIOD>;
 				st,bank-name = "GPIOD";
-				ngpios = <16>;
-				gpio-ranges = <&pinctrl 0 48 16>;
+				status = "disabled";
 			};
 
 			gpioe: gpio at 50006000 {
@@ -73,8 +69,7 @@
 				reg = <0x4000 0x400>;
 				clocks = <&rcc GPIOE>;
 				st,bank-name = "GPIOE";
-				ngpios = <16>;
-				gpio-ranges = <&pinctrl 0 64 16>;
+				status = "disabled";
 			};
 
 			gpiof: gpio at 50007000 {
@@ -85,8 +80,7 @@
 				reg = <0x5000 0x400>;
 				clocks = <&rcc GPIOF>;
 				st,bank-name = "GPIOF";
-				ngpios = <16>;
-				gpio-ranges = <&pinctrl 0 80 16>;
+				status = "disabled";
 			};
 
 			gpiog: gpio at 50008000 {
@@ -97,8 +91,7 @@
 				reg = <0x6000 0x400>;
 				clocks = <&rcc GPIOG>;
 				st,bank-name = "GPIOG";
-				ngpios = <16>;
-				gpio-ranges = <&pinctrl 0 96 16>;
+				status = "disabled";
 			};
 
 			gpioh: gpio at 50009000 {
@@ -109,8 +102,7 @@
 				reg = <0x7000 0x400>;
 				clocks = <&rcc GPIOH>;
 				st,bank-name = "GPIOH";
-				ngpios = <16>;
-				gpio-ranges = <&pinctrl 0 112 16>;
+				status = "disabled";
 			};
 
 			gpioi: gpio at 5000a000 {
@@ -121,8 +113,7 @@
 				reg = <0x8000 0x400>;
 				clocks = <&rcc GPIOI>;
 				st,bank-name = "GPIOI";
-				ngpios = <16>;
-				gpio-ranges = <&pinctrl 0 128 16>;
+				status = "disabled";
 			};
 
 			gpioj: gpio at 5000b000 {
@@ -133,8 +124,7 @@
 				reg = <0x9000 0x400>;
 				clocks = <&rcc GPIOJ>;
 				st,bank-name = "GPIOJ";
-				ngpios = <16>;
-				gpio-ranges = <&pinctrl 0 144 16>;
+				status = "disabled";
 			};
 
 			gpiok: gpio at 5000c000 {
@@ -145,8 +135,7 @@
 				reg = <0xa000 0x400>;
 				clocks = <&rcc GPIOK>;
 				st,bank-name = "GPIOK";
-				ngpios = <8>;
-				gpio-ranges = <&pinctrl 0 160 8>;
+				status = "disabled";
 			};
 
 			adc12_usb_pwr_pins_a: adc12-usb-pwr-pins-0 {
@@ -186,6 +175,47 @@
 				};
 			};
 
+			dcmi_pins_a: dcmi-0 {
+				pins {
+					pinmux = <STM32_PINMUX('H', 8,  AF13)>,/* DCMI_HSYNC */
+						 <STM32_PINMUX('B', 7,  AF13)>,/* DCMI_VSYNC */
+						 <STM32_PINMUX('A', 6,  AF13)>,/* DCMI_PIXCLK */
+						 <STM32_PINMUX('H', 9,  AF13)>,/* DCMI_D0 */
+						 <STM32_PINMUX('H', 10, AF13)>,/* DCMI_D1 */
+						 <STM32_PINMUX('H', 11, AF13)>,/* DCMI_D2 */
+						 <STM32_PINMUX('H', 12, AF13)>,/* DCMI_D3 */
+						 <STM32_PINMUX('H', 14, AF13)>,/* DCMI_D4 */
+						 <STM32_PINMUX('I', 4,  AF13)>,/* DCMI_D5 */
+						 <STM32_PINMUX('B', 8,  AF13)>,/* DCMI_D6 */
+						 <STM32_PINMUX('E', 6,  AF13)>,/* DCMI_D7 */
+						 <STM32_PINMUX('I', 1,  AF13)>,/* DCMI_D8 */
+						 <STM32_PINMUX('H', 7,  AF13)>,/* DCMI_D9 */
+						 <STM32_PINMUX('I', 3,  AF13)>,/* DCMI_D10 */
+						 <STM32_PINMUX('H', 15, AF13)>;/* DCMI_D11 */
+					bias-disable;
+				};
+			};
+
+			dcmi_sleep_pins_a: dcmi-sleep-0 {
+				pins {
+					pinmux = <STM32_PINMUX('H', 8,  ANALOG)>,/* DCMI_HSYNC */
+						 <STM32_PINMUX('B', 7,  ANALOG)>,/* DCMI_VSYNC */
+						 <STM32_PINMUX('A', 6,  ANALOG)>,/* DCMI_PIXCLK */
+						 <STM32_PINMUX('H', 9,  ANALOG)>,/* DCMI_D0 */
+						 <STM32_PINMUX('H', 10, ANALOG)>,/* DCMI_D1 */
+						 <STM32_PINMUX('H', 11, ANALOG)>,/* DCMI_D2 */
+						 <STM32_PINMUX('H', 12, ANALOG)>,/* DCMI_D3 */
+						 <STM32_PINMUX('H', 14, ANALOG)>,/* DCMI_D4 */
+						 <STM32_PINMUX('I', 4,  ANALOG)>,/* DCMI_D5 */
+						 <STM32_PINMUX('B', 8,  ANALOG)>,/* DCMI_D6 */
+						 <STM32_PINMUX('E', 6,  ANALOG)>,/* DCMI_D7 */
+						 <STM32_PINMUX('I', 1,  ANALOG)>,/* DCMI_D8 */
+						 <STM32_PINMUX('H', 7,  ANALOG)>,/* DCMI_D9 */
+						 <STM32_PINMUX('I', 3,  ANALOG)>,/* DCMI_D10 */
+						 <STM32_PINMUX('H', 15, ANALOG)>;/* DCMI_D11 */
+				};
+			};
+
 			ethernet0_rgmii_pins_a: rgmii-0 {
 				pins1 {
 					pinmux = <STM32_PINMUX('G', 5, AF11)>, /* ETH_RGMII_CLK125 */
@@ -308,6 +338,13 @@
 				};
 			};
 
+			i2c1_pins_sleep_b: i2c1-3 {
+				pins {
+					pinmux = <STM32_PINMUX('F', 14, ANALOG)>, /* I2C1_SCL */
+						 <STM32_PINMUX('F', 15, ANALOG)>; /* I2C1_SDA */
+				};
+			};
+
 			i2c2_pins_a: i2c2-0 {
 				pins {
 					pinmux = <STM32_PINMUX('H', 4, AF4)>, /* I2C2_SCL */
@@ -325,16 +362,21 @@
 				};
 			};
 
-			i2c2_pins_b: i2c2-2 {
+			i2c2_pins_b1: i2c2-2 {
 				pins {
-					pinmux = <STM32_PINMUX('Z', 0, AF3)>, /* I2C2_SCL */
-						 <STM32_PINMUX('H', 5, AF4)>; /* I2C2_SDA */
+					pinmux = <STM32_PINMUX('H', 5, AF4)>; /* I2C2_SDA */
 					bias-disable;
 					drive-open-drain;
 					slew-rate = <0>;
 				};
 			};
 
+			i2c2_pins_sleep_b1: i2c2-3 {
+				pins {
+					pinmux = <STM32_PINMUX('H', 5, ANALOG)>; /* I2C2_SDA */
+				};
+			};
+
 			i2c5_pins_a: i2c5-0 {
 				pins {
 					pinmux = <STM32_PINMUX('A', 11, AF4)>, /* I2C5_SCL */
@@ -353,6 +395,25 @@
 				};
 			};
 
+			i2s2_pins_a: i2s2-0 {
+				pins {
+					pinmux = <STM32_PINMUX('I', 3, AF5)>, /* I2S2_SDO */
+						 <STM32_PINMUX('B', 9, AF5)>, /* I2S2_WS */
+						 <STM32_PINMUX('A', 9, AF5)>; /* I2S2_CK */
+					slew-rate = <1>;
+					drive-push-pull;
+					bias-disable;
+				};
+			};
+
+			i2s2_pins_sleep_a: i2s2-1 {
+				pins {
+					pinmux = <STM32_PINMUX('I', 3, ANALOG)>, /* I2S2_SDO */
+						 <STM32_PINMUX('B', 9, ANALOG)>, /* I2S2_WS */
+						 <STM32_PINMUX('A', 9, ANALOG)>; /* I2S2_CK */
+				};
+			};
+
 			ltdc_pins_a: ltdc-a-0 {
 				pins {
 					pinmux = <STM32_PINMUX('G',  7, AF14)>, /* LCD_CLK */
@@ -547,6 +608,12 @@
 				};
 			};
 
+			qspi_clk_sleep_pins_a: qspi-clk-sleep-0 {
+				pins {
+					pinmux = <STM32_PINMUX('F', 10, ANALOG)>; /* QSPI_CLK */
+				};
+			};
+
 			qspi_bk1_pins_a: qspi-bk1-0 {
 				pins1 {
 					pinmux = <STM32_PINMUX('F', 8, AF10)>, /* QSPI_BK1_IO0 */
@@ -565,6 +632,16 @@
 				};
 			};
 
+			qspi_bk1_sleep_pins_a: qspi-bk1-sleep-0 {
+				pins {
+					pinmux = <STM32_PINMUX('F', 8, ANALOG)>, /* QSPI_BK1_IO0 */
+						 <STM32_PINMUX('F', 9, ANALOG)>, /* QSPI_BK1_IO1 */
+						 <STM32_PINMUX('F', 7, ANALOG)>, /* QSPI_BK1_IO2 */
+						 <STM32_PINMUX('F', 6, ANALOG)>, /* QSPI_BK1_IO3 */
+						 <STM32_PINMUX('B', 6, ANALOG)>; /* QSPI_BK1_NCS */
+				};
+			};
+
 			qspi_bk2_pins_a: qspi-bk2-0 {
 				pins1 {
 					pinmux = <STM32_PINMUX('H', 2, AF9)>, /* QSPI_BK2_IO0 */
@@ -583,6 +660,89 @@
 				};
 			};
 
+			qspi_bk2_sleep_pins_a: qspi-bk2-sleep-0 {
+				pins {
+					pinmux = <STM32_PINMUX('H', 2, ANALOG)>, /* QSPI_BK2_IO0 */
+						 <STM32_PINMUX('H', 3, ANALOG)>, /* QSPI_BK2_IO1 */
+						 <STM32_PINMUX('G', 10, ANALOG)>, /* QSPI_BK2_IO2 */
+						 <STM32_PINMUX('G', 7, ANALOG)>, /* QSPI_BK2_IO3 */
+						 <STM32_PINMUX('C', 0, ANALOG)>; /* QSPI_BK2_NCS */
+				};
+			};
+
+			sai2a_pins_a: sai2a-0 {
+				pins {
+					pinmux = <STM32_PINMUX('I', 5, AF10)>, /* SAI2_SCK_A */
+						 <STM32_PINMUX('I', 6, AF10)>, /* SAI2_SD_A */
+						 <STM32_PINMUX('I', 7, AF10)>, /* SAI2_FS_A */
+						 <STM32_PINMUX('E', 0, AF10)>; /* SAI2_MCLK_A */
+					slew-rate = <0>;
+					drive-push-pull;
+					bias-disable;
+				};
+			};
+
+			sai2a_sleep_pins_a: sai2a-1 {
+				pins {
+					pinmux = <STM32_PINMUX('I', 5, ANALOG)>, /* SAI2_SCK_A */
+						 <STM32_PINMUX('I', 6, ANALOG)>, /* SAI2_SD_A */
+						 <STM32_PINMUX('I', 7, ANALOG)>, /* SAI2_FS_A */
+						 <STM32_PINMUX('E', 0, ANALOG)>; /* SAI2_MCLK_A */
+				};
+			};
+
+			sai2b_pins_a: sai2b-0 {
+				pins1 {
+					pinmux = <STM32_PINMUX('E', 12, AF10)>, /* SAI2_SCK_B */
+						 <STM32_PINMUX('E', 13, AF10)>, /* SAI2_FS_B */
+						 <STM32_PINMUX('E', 14, AF10)>; /* SAI2_MCLK_B */
+					slew-rate = <0>;
+					drive-push-pull;
+					bias-disable;
+				};
+				pins2 {
+					pinmux = <STM32_PINMUX('F', 11, AF10)>; /* SAI2_SD_B */
+					bias-disable;
+				};
+			};
+
+			sai2b_sleep_pins_a: sai2b-1 {
+				pins {
+					pinmux = <STM32_PINMUX('F', 11, ANALOG)>, /* SAI2_SD_B */
+						 <STM32_PINMUX('E', 12, ANALOG)>, /* SAI2_SCK_B */
+						 <STM32_PINMUX('E', 13, ANALOG)>, /* SAI2_FS_B */
+						 <STM32_PINMUX('E', 14, ANALOG)>; /* SAI2_MCLK_B */
+				};
+			};
+
+			sai2b_pins_b: sai2b-2 {
+				pins {
+					pinmux = <STM32_PINMUX('F', 11, AF10)>; /* SAI2_SD_B */
+					bias-disable;
+				};
+			};
+
+			sai2b_sleep_pins_b: sai2b-3 {
+				pins {
+					pinmux = <STM32_PINMUX('F', 11, ANALOG)>; /* SAI2_SD_B */
+				};
+			};
+
+			sai4a_pins_a: sai4a-0 {
+				pins {
+					pinmux = <STM32_PINMUX('B', 5, AF10)>; /* SAI4_SD_A */
+					slew-rate = <0>;
+					drive-push-pull;
+					bias-disable;
+				};
+			};
+
+			sai4a_sleep_pins_a: sai4a-1 {
+				pins {
+					pinmux = <STM32_PINMUX('B', 5, ANALOG)>; /* SAI4_SD_A */
+				};
+			};
+
 			sdmmc1_b4_pins_a: sdmmc1-b4-0 {
 				pins {
 					pinmux = <STM32_PINMUX('C', 8, AF12)>, /* SDMMC1_D0 */
@@ -752,12 +912,6 @@
 					bias-disable;
 				};
 			};
-
-			usbotg_hs_pins_a: usbotg_hs-0 {
-				pins {
-					pinmux = <STM32_PINMUX('A', 10, ANALOG)>; /* OTG_ID */
-				};
-			};
 		};
 
 		pinctrl_z: pin-controller-z at 54004000 {
@@ -779,8 +933,22 @@
 				clocks = <&rcc GPIOZ>;
 				st,bank-name = "GPIOZ";
 				st,bank-ioport = <11>;
-				ngpios = <8>;
-				gpio-ranges = <&pinctrl_z 0 400 8>;
+				status = "disabled";
+			};
+
+			i2c2_pins_b2: i2c2-0 {
+				pins {
+					pinmux = <STM32_PINMUX('Z', 0, AF3)>; /* I2C2_SCL */
+					bias-disable;
+					drive-open-drain;
+					slew-rate = <0>;
+				};
+			};
+
+			i2c2_pins_sleep_b2: i2c2-1 {
+				pins {
+					pinmux = <STM32_PINMUX('Z', 0, ANALOG)>; /* I2C2_SCL */
+				};
 			};
 
 			i2c4_pins_a: i2c4-0 {
arch/arm/dts/stm32mp157a-avenger96.dts +23 -16
index dd08597..ba86cf5 100644
@@ -1,8 +1,5 @@
 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
 /*
- * Copyright (C) STMicroelectronics 2019 - All Rights Reserved
- * Author: Alexandre Torgue <[email protected]> for STMicroelectronics.
- *
  * Copyright (C) Linaro Ltd 2019 - All Rights Reserved
  * Author: Manivannan Sadhasivam <[email protected]>
  */
@@ -10,17 +7,19 @@
 /dts-v1/;
 
 #include "stm32mp157c.dtsi"
-#include "stm32mp157-pinctrl.dtsi"
+#include "stm32mp157xac-pinctrl.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/mfd/st,stpmic1.h>
 
 / {
 	model = "Arrow Electronics STM32MP157A Avenger96 board";
-	compatible = "st,stm32mp157a-avenger96", "st,stm32mp157";
+	compatible = "arrow,stm32mp157a-avenger96", "st,stm32mp157";
 
 	aliases {
 		ethernet0 = &ethernet0;
+		mmc0 = &sdmmc1;
 		serial0 = &uart4;
+		serial1 = &uart7;
 	};
 
 	chosen {
@@ -28,6 +27,7 @@
 	};
 
 	memory at c0000000 {
+		device_type = "memory";
 		reg = <0xc0000000 0x40000000>;
 	};
 
@@ -109,7 +109,7 @@
 
 &i2c2 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&i2c2_pins_b>;
+	pinctrl-0 = <&i2c2_pins_b1 &i2c2_pins_b2>;
 	i2c-scl-rising-time-ns = <185>;
 	i2c-scl-falling-time-ns = <20>;
 	status = "okay";
@@ -151,10 +151,10 @@
 
 			vddcore: buck1 {
 				regulator-name = "vddcore";
-				regulator-min-microvolt = <800000>;
+				regulator-min-microvolt = <1200000>;
 				regulator-max-microvolt = <1350000>;
 				regulator-always-on;
-				regulator-initial-mode = <2>;
+				regulator-initial-mode = <0>;
 				regulator-over-current-protection;
 			};
 
@@ -163,17 +163,17 @@
 				regulator-min-microvolt = <1350000>;
 				regulator-max-microvolt = <1350000>;
 				regulator-always-on;
-				regulator-initial-mode = <2>;
+				regulator-initial-mode = <0>;
 				regulator-over-current-protection;
 			};
 
 			vdd: buck3 {
 				regulator-name = "vdd";
-				regulator-min-microvolt = <2500000>;
-				regulator-max-microvolt = <2500000>;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
 				regulator-always-on;
 				st,mask_reset;
-				regulator-initial-mode = <8>;
+				regulator-initial-mode = <0>;
 				regulator-over-current-protection;
 			};
 
@@ -183,7 +183,7 @@
 				regulator-max-microvolt = <3300000>;
 				regulator-always-on;
 				regulator-over-current-protection;
-				regulator-initial-mode = <8>;
+				regulator-initial-mode = <0>;
 			};
 
 			vdda: ldo1 {
@@ -204,8 +204,8 @@
 
 			vtt_ddr: ldo3 {
 				regulator-name = "vtt_ddr";
-				regulator-min-microvolt = <0000000>;
-				regulator-max-microvolt = <1000000>;
+				regulator-min-microvolt = <500000>;
+				regulator-max-microvolt = <750000>;
 				regulator-always-on;
 				regulator-over-current-protection;
 			};
@@ -233,6 +233,7 @@
 				regulator-max-microvolt = <1800000>;
 				interrupts = <IT_CURLIM_LDO6 0>;
 				interrupt-parent = <&pmic>;
+				regulator-enable-ramp-delay = <300000>;
 			};
 
 			vref_ddr: vref_ddr {
@@ -294,8 +295,10 @@
 };
 
 &sdmmc1 {
-	pinctrl-names = "default";
+	pinctrl-names = "default", "opendrain", "sleep";
 	pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_a>;
+	pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
+	pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
 	broken-cd;
 	st,sig-dir;
 	st,neg-edge;
@@ -325,12 +328,16 @@
 };
 
 &uart4 {
+	/* On Low speed expansion header */
+	label = "LS-UART1";
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart4_pins_b>;
 	status = "okay";
 };
 
 &uart7 {
+	/* On Low speed expansion header */
+	label = "LS-UART0";
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart7_pins_a>;
 	status = "okay";
arch/arm/dts/stm32mp157a-dk1.dts +67 -1

92 lines not on this page · raw message

arch/arm/dts/stm32mp157c-ed1.dts +17 -1
index 11981d6..94ac025 100644
@@ -6,7 +6,7 @@
 /dts-v1/;
 
 #include "stm32mp157c.dtsi"
-#include "stm32mp157-pinctrl.dtsi"
+#include "stm32mp157xaa-pinctrl.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/mfd/st,stpmic1.h>
 
@@ -23,6 +23,17 @@
 		reg = <0xC0000000 0x40000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		gpu_reserved: gpu at e8000000 {
+			reg = <0xe8000000 0x8000000>;
+			no-map;
+		};
+	};
+
 	aliases {
 		serial0 = &uart4;
 	};
@@ -45,6 +56,11 @@
 	status = "okay";
 };
 
+&gpu {
+	contiguous-area = <&gpu_reserved>;
+	status = "okay";
+};
+
 &i2c4 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c4_pins_a>;
arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi +0 -5
index b656eb1..ec60486 100644
@@ -17,14 +17,9 @@
 };
 
 &flash0 {
-	compatible = "jedec,spi-nor";
 	u-boot,dm-spl;
 };
 
-&flash1 {
-	compatible = "jedec,spi-nor";
-};
-
 &qspi {
 	u-boot,dm-spl;
 };
arch/arm/dts/stm32mp157c-ev1.dts +105 -4

170 lines not on this page · raw message

arch/arm/dts/stm32mp157c.dtsi +180 -0

222 lines not on this page · raw message

arch/arm/dts/stm32mp157xaa-pinctrl.dtsi new file +90 -0

90 lines not on this page · raw message

arch/arm/dts/stm32mp157xab-pinctrl.dtsi new file +62 -0

62 lines not on this page · raw message

arch/arm/dts/stm32mp157xac-pinctrl.dtsi new file +78 -0

78 lines not on this page · raw message

arch/arm/dts/stm32mp157xad-pinctrl.dtsi new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
2.7.4
#5 lore raw

PATCH 5/48 ARM: dts: stm32mp1: DDR config v1.45

In reply to Patrick Delaunay

Update DDR configuration with the latest update:
- Change DQSGE to 1 for DDR3, to cure missing DQS preamble.

---

 arch/arm/dts/stm32mp15-ddr3-1x4Gb-1066-binG.dtsi | 4 ++--
 arch/arm/dts/stm32mp15-ddr3-2x4Gb-1066-binG.dtsi | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)
arch/arm/dts/stm32mp15-ddr3-1x4Gb-1066-binG.dtsi +2 -2
index dc30360..11e8f2b 100644
@@ -16,7 +16,7 @@
  * address mapping : RBC
  * Tc > + 85C : N
  */
-#define DDR_MEM_NAME "DDR3-1066/888 bin G 1x4Gb 533MHz v1.44"
+#define DDR_MEM_NAME "DDR3-1066/888 bin G 1x4Gb 533MHz v1.45"
 #define DDR_MEM_SPEED 533000
 #define DDR_MEM_SIZE 0x20000000
 
@@ -89,7 +89,7 @@
 #define DDR_PTR2 0x042DA068
 #define DDR_ACIOCR 0x10400812
 #define DDR_DXCCR 0x00000C40
-#define DDR_DSGCR 0xF200001F
+#define DDR_DSGCR 0xF200011F
 #define DDR_DCR 0x0000000B
 #define DDR_DTPR0 0x38D488D0
 #define DDR_DTPR1 0x098B00D8
arch/arm/dts/stm32mp15-ddr3-2x4Gb-1066-binG.dtsi +2 -3
index 8158a56..4b70b60 100644
@@ -16,8 +16,7 @@
  * address mapping : RBC
  * Tc > + 85C : N
  */
-
-#define DDR_MEM_NAME "DDR3-1066/888 bin G 2x4Gb 533MHz v1.44"
+#define DDR_MEM_NAME "DDR3-1066/888 bin G 2x4Gb 533MHz v1.45"
 #define DDR_MEM_SPEED 533000
 #define DDR_MEM_SIZE 0x40000000
 
@@ -90,7 +89,7 @@
 #define DDR_PTR2 0x042DA068
 #define DDR_ACIOCR 0x10400812
 #define DDR_DXCCR 0x00000C40
-#define DDR_DSGCR 0xF200001F
+#define DDR_DSGCR 0xF200011F
 #define DDR_DCR 0x0000000B
 #define DDR_DTPR0 0x38D488D0
 #define DDR_DTPR1 0x098B00D8
Signature · 1 line
2.7.4
#6 lore raw

PATCH 6/48 ARM: dts: stm32mp1: Add iwdg2 support for SPL

In reply to Patrick Delaunay

This patch adds independent watchdog support for stm32mp157c in SPL.

---

 arch/arm/dts/stm32mp157-u-boot.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/stm32mp157-u-boot.dtsi +4 -0
index 8102ce2..ba13ebb 100644
@@ -106,6 +106,10 @@
 	u-boot,dm-pre-reloc;
 };
 
+&iwdg2 {
+	u-boot,dm-pre-reloc;
+};
+
 &pinctrl {
 	u-boot,dm-pre-reloc;
 };
Signature · 1 line
2.7.4
#7 lore raw

PATCH 7/48 ARM: dts: stm32mp1: Add PSCI node access before relocation

In reply to Patrick Delaunay

Add node in DT and avoid error to search UCLASS_SYSRESET in board_f.c::print_resetinfo() and lost 1.6s in U-Boot for the trusted boot chain.

---

 arch/arm/dts/stm32mp157-u-boot.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/dts/stm32mp157-u-boot.dtsi +5 -0
index ba13ebb..1c4ad67 100644
@@ -25,6 +25,11 @@
 		u-boot,dm-pre-reloc;
 	};
 
+	/* need PSCI for sysreset during board_f */
+	psci {
+		u-boot,dm-pre-proper;
+	};
+
 	reboot {
 		u-boot,dm-pre-reloc;
 	};
Signature · 1 line
2.7.4
#8 lore raw

PATCH 8/48 ARM: dts: stm32mp1: add ldtc pre-reloc proper in SOC file

In reply to Patrick Delaunay

The pre-relocation probe is needed to reserve video frame buffer in video_reserve() for all the board;
LDTC must be tagged prereloc in SOC U-Boot dtsi file.

---

 arch/arm/dts/stm32mp157-u-boot.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/dts/stm32mp157-u-boot.dtsi +5 -0
index 1c4ad67..0d1d387 100644
@@ -115,6 +115,11 @@
 	u-boot,dm-pre-reloc;
 };
 
+/* pre-reloc probe = reserve video frame buffer in video_reserve() */
+&ltdc {
+	u-boot,dm-pre-proper;
+};
+
 &pinctrl {
 	u-boot,dm-pre-reloc;
 };
Signature · 1 line
2.7.4
#9 lore raw

PATCH 9/48 ARM: dts: stm32mp1: add key support on DK1/DK2

In reply to Patrick Delaunay

Allow to use PA13 and PA14 to force fastboot mode or STM32CubeProgrammer mode.

---

 arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +2 -0
index 36c852d..2a1cfd3 100644
@@ -17,6 +17,8 @@
 		u-boot,boot-led = "heartbeat";
 		u-boot,error-led = "error";
 		st,adc_usb_pd = <&adc1 18>, <&adc1 19>;
+		st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
+		st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
 	};
 	led {
 		red {
Signature · 1 line
2.7.4
#10 lore raw

PATCH 10/48 ARM: dts: stm32mp1: add pull-up on serial rx of console connected to STLINK

In reply to Patrick Delaunay

Avoid U-Boot auto-boot interruption for line break detection on console when the RX line connected to STLINK is floating (-IO error in getc cause by framing error and testc return 1) Same workaround is applied on all the STMicroelectonics board.

---

 arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 2 ++
 arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 2 ++
 2 files changed, 4 insertions(+)
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +2 -0
index 2a1cfd3..dcaab3e 100644
@@ -189,6 +189,8 @@
 	};
 	pins2 {
 		u-boot,dm-pre-reloc;
+		/* pull-up on rx to avoid floating level */
+		bias-pull-up;
 	};
 };
 
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi +2 -0
index 200601e..21c89c1 100644
@@ -206,5 +206,7 @@
 	};
 	pins2 {
 		u-boot,dm-pre-reloc;
+		/* pull-up on rx to avoid floating level */
+		bias-pull-up;
 	};
 };
Signature · 1 line
2.7.4
#11 lore raw

PATCH 11/48 dt-bindings: clock: stm32mp1: support disabled fixed clock

In reply to Patrick Delaunay

Add precision for disabled fixed clock in stm32mp1 binding.

---

 doc/device-tree-bindings/clock/st,stm32mp1.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
doc/device-tree-bindings/clock/st,stm32mp1.txt +3 -1
index 02e1460..ec1d703 100644
@@ -164,8 +164,10 @@ used to define the state of associated ST32MP1 oscillators:
   - clk-csi
 
 At boot the clock tree initialization will
-  - enable oscillators present in device tree
+  - enable oscillators present in device tree and not disabled
+    (node with status="disabled"),
   - disable HSI oscillator if the node is absent (always activated by bootrom)
+    and not disabled (node with status="disabled").
 
 Optional properties :
 
Signature · 1 line
2.7.4
#12 lore raw

PATCH 12/48 stpmic1: program pmic to keep only the debug unit on

In reply to Patrick Delaunay

Depending on backup register value, we maintain the debug unit powered-on for debugging purpose.
Only BUCK1 is required for powering the debug unit, so revert the setting for all the other power lanes, except BUCK3 that has to be always on.

---

 arch/arm/mach-stm32mp/include/mach/stm32.h |  1 +
 board/st/stm32mp1/spl.c                    | 14 ++++++++++++++
 include/power/stpmic1.h                    |  5 +++--
 3 files changed, 18 insertions(+), 2 deletions(-)
arch/arm/mach-stm32mp/include/mach/stm32.h +1 -0
index 1d4b548..b3e9ccc 100644
@@ -94,6 +94,7 @@ enum boot_device {
 #define TAMP_BOOT_DEVICE_MASK		GENMASK(7, 4)
 #define TAMP_BOOT_INSTANCE_MASK		GENMASK(3, 0)
 #define TAMP_BOOT_FORCED_MASK		GENMASK(7, 0)
+#define TAMP_BOOT_DEBUG_ON		BIT(16)
 
 enum forced_boot_mode {
 	BOOT_NORMAL = 0x00,
board/st/stm32mp1/spl.c +14 -0
index e19be0f..e65ff28 100644
@@ -27,5 +27,19 @@ void spl_board_init(void)
 				STPMIC1_BUCKS_MRST_CR,
 				STPMIC1_MRST_BUCK(STPMIC1_BUCK3),
 				STPMIC1_MRST_BUCK(STPMIC1_BUCK3));
+
+	/* Check if debug is enabled to program PMIC according to the bit */
+	if ((readl(TAMP_BOOT_CONTEXT) & TAMP_BOOT_DEBUG_ON) && !ret) {
+		printf("Keep debug unit ON\n");
+
+		pmic_clrsetbits(dev, STPMIC1_BUCKS_MRST_CR,
+				STPMIC1_MRST_BUCK_DEBUG,
+				STPMIC1_MRST_BUCK_DEBUG);
+
+		if (STPMIC1_MRST_LDO_DEBUG)
+			pmic_clrsetbits(dev, STPMIC1_LDOS_MRST_CR,
+					STPMIC1_MRST_LDO_DEBUG,
+					STPMIC1_MRST_LDO_DEBUG);
+	}
 #endif
 }
include/power/stpmic1.h +3 -2
index 0e6721d..d90a1a9 100644
@@ -22,11 +22,12 @@
 
 /* BUCKS_MRST_CR */
 #define STPMIC1_MRST_BUCK(buck)		BIT(buck)
-#define STPMIC1_MRST_BUCK_ALL		GENMASK(3, 0)
+#define STPMIC1_MRST_BUCK_DEBUG		(STPMIC1_MRST_BUCK(STPMIC1_BUCK1) | \
+					 STPMIC1_MRST_BUCK(STPMIC1_BUCK3))
 
 /* LDOS_MRST_CR */
 #define STPMIC1_MRST_LDO(ldo)		BIT(ldo)
-#define STPMIC1_MRST_LDO_ALL		GENMASK(6, 0)
+#define STPMIC1_MRST_LDO_DEBUG		0
 
 /* BUCKx_MAIN_CR (x=1...4) */
 #define STPMIC1_BUCK_ENA		BIT(0)
Signature · 1 line
2.7.4
#13 lore raw

PATCH 13/48 stm32mp1: configs: remove CONFIG_SYS_HZ

In reply to Patrick Delaunay

Use the default value from lib/Kconfig.

---

 include/configs/stm32mp1.h | 5 -----
 1 file changed, 5 deletions(-)
include/configs/stm32mp1.h +0 -5
index 1bed570..033291e 100644
@@ -10,11 +10,6 @@
 #include <linux/sizes.h>
 #include <asm/arch/stm32.h>
 
-/*
- * Number of clock ticks in 1 sec
- */
-#define CONFIG_SYS_HZ				1000
-
 #ifndef CONFIG_STM32MP1_TRUSTED
 /* PSCI support */
 #define CONFIG_ARMV7_PSCI_1_0
Signature · 1 line
2.7.4
#14 lore raw

PATCH 14/48 stm32mp1: configs: activate CONFIG_SILENT_CONSOLE

In reply to Patrick Delaunay

Allow to disable console with environment variable 'silent':

Quoted 1 line

env set silent 1; env save

---

 arch/arm/mach-stm32mp/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-stm32mp/Kconfig +1 -0
index 9dc3c4d..e5f05af 100644
@@ -47,6 +47,7 @@ config TARGET_STM32MP1
 	imply BOOTSTAGE
 	imply CMD_BOOTCOUNT
 	imply CMD_BOOTSTAGE
+	imply SILENT_CONSOLE
 	imply SYSRESET_PSCI if STM32MP1_TRUSTED
 	imply SYSRESET_SYSCON if !STM32MP1_TRUSTED
 	help
Signature · 1 line
2.7.4
#15 lore raw

PATCH 15/48 stm32mp1: configs: activate PRE_CONSOLE_BUFFER

In reply to Patrick Delaunay

Correctly handle silent=1 in the default environment.

---

 arch/arm/mach-stm32mp/Kconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/mach-stm32mp/Kconfig +8 -0
index e5f05af..7efe464 100644
@@ -47,6 +47,7 @@ config TARGET_STM32MP1
 	imply BOOTSTAGE
 	imply CMD_BOOTCOUNT
 	imply CMD_BOOTSTAGE
+	imply PRE_CONSOLE_BUFFER
 	imply SILENT_CONSOLE
 	imply SYSRESET_PSCI if STM32MP1_TRUSTED
 	imply SYSRESET_SYSCON if !STM32MP1_TRUSTED
@@ -110,6 +111,13 @@ config CMD_STM32KEY
 		fuse public key hash in corresponding fuse used to authenticate
 		binary.
 
+
+config PRE_CON_BUF_ADDR
+	default 0xC02FF000
+
+config PRE_CON_BUF_SZ
+	default 4096
+
 config BOOTSTAGE_STASH_ADDR
 	default 0xC3000000
 
Signature · 1 line
2.7.4
#16 lore raw

PATCH 16/48 stm32mp1: configs: deactivate ARMV7_VIRT for basic boot

In reply to Patrick Delaunay

for the moment basic and trusted configuration must start CPU in Supervisor mode and not in Hypervisor

---

 configs/stm32mp15_basic_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/stm32mp15_basic_defconfig +1 -0
index 27b8525..a4c2027 100644
@@ -6,6 +6,7 @@ CONFIG_SPL=y
 CONFIG_TARGET_STM32MP1=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+# CONFIG_ARMV7_VIRT is not set
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
Signature · 1 line
2.7.4
#17 lore raw

PATCH 17/48 stm32mp1: configs: select CONFIG_STM32_SERIAL

In reply to Patrick Delaunay

Select the serial driver mandatory for the console.

---

 arch/arm/mach-stm32mp/Kconfig       | 1 +
 configs/stm32mp15_basic_defconfig   | 1 -
 configs/stm32mp15_optee_defconfig   | 1 -
 configs/stm32mp15_trusted_defconfig | 1 -
 4 files changed, 1 insertion(+), 3 deletions(-)
arch/arm/mach-stm32mp/Kconfig +1 -0
index 7efe464..0de9b3e 100644
@@ -42,6 +42,7 @@ config TARGET_STM32MP1
 	select PINCTRL_STM32
 	select STM32_RCC
 	select STM32_RESET
+	select STM32_SERIAL
 	select SYS_ARCH_TIMER
 	imply BOOTCOUNT_LIMIT
 	imply BOOTSTAGE
configs/stm32mp15_basic_defconfig +0 -1
index a4c2027..1edea79 100644
@@ -106,7 +106,6 @@ CONFIG_REMOTEPROC_STM32_COPRO=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_STM32=y
 CONFIG_SERIAL_RX_BUFFER=y
-CONFIG_STM32_SERIAL=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_STM32_QSPI=y
configs/stm32mp15_optee_defconfig +0 -1
index 0565e5e..11f8359 100644
@@ -92,7 +92,6 @@ CONFIG_REMOTEPROC_STM32_COPRO=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_STM32=y
 CONFIG_SERIAL_RX_BUFFER=y
-CONFIG_STM32_SERIAL=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_STM32_QSPI=y
configs/stm32mp15_trusted_defconfig +0 -1
index 844cbcd..bc76c08 100644
@@ -91,7 +91,6 @@ CONFIG_REMOTEPROC_STM32_COPRO=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_STM32=y
 CONFIG_SERIAL_RX_BUFFER=y
-CONFIG_STM32_SERIAL=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_STM32_QSPI=y
Signature · 1 line
2.7.4
#18 lore raw

PATCH 18/48 stm32mp1: configs: Activate DISABLE_CONSOLE

In reply to Patrick Delaunay

Activate DISABLE_CONSOLE needed for stm32prog support on uart.

---

 arch/arm/mach-stm32mp/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-stm32mp/Kconfig +1 -0
index 0de9b3e..cee3ce1 100644
@@ -48,6 +48,7 @@ config TARGET_STM32MP1
 	imply BOOTSTAGE
 	imply CMD_BOOTCOUNT
 	imply CMD_BOOTSTAGE
+	imply DISABLE_CONSOLE
 	imply PRE_CONSOLE_BUFFER
 	imply SILENT_CONSOLE
 	imply SYSRESET_PSCI if STM32MP1_TRUSTED
Signature · 1 line
2.7.4
#19 lore raw

PATCH 19/48 stm32mp1: configs: support MTDPARTS only if needed

In reply to Patrick Delaunay

MTD is only use if NAND or NOR driver is activated.

---

 include/configs/stm32mp1.h | 2 ++
 1 file changed, 2 insertions(+)
include/configs/stm32mp1.h +2 -0
index 033291e..b2b8660 100644
@@ -79,7 +79,9 @@
 #endif
 
 /* Dynamic MTD partition support */
+#if defined(CONFIG_STM32_QSPI) || defined(CONFIG_NAND_STM32_FMC2)
 #define CONFIG_SYS_MTDPARTS_RUNTIME
+#endif
 
 /*****************************************************************************/
 #ifdef CONFIG_DISTRO_DEFAULTS
Signature · 1 line
2.7.4
#20 lore raw

PATCH 20/48 stm32mp1: configs: imply CONFIG_OF_LIBFDT_OVERLAY

In reply to Patrick Delaunay

Add imply for FDT overlay that can be usefuill for kernel device tree management but it is not mandatory (can be removed to gain space)

---

 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig +1 -0
index 3f0e301..14108e6 100644
@@ -1545,6 +1545,7 @@ config ARCH_STM32MP
 	imply SPL_SYSRESET
 	imply CMD_DM
 	imply CMD_POWEROFF
+	imply OF_LIBFDT_OVERLAY
 	imply ENV_VARS_UBOOT_RUNTIME_CONFIG
 	imply USE_PREBOOT
 	help
Signature · 1 line
2.7.4
#21 lore raw

PATCH 21/48 stm32mp1: configs: Deactivate SPI_FLASH_BAR

In reply to Patrick Delaunay

Remove CONFIG_SPI_FLASH_BAR as the SPI NOR layer uses stateless 4 byte opcodes by default.

---

 configs/stm32mp15_basic_defconfig   | 1 -
 configs/stm32mp15_optee_defconfig   | 1 -
 configs/stm32mp15_trusted_defconfig | 1 -
 3 files changed, 3 deletions(-)
configs/stm32mp15_basic_defconfig +0 -1
index 1edea79..5a372e1 100644
@@ -81,7 +81,6 @@ CONFIG_NAND=y
 CONFIG_NAND_STM32_FMC2=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
-CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
configs/stm32mp15_optee_defconfig +0 -1
index 11f8359..a6c010e 100644
@@ -69,7 +69,6 @@ CONFIG_NAND=y
 CONFIG_NAND_STM32_FMC2=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
-CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
configs/stm32mp15_trusted_defconfig +0 -1
index bc76c08..de87834 100644
@@ -68,7 +68,6 @@ CONFIG_NAND=y
 CONFIG_NAND_STM32_FMC2=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
-CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
Signature · 1 line
2.7.4
#22 lore raw

PATCH 22/48 stm32mp1: configs: add CONFIG_DM_VIDEO

In reply to Patrick Delaunay

Activate command DM_VIDEO for LCD support

---

 configs/stm32mp15_basic_defconfig   | 1 +
 configs/stm32mp15_optee_defconfig   | 1 +
 configs/stm32mp15_trusted_defconfig | 1 +
 3 files changed, 3 insertions(+)
configs/stm32mp15_basic_defconfig +1 -0
index 5a372e1..7e5ae45 100644
@@ -119,4 +119,5 @@ CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0483
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
 CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_DM_VIDEO=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
configs/stm32mp15_optee_defconfig +1 -0
index a6c010e..0860a26 100644
@@ -105,4 +105,5 @@ CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0483
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
 CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_DM_VIDEO=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
configs/stm32mp15_trusted_defconfig +1 -0
index de87834..5855c36 100644
@@ -104,4 +104,5 @@ CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0483
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
 CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_DM_VIDEO=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
Signature · 1 line
2.7.4
#23 lore raw

PATCH 23/48 stm32mp1: configs: add BACKLIGHT_GPIO support

In reply to Patrick Delaunay

Backlight of panel raydium RM68200 is controlled by a simple gpio, thus we activate the support for the needed driver.

---

 configs/stm32mp15_basic_defconfig   | 1 +
 configs/stm32mp15_optee_defconfig   | 1 +
 configs/stm32mp15_trusted_defconfig | 1 +
 3 files changed, 3 insertions(+)
configs/stm32mp15_basic_defconfig +1 -0
index 7e5ae45..ca7e91c 100644
@@ -120,4 +120,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0483
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_DM_VIDEO=y
+CONFIG_BACKLIGHT_GPIO=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
configs/stm32mp15_optee_defconfig +1 -0
index 0860a26..f480c3d 100644
@@ -106,4 +106,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0483
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_DM_VIDEO=y
+CONFIG_BACKLIGHT_GPIO=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
configs/stm32mp15_trusted_defconfig +1 -0
index 5855c36..585817e 100644
@@ -105,4 +105,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0483
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_DM_VIDEO=y
+CONFIG_BACKLIGHT_GPIO=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
Signature · 1 line
2.7.4
#24 lore raw

PATCH 24/48 stm32mp1: configs: add CONFIG_CMD_BMP

In reply to Patrick Delaunay

Activate command BMP for splash screen support

---

 configs/stm32mp15_basic_defconfig   | 1 +
 configs/stm32mp15_optee_defconfig   | 1 +
 configs/stm32mp15_trusted_defconfig | 1 +
 3 files changed, 3 insertions(+)
configs/stm32mp15_basic_defconfig +1 -0
index ca7e91c..740d482 100644
@@ -37,6 +37,7 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
configs/stm32mp15_optee_defconfig +1 -0
index f480c3d..e5b9be7 100644
@@ -27,6 +27,7 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
configs/stm32mp15_trusted_defconfig +1 -0
index 585817e..2d9be04 100644
@@ -26,6 +26,7 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
Signature · 1 line
2.7.4
#25 lore raw

PATCH 25/48 stm32mp1: configs: add condition to activate WATCHDOG in SPL

In reply to Patrick Delaunay

Only activate WATCHDOG in SPL when CONFIG_WATCHDOG is activated in U-Boot.

---

 arch/arm/mach-stm32mp/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-stm32mp/Kconfig +1 -1
index cee3ce1..187be17 100644
@@ -17,7 +17,7 @@ config SPL
 	select SPL_DM_RESET
 	select SPL_SERIAL_SUPPORT
 	select SPL_SYSCON
-	select SPL_WATCHDOG_SUPPORT
+	select SPL_WATCHDOG_SUPPORT if WATCHDOG
 	imply BOOTSTAGE_STASH if SPL_BOOTSTAGE
 	imply SPL_BOOTSTAGE if BOOTSTAGE
 	imply SPL_DISPLAY_PRINT
Signature · 1 line
2.7.4
#26 lore raw

PATCH 26/48 stm32mp1: configs: add altbootcmd

In reply to Patrick Delaunay

Add altbootcmad as it is used for
- bootcountlimit
- in mach-stm32mp/cpu.c for BOOT_RECOVERY mode

---

 include/configs/stm32mp1.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/configs/stm32mp1.h +2 -1
index b2b8660..ae05308 100644
@@ -150,7 +150,8 @@
 	"ramdisk_addr_r=0xc4400000\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
-	"env_default=1\0"				\
+	"altbootcmd=run bootcmd\0" \
+	"env_default=1\0" \
 	"env_check=if test $env_default -eq 1;"\
 		" then env set env_default 0;env save;fi\0" \
 	STM32MP_BOOTCMD \
Signature · 1 line
2.7.4
#27 lore raw

PATCH 27/48 stm32mp1: configs: Set bootdelay to 1

In reply to Patrick Delaunay

From: Patrice Chotard <[email protected]>

This allows to display splashcreen without waiting an extra delay of 2 seconds due to default value of bootdelay.

---

 include/configs/stm32mp1.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/stm32mp1.h +1 -0
index ae05308..92660fe 100644
@@ -142,6 +142,7 @@
  * and the ramdisk at the end.
  */
 #define CONFIG_EXTRA_ENV_SETTINGS \
+	"bootdelay=1\0" \
 	"kernel_addr_r=0xc2000000\0" \
 	"fdt_addr_r=0xc4000000\0" \
 	"scriptaddr=0xc4100000\0" \
Signature · 1 line
2.7.4
#28 lore raw

PATCH 28/48 stm32mp1: configs: add spi load support in spl

In reply to Patrick Delaunay

Add the boot for NOR, SPL load U-Boot.img at offset CONFIG_SYS_SPI_U_BOOT_OFFS = 0x80000.
It is the start address of mtd partition ssbl in nor.

---

 arch/arm/mach-stm32mp/Kconfig | 1 +
 include/configs/stm32mp1.h    | 5 +++++
 2 files changed, 6 insertions(+)
arch/arm/mach-stm32mp/Kconfig +1 -0
index 187be17..c9bc084 100644
@@ -16,6 +16,7 @@ config SPL
 	select SPL_REGMAP
 	select SPL_DM_RESET
 	select SPL_SERIAL_SUPPORT
+	select SPL_SPI_LOAD
 	select SPL_SYSCON
 	select SPL_WATCHDOG_SUPPORT if WATCHDOG
 	imply BOOTSTAGE_STASH if SPL_BOOTSTAGE
include/configs/stm32mp1.h +5 -0
index 92660fe..88f8254 100644
@@ -70,6 +70,11 @@
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 
+/* SPI FLASH support */
+#if defined(CONFIG_SPL_BUILD)
+#define CONFIG_SYS_SPI_U_BOOT_OFFS	0x80000
+#endif
+
 /* Ethernet need */
 #ifdef CONFIG_DWC_ETH_QOS
 #define CONFIG_SYS_NONCACHED_MEMORY	(1 * SZ_1M)	/* 1M */
Signature · 1 line
2.7.4
#29 lore raw

PATCH 29/48 stm32mp1: board: add environment variable for board id and board rev

In reply to Patrick Delaunay

Add variable to identify board with HW id (read from OTP) and revision.

---

 board/st/stm32mp1/stm32mp1.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
board/st/stm32mp1/stm32mp1.c +19 -0
index b99c6c0..ad3db31 100644
@@ -538,6 +538,10 @@ int board_late_init(void)
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 	const void *fdt_compat;
 	int fdt_compat_len;
+	int ret;
+	u32 otp;
+	struct udevice *dev;
+	char buf[10];
 
 	fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible",
 				 &fdt_compat_len);
@@ -547,6 +551,21 @@ int board_late_init(void)
 		else
 			env_set("board_name", fdt_compat + 3);
 	}
+	ret = uclass_get_device_by_driver(UCLASS_MISC,
+					  DM_GET_DRIVER(stm32mp_bsec),
+					  &dev);
+
+	if (!ret)
+		ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD),
+				&otp, sizeof(otp));
+	if (!ret && otp) {
+		snprintf(buf, sizeof(buf), "0x%04x", otp >> 16);
+		env_set("board_id", buf);
+
+		snprintf(buf, sizeof(buf), "0x%04x",
+			 ((otp >> 8) & 0xF) - 1 + 0xA);
+		env_set("board_rev", buf);
+	}
 #endif
 
 	/* for DK1/DK2 boards */
Signature · 1 line
2.7.4
#30 lore raw

PATCH 30/48 stm32mp1: board: enable v1v2_hdmi and v3v3_hdmi regulator on dk2 boot

In reply to Patrick Delaunay

As for Audio codec IC, HDMI IC is not "IO safe". HDMI regulators (v3v3 and v1v2) must be enabled to allow I2C1 bus usage. HDMI IC must be under reset during power up and keep HDMI and AUDIO devices in reset while they are not used in U-Boot to keep them in low power mode
(each device can be kept in reset independently keeping their power supplies ON until kernel).

---

 arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi |  6 +++
 board/st/stm32mp1/Kconfig                |  4 ++
 board/st/stm32mp1/stm32mp1.c             | 70 ++++++++++++++++++++++++++++++++
 3 files changed, 80 insertions(+)
arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi +6 -0
index 06ef3a4..18ac1e3 100644
@@ -4,3 +4,9 @@
  */
 
 #include "stm32mp157a-dk1-u-boot.dtsi"
+
+&i2c1 {
+	hdmi-transmitter at 39 {
+		reset-gpios = <&gpioa 10 GPIO_ACTIVE_LOW>;
+	};
+};
board/st/stm32mp1/Kconfig +4 -0
index 87216c0..4fa2360 100644
@@ -22,4 +22,8 @@ config CMD_STBOARD
 	  This compile the stboard command to
 	  read and write the board in the OTP.
 
+config TARGET_STM32MP157C_DK2
+	bool "support of STMicroelectronics STM32MP157C-DK2 Discovery Board"
+	default y
+
 endif
board/st/stm32mp1/stm32mp1.c +70 -0

82 lines not on this page · raw message

Signature · 1 line
2.7.4
#31 lore raw

PATCH 31/48 stm32mp1: board: support of error led on ed1/ev1 board

In reply to Patrick Delaunay

Create a function led_error_blink and add node in device tree.

---

 arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 21 ++++----------
 board/st/stm32mp1/stm32mp1.c             | 48 ++++++++++++++++++++++----------
 2 files changed, 39 insertions(+), 30 deletions(-)
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi +6 -15
index 21c89c1..4953a0d 100644
@@ -15,31 +15,22 @@
 	};
 
 	config {
+		u-boot,boot-led = "heartbeat";
+		u-boot,error-led = "error";
 		st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
 		st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
 	};
 
 	led {
-		compatible = "gpio-leds";
-
 		red {
-			label = "stm32mp:red:status";
+			label = "error";
 			gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
 			default-state = "off";
+			status = "okay";
 		};
-		green {
-			label = "stm32mp:green:user";
-			gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
-			default-state = "on";
-		};
-		orange {
-			label = "stm32mp:orange:status";
-			gpios = <&gpioh 7 GPIO_ACTIVE_HIGH>;
-			default-state = "off";
-		};
+
 		blue {
-			label = "stm32mp:blue:user";
-			gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
 		};
 	};
 };
board/st/stm32mp1/stm32mp1.c +33 -15

77 lines not on this page · raw message

Signature · 1 line
2.7.4
#32 lore raw

PATCH 32/48 stm32mp1: board: protect the led function calls

In reply to Patrick Delaunay

Avoid compilation issue when CONFIG_LED is not activated

---

 board/st/stm32mp1/stm32mp1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
board/st/stm32mp1/stm32mp1.c +3 -1
index 61a4253..181409c 100644
@@ -615,7 +615,7 @@ int board_init(void)
 
 	sysconf_init();
 
-	if (IS_ENABLED(CONFIG_LED))
+	if (CONFIG_IS_ENABLED(CONFIG_LED))
 		led_default_state();
 
 	return 0;
@@ -664,7 +664,9 @@ int board_late_init(void)
 
 void board_quiesce_devices(void)
 {
+#ifdef CONFIG_LED
 	setup_led(LEDST_OFF);
+#endif
 }
 
 /* board interface eth init */
Signature · 1 line
2.7.4
#33 lore raw

PATCH 33/48 stm32mp1: board: check the boot-source to disable bootdelay

In reply to Patrick Delaunay

Allows to avoid to wait 2 second in U-Boot before to start STM32CubeProgrammer command.

---

 board/st/stm32mp1/stm32mp1.c | 6 ++++++
 1 file changed, 6 insertions(+)
board/st/stm32mp1/stm32mp1.c +6 -0
index 181409c..c61a562 100644
@@ -623,6 +623,7 @@ int board_init(void)
 
 int board_late_init(void)
 {
+	char *boot_device;
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 	const void *fdt_compat;
 	int fdt_compat_len;
@@ -659,6 +660,11 @@ int board_late_init(void)
 	/* for DK1/DK2 boards */
 	board_check_usb_power();
 
+	/* Check the boot-source to disable bootdelay */
+	boot_device = env_get("boot_device");
+	if (!strcmp(boot_device, "serial") || !strcmp(boot_device, "usb"))
+		env_set("bootdelay", "0");
+
 	return 0;
 }
 
Signature · 1 line
2.7.4
#34 lore raw

PATCH 34/48 stm32mp1: board: Update the way vdd-supply is retrieved from DT

In reply to Patrick Delaunay

Due to kernel DT alignment, pwr-supply is renamed to vdd-supply and is a subnode of pwr-regulators.

---

 arch/arm/dts/stm32mp157a-avenger96.dts | 5 ++++-
 arch/arm/dts/stm32mp157a-dk1.dts       | 5 ++++-
 arch/arm/dts/stm32mp157c-ed1.dts       | 5 ++++-
 board/st/stm32mp1/stm32mp1.c           | 8 +++++---
 4 files changed, 17 insertions(+), 6 deletions(-)
arch/arm/dts/stm32mp157a-avenger96.dts +4 -1
index ba86cf5..5b15a4a 100644
@@ -283,7 +283,10 @@
 };
 
 &pwr {
-	pwr-supply = <&vdd>;
+	pwr-regulators {
+		vdd-supply = <&vdd>;
+		vdd_3v3_usbfs-supply = <&vdd_usb>;
+	};
 };
 
 &rng1 {
arch/arm/dts/stm32mp157a-dk1.dts +4 -1
index 1d5c1a6..ba612a5 100644
@@ -308,7 +308,10 @@
 };
 
 &pwr {
-	pwr-supply = <&vdd>;
+	pwr-regulators {
+		vdd-supply = <&vdd>;
+		vdd_3v3_usbfs-supply = <&vdd_usb>;
+	};
 };
 
 &rng1 {
arch/arm/dts/stm32mp157c-ed1.dts +4 -1
index 94ac025..3e8b7b5 100644
@@ -218,7 +218,10 @@
 };
 
 &pwr {
-	pwr-supply = <&vdd>;
+	pwr-regulators {
+		vdd-supply = <&vdd>;
+		vdd_3v3_usbfs-supply = <&vdd_usb>;
+	};
 };
 
 &rng1 {
board/st/stm32mp1/stm32mp1.c +5 -3
index c61a562..a96e675 100644
@@ -471,7 +471,9 @@ static void sysconf_init(void)
 	 *   => U-Boot set the register only if VDD < 2.7V (in DT)
 	 *      but this value need to be consistent with board design
 	 */
-	ret = syscon_get_by_driver_data(STM32MP_SYSCON_PWR, &pwr_dev);
+	ret = uclass_get_device_by_driver(UCLASS_PMIC,
+					  DM_GET_DRIVER(stm32mp_pwr_pmic),
+					  &pwr_dev);
 	if (!ret) {
 		ret = uclass_get_device_by_driver(UCLASS_MISC,
 						  DM_GET_DRIVER(stm32mp_bsec),
@@ -485,8 +487,8 @@ static void sysconf_init(void)
 		if (!ret)
 			otp = otp & BIT(13);
 
-		/* get VDD = pwr-supply */
-		ret = device_get_supply_regulator(pwr_dev, "pwr-supply",
+		/* get VDD = vdd-supply */
+		ret = device_get_supply_regulator(pwr_dev, "vdd-supply",
 						  &pwr_reg);
 
 		/* check if VDD is Low Voltage */
Signature · 1 line
2.7.4
#35 lore raw

PATCH 35/48 stm32mp1: board: remove board_check_usb_power when ADC is not activated

In reply to Patrick Delaunay

Avoid compilation issue when CONFIG_ADC is not activated

---

 board/st/stm32mp1/stm32mp1.c | 4 ++++
 1 file changed, 4 insertions(+)
board/st/stm32mp1/stm32mp1.c +4 -0
index a96e675..a67e33e 100644
@@ -296,6 +296,7 @@ static void __maybe_unused led_error_blink(u32 nb_blink)
 		hang();
 }
 
+#ifdef CONFIG_ADC
 static int board_check_usb_power(void)
 {
 	struct ofnode_phandle_args adc_args;
@@ -429,6 +430,7 @@ static int board_check_usb_power(void)
 
 	return 0;
 }
+#endif /* CONFIG_ADC */
 
 static void sysconf_init(void)
 {
@@ -659,8 +661,10 @@ int board_late_init(void)
 	}
 #endif
 
+#ifdef CONFIG_ADC
 	/* for DK1/DK2 boards */
 	board_check_usb_power();
+#endif /* CONFIG_ADC */
 
 	/* Check the boot-source to disable bootdelay */
 	boot_device = env_get("boot_device");
Signature · 1 line
2.7.4
#36 lore raw

PATCH 36/48 stm32mp1: board: cosmetic: cleanup file

In reply to Patrick Delaunay

- reorder include files
- remove one comment

---

 board/st/stm32mp1/stm32mp1.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
board/st/stm32mp1/stm32mp1.c +1 -2
index a67e33e..7085bd5 100644
@@ -5,8 +5,8 @@
 #include <common.h>
 #include <adc.h>
 #include <bootm.h>
-#include <config.h>
 #include <clk.h>
+#include <config.h>
 #include <dm.h>
 #include <environment.h>
 #include <g_dnl.h>
@@ -682,7 +682,6 @@ void board_quiesce_devices(void)
 }
 
 /* board interface eth init */
-/* this is a weak define that we are overriding */
 int board_interface_eth_init(phy_interface_t interface_type,
 			     bool eth_clk_sel_reg, bool eth_ref_clk_sel_reg)
 {
Signature · 1 line
2.7.4
#37 lore raw

PATCH 37/48 mmc: stm32_sdmmc2: reload watchdog

In reply to Patrick Delaunay

From: Christophe Kerello <[email protected]>

This patch solves a watchdog reset issue during mmc erase command.

---

 drivers/mmc/stm32_sdmmc2.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mmc/stm32_sdmmc2.c +3 -0
index 867ed56..e7058cb 100644
@@ -14,6 +14,7 @@
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <linux/iopoll.h>
+#include <watchdog.h>
 
 struct stm32_sdmmc2_plat {
 	struct mmc_config cfg;
@@ -432,6 +433,8 @@ static int stm32_sdmmc2_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 	u32 cmdat = data ? SDMMC_CMD_CMDTRANS : 0;
 	int ret, retry = 3;
 
+	WATCHDOG_RESET();
+
 retry_cmd:
 	ctx.data_length = 0;
 	ctx.dpsm_abort = false;
Signature · 1 line
2.7.4
#38 lore raw

PATCH 38/48 serial: stm32: add Framing error support

In reply to Patrick Delaunay

Add management of Bit 1 of USART_ISR = FE: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register (for stm32 after f4).

---

 drivers/serial/serial_stm32.c | 5 +++--
 drivers/serial/serial_stm32.h | 2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/serial/serial_stm32.c +3 -2
index 3ab536a..00a8e72 100644
@@ -106,10 +106,11 @@ static int stm32_serial_getc(struct udevice *dev)
 	if ((isr & USART_ISR_RXNE) == 0)
 		return -EAGAIN;
 
-	if (isr & (USART_ISR_PE | USART_ISR_ORE)) {
+	if (isr & (USART_ISR_PE | USART_ISR_ORE | USART_ISR_FE)) {
 		if (!stm32f4)
 			setbits_le32(base + ICR_OFFSET,
-				     USART_ICR_PCECF | USART_ICR_ORECF);
+				     USART_ICR_PCECF | USART_ICR_ORECF |
+				     USART_ICR_FECF);
 		else
 			readl(base + RDR_OFFSET(stm32f4));
 		return -EIO;
drivers/serial/serial_stm32.h +2 -0
index 5549f8c..7b0c531 100644
@@ -67,6 +67,7 @@ struct stm32x7_serial_platdata {
 #define USART_ISR_TXE			BIT(7)
 #define USART_ISR_RXNE			BIT(5)
 #define USART_ISR_ORE			BIT(3)
+#define USART_ISR_FE			BIT(1)
 #define USART_ISR_PE			BIT(0)
 
 #define USART_BRR_F_MASK		GENMASK(7, 0)
@@ -74,6 +75,7 @@ struct stm32x7_serial_platdata {
 #define USART_BRR_M_MASK		GENMASK(15, 4)
 
 #define USART_ICR_ORECF			BIT(3)
+#define USART_ICR_FECF			BIT(1)
 #define USART_ICR_PCECF			BIT(0)
 
 #endif
Signature · 1 line
2.7.4
#39 lore raw

PATCH 39/48 serial: stm32: remove unused include

In reply to Patrick Delaunay

The "serial_stm32.h" is only used by drivers/serial/serial_stm32.c and it is the file ./drivers/serial/serial_stm32.h

---

 include/dm/platform_data/serial_stm32.h | 15 ---------------
 1 file changed, 15 deletions(-)
 delete mode 100644 include/dm/platform_data/serial_stm32.h
include/dm/platform_data/serial_stm32.h deleted +0 -15
deleted file mode 100644
index 85153df..0000000
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2015
- * Kamil Lulko, <[email protected]>
- */
-
-#ifndef __SERIAL_STM32_H
-#define __SERIAL_STM32_H
-
-/* Information about a serial port */
-struct stm32_serial_platdata {
-	struct stm32_usart *base;  /* address of registers in physical memory */
-};
-
-#endif /* __SERIAL_STM32_H */
Signature · 1 line
2.7.4
#40 lore raw

PATCH 40/48 stm32mp1: ram: cosmetic: remove unused prototype

In reply to Patrick Delaunay

---

 drivers/ram/stm32mp1/stm32mp1_ddr.h | 4 ----
 1 file changed, 4 deletions(-)
drivers/ram/stm32mp1/stm32mp1_ddr.h +0 -4
index a8eed89..52b748f 100644
@@ -197,10 +197,6 @@ void stm32mp1_edit_param(const struct stm32mp1_ddr_config *config,
 			 char *name,
 			 char *string);
 
-void stm32mp1_dump_info(
-	const struct ddr_info *priv,
-	const struct stm32mp1_ddr_config *config);
-
 bool stm32mp1_ddr_interactive(
 	void *priv,
 	enum stm32mp1_ddr_interact_step step,
Signature · 1 line
2.7.4
#41 lore raw

PATCH 41/48 stm32mp1: ram: fix address issue in 2 tests

In reply to Patrick Delaunay

If user choose to test memory size is 1GByte (0x40000000), memory address would overflow in test "Random" and test "FrequencySelectivePattern".
Thus the system would hangs up when running DDR test.

---

 drivers/ram/stm32mp1/stm32mp1_tests.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
drivers/ram/stm32mp1/stm32mp1_tests.c +14 -11
index b6fb2a9..691c63c 100644
@@ -578,27 +578,29 @@ static enum test_result test_random(struct stm32mp1_ddrctl *ctl,
 	u32 error = 0;
 	unsigned int seed;
 
-	if (get_bufsize(string, argc, argv, 0, &bufsize, 4 * 1024))
+	if (get_bufsize(string, argc, argv, 0, &bufsize, 8 * 1024))
 		return TEST_ERROR;
 	if (get_nb_loop(string, argc, argv, 1, &nb_loop, 1))
 		return TEST_ERROR;
 	if (get_addr(string, argc, argv, 2, &addr))
 		return TEST_ERROR;
 
-	printf("running %d loops at 0x%x\n", nb_loop, addr);
+	bufsize /= 2;
+	printf("running %d loops copy from 0x%x to 0x%x (buffer size=0x%x)\n",
+	       nb_loop, addr, addr + bufsize, bufsize);
 	while (!error) {
 		seed = rand();
-		for (offset = addr; offset < addr + bufsize; offset += 4)
-			writel(rand(), offset);
+		for (offset = 0; offset < bufsize; offset += 4)
+			writel(rand(), addr + offset);
 
 		memcpy((void *)addr + bufsize, (void *)addr, bufsize);
 
 		srand(seed);
-		for (offset = addr; offset < addr + 2 * bufsize; offset += 4) {
-			if (offset == (addr + bufsize))
+		for (offset = 0; offset < 2 * bufsize; offset += 4) {
+			if (offset == bufsize)
 				srand(seed);
 			value = rand();
-			error = check_addr(offset, value);
+			error = check_addr(addr + offset, value);
 			if (error)
 				break;
 			if (progress(offset))
@@ -607,6 +609,7 @@ static enum test_result test_random(struct stm32mp1_ddrctl *ctl,
 		if (test_loop_end(&loop, nb_loop, 100))
 			break;
 	}
+	putc('\n');
 
 	if (error) {
 		sprintf(string,
@@ -791,9 +794,9 @@ static enum test_result test_loop(const u32 *pattern, u32 *address,
 	int i;
 	int j;
 	enum test_result res = TEST_PASSED;
-	u32 *offset, testsize, remaining;
+	u32 offset, testsize, remaining;
 
-	offset = address;
+	offset = (u32)address;
 	remaining = bufsize;
 	while (remaining) {
 		testsize = bufsize > 0x1000000 ? 0x1000000 : bufsize;
@@ -809,7 +812,7 @@ static enum test_result test_loop(const u32 *pattern, u32 *address,
 		__asm__("stmia r1!, {R3-R10}");
 		__asm__("stmia r1!, {R3-R10}");
 		__asm__("stmia r1!, {R3-R10}");
-		__asm__("subs r2, r2, #8");
+		__asm__("subs r2, r2, #128");
 		__asm__("bge loop2");
 		__asm__("pop {R0-R10}");
 
@@ -1388,7 +1391,7 @@ const struct test_desc test[] = {
 	 "Verifies r/w and memcopy(burst for pseudo random value.",
 	 3
 	},
-	{test_freq_pattern, "FrequencySelectivePattern ", "[size]",
+	{test_freq_pattern, "FrequencySelectivePattern", "[size]",
 	 "write & test patterns: Mostly Zero, Mostly One and F/n",
 	 1
 	},
Signature · 1 line
2.7.4
#42 lore raw

PATCH 42/48 stm32mp1: ram: update loop management in infinite test

In reply to Patrick Delaunay

Reduce verbosity of the infinite tests to avoid CubeMX issue. test and display loop by 1024*1024 accesses: read or write.

---

 drivers/ram/stm32mp1/stm32mp1_tests.c | 38 +++++++++++++++++++++++------------
 1 file changed, 25 insertions(+), 13 deletions(-)
drivers/ram/stm32mp1/stm32mp1_tests.c +25 -13
index 691c63c..7356802 100644
@@ -1241,6 +1241,7 @@ static enum test_result test_read(struct stm32mp1_ddrctl *ctl,
 	u32 *addr;
 	u32 data;
 	u32 loop = 0;
+	int i, size = 1024 * 1024;
 	bool random = false;
 
 	if (get_addr(string, argc, argv, 0, (u32 *)&addr))
@@ -1254,14 +1255,19 @@ static enum test_result test_read(struct stm32mp1_ddrctl *ctl,
 	printf("running at 0x%08x\n", (u32)addr);
 
 	while (1) {
-		if (random)
-			addr = (u32 *)(STM32_DDR_BASE +
-			       (rand() & (STM32_DDR_SIZE - 1) & ~0x3));
-		data = readl(addr);
-		if (test_loop_end(&loop, 0, 1000))
+		for (i = 0; i < size; i++) {
+			if (random)
+				addr = (u32 *)(STM32_DDR_BASE +
+				       (rand() & (STM32_DDR_SIZE - 1) & ~0x3));
+			data = readl(addr);
+		}
+		if (test_loop_end(&loop, 0, 1))
 			break;
 	}
-	sprintf(string, "0x%x: %x", (u32)addr, data);
+	if (random)
+		sprintf(string, "%d loops random", loop);
+	else
+		sprintf(string, "%d loops at 0x%x: %x", loop, (u32)addr, data);
 
 	return TEST_PASSED;
 }
@@ -1280,6 +1286,7 @@ static enum test_result test_write(struct stm32mp1_ddrctl *ctl,
 	u32 *addr;
 	u32 data = 0xA5A5AA55;
 	u32 loop = 0;
+	int i, size = 1024 * 1024;
 	bool random = false;
 
 	if (get_addr(string, argc, argv, 0, (u32 *)&addr))
@@ -1293,16 +1300,21 @@ static enum test_result test_write(struct stm32mp1_ddrctl *ctl,
 	printf("running at 0x%08x\n", (u32)addr);
 
 	while (1) {
-		if (random) {
-			addr = (u32 *)(STM32_DDR_BASE +
-			       (rand() & (STM32_DDR_SIZE - 1) & ~0x3));
-			data = rand();
+		for (i = 0; i < size; i++) {
+			if (random) {
+				addr = (u32 *)(STM32_DDR_BASE +
+				       (rand() & (STM32_DDR_SIZE - 1) & ~0x3));
+				data = rand();
+			}
+			writel(data, addr);
 		}
-		writel(data, addr);
-		if (test_loop_end(&loop, 0, 1000))
+		if (test_loop_end(&loop, 0, 1))
 			break;
 	}
-	sprintf(string, "0x%x: %x", (u32)addr, data);
+	if (random)
+		sprintf(string, "%d loops random", loop);
+	else
+		sprintf(string, "%d loops@0x%x: %x", loop, (u32)addr, data);
 
 	return TEST_PASSED;
 }
Signature · 1 line
2.7.4
#43 lore raw

PATCH 43/48 stm32mp1: ram: reload watchdog during ddr test

In reply to Patrick Delaunay

Avoid watchdog during infinite DDR test.

---

 drivers/ram/stm32mp1/stm32mp1_tests.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/ram/stm32mp1/stm32mp1_tests.c +3 -0
index 7356802..f947b5d 100644
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <console.h>
+#include <watchdog.h>
 #include <asm/io.h>
 #include <linux/log2.h>
 #include "stm32mp1_tests.h"
@@ -154,6 +155,8 @@ static int test_loop_end(u32 *loop, u32 nb_loop, u32 progress)
 		return 1;
 	}
 	printf("loop #%d\n", *loop);
+	WATCHDOG_RESET();
+
 	return 0;
 }
 
Signature · 1 line
2.7.4
#44 lore raw

PATCH 44/48 stm32mp1: ram: add pattern parameter in infinite write test

In reply to Patrick Delaunay

Add pattern for infinite test_read and test_write, that allow to change the pattern to test without recompilation; default pattern is 0xA5A5AA55.

---

 drivers/ram/stm32mp1/stm32mp1_tests.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)
drivers/ram/stm32mp1/stm32mp1_tests.c +20 -11
index f947b5d..581ee48 100644
@@ -1250,13 +1250,18 @@ static enum test_result test_read(struct stm32mp1_ddrctl *ctl,
 	if (get_addr(string, argc, argv, 0, (u32 *)&addr))
 		return TEST_ERROR;
 
+	if (get_pattern(string, argc, argv, 1, &data, 0xA5A5AA55))
+		return TEST_ERROR;
+
 	if ((u32)addr == ADDR_INVALID) {
-		printf("random ");
+		printf("running random\n");
 		random = true;
+	} else {
+		printf("running at 0x%08x with pattern=0x%08x\n",
+		       (u32)addr, data);
+		writel(data, addr);
 	}
 
-	printf("running at 0x%08x\n", (u32)addr);
-
 	while (1) {
 		for (i = 0; i < size; i++) {
 			if (random)
@@ -1287,7 +1292,7 @@ static enum test_result test_write(struct stm32mp1_ddrctl *ctl,
 				   char *string, int argc, char *argv[])
 {
 	u32 *addr;
-	u32 data = 0xA5A5AA55;
+	u32 data;
 	u32 loop = 0;
 	int i, size = 1024 * 1024;
 	bool random = false;
@@ -1295,13 +1300,17 @@ static enum test_result test_write(struct stm32mp1_ddrctl *ctl,
 	if (get_addr(string, argc, argv, 0, (u32 *)&addr))
 		return TEST_ERROR;
 
+	if (get_pattern(string, argc, argv, 1, &data, 0xA5A5AA55))
+		return TEST_ERROR;
+
 	if ((u32)addr == ADDR_INVALID) {
-		printf("random ");
+		printf("running random\n");
 		random = true;
+	} else {
+		printf("running at 0x%08x with pattern 0x%08x\n",
+		       (u32)addr, data);
 	}
 
-	printf("running@0x%08x\n", (u32)addr);
-
 	while (1) {
 		for (i = 0; i < size; i++) {
 			if (random) {
@@ -1435,10 +1444,10 @@ const struct test_desc test[] = {
 	 3
 	},
 	/* need to the the 2 last one (infinite) : skipped for test all */
-	{test_read, "infinite read", "[addr]",
-	 "basic test : infinite read access", 1},
-	{test_write, "infinite write", "[addr]",
-	 "basic test : infinite write access", 1},
+	{test_read, "infinite read", "[addr] [pattern]",
+	 "basic test : infinite read access (random: addr=0xFFFFFFFF)", 2},
+	{test_write, "infinite write", "[addr] [pattern]",
+	 "basic test : infinite write access (random: addr=0xFFFFFFFF)", 2},
 };
 
 const int test_nb = ARRAY_SIZE(test);
Signature · 1 line
2.7.4
#45 lore raw

PATCH 45/48 stm32mp1: Makefile cleanup

In reply to Patrick Delaunay

Don't compile psci for SPL build.

---

 arch/arm/mach-stm32mp/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-stm32mp/Makefile +2 -1
index 7745060..299f9a7 100644
@@ -15,7 +15,8 @@ obj-$(CONFIG_CMD_STM32KEY) += cmd_stm32key.o
 ifndef CONFIG_STM32MP1_TRUSTED
 obj-$(CONFIG_SYSRESET) += cmd_poweroff.o
 endif
-endif
 obj-$(CONFIG_ARMV7_PSCI) += psci.o
+endif
+
 obj-$(CONFIG_$(SPL_)DM_REGULATOR) += pwr_regulator.o
 obj-$(CONFIG_OF_SYSTEM_SETUP) += fdt.o
Signature · 1 line
2.7.4
#46 lore raw

PATCH 46/48 stm32mp1: clk: remove debug traces

In reply to Patrick Delaunay

Remove many debug trace.

---

 drivers/clk/clk_stm32mp1.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)
drivers/clk/clk_stm32mp1.c +4 -17
index 5806d48..359c2b9 100644
@@ -759,9 +759,6 @@ static ulong stm32mp1_clk_get_fixed(struct stm32mp1_clk_priv *priv, int idx)
 		return 0;
 	}
 
-	debug("%s: clk id %d = %x : %ld kHz\n", __func__, idx,
-	      (u32)priv->osc[idx], priv->osc[idx] / 1000);
-
 	return priv->osc[idx];
 }
 
@@ -863,8 +860,6 @@ static ulong  pll_get_fref_ck(struct stm32mp1_clk_priv *priv,
 	src = selr & RCC_SELR_SRC_MASK;
 
 	refclk = stm32mp1_clk_get_fixed(priv, pll[pll_id].refclk[src]);
-	debug("PLL%d : selr=%x refclk = %d kHz\n",
-	      pll_id, selr, (u32)(refclk / 1000));
 
 	return refclk;
 }
@@ -889,9 +884,6 @@ static ulong pll_get_fvco(struct stm32mp1_clk_priv *priv,
 	divm = (cfgr1 & (RCC_PLLNCFGR1_DIVM_MASK)) >> RCC_PLLNCFGR1_DIVM_SHIFT;
 	divn = cfgr1 & RCC_PLLNCFGR1_DIVN_MASK;
 
-	debug("PLL%d : cfgr1=%x fracr=%x DIVN=%d DIVM=%d\n",
-	      pll_id, cfgr1, fracr, divn, divm);
-
 	refclk = pll_get_fref_ck(priv, pll_id);
 
 	/* with FRACV :
@@ -908,7 +900,6 @@ static ulong pll_get_fvco(struct stm32mp1_clk_priv *priv,
 	} else {
 		fvco = (ulong)(refclk * (divn + 1) / (divm + 1));
 	}
-	debug("PLL%d : %s = %ld\n", pll_id, __func__, fvco);
 
 	return fvco;
 }
@@ -921,17 +912,13 @@ static ulong stm32mp1_read_pll_freq(struct stm32mp1_clk_priv *priv,
 	ulong dfout;
 	u32 cfgr2;
 
-	debug("%s(%d, %d)\n", __func__, pll_id, div_id);
 	if (div_id >= _DIV_NB)
 		return 0;
 
 	cfgr2 = readl(priv->base + pll[pll_id].pllxcfgr2);
 	divy = (cfgr2 >> RCC_PLLNCFGR2_SHIFT(div_id)) & RCC_PLLNCFGR2_DIVX_MASK;
 
-	debug("PLL%d : cfgr2=%x DIVY=%d\n", pll_id, cfgr2, divy);
-
 	dfout = pll_get_fvco(priv, pll_id) / (divy + 1);
-	debug("        => dfout = %d kHz\n", (u32)(dfout / 1000));
 
 	return dfout;
 }
@@ -1574,9 +1561,6 @@ static void stgen_config(struct stm32mp1_clk_priv *priv)
 
 		/* need to update gd->arch.timer_rate_hz with new frequency */
 		timer_init();
-		pr_debug("gd->arch.timer_rate_hz = %x\n",
-			 (u32)gd->arch.timer_rate_hz);
-		pr_debug("Tick = %x\n", (u32)(get_ticks()));
 	}
 }
 
@@ -1882,7 +1866,6 @@ static int pll_set_output_rate(struct udevice *dev,
 	if (div > 128)
 		div = 128;
 
-	debug("fvco = %ld, clk_rate = %ld, div=%d\n", fvco, clk_rate, div);
 	/* stop the requested output */
 	clrbits_le32(pllxcr, 0x1 << div_id << RCC_PLLNCR_DIVEN_SHIFT);
 	/* change divider */
@@ -1915,6 +1898,9 @@ static ulong stm32mp1_clk_set_rate(struct clk *clk, unsigned long clk_rate)
 	}
 
 	p = stm32mp1_clk_get_parent(priv, clk->id);
+#ifdef DEBUG
+	debug("%s: parent = %d:%s\n", __func__, p, stm32mp1_clk_parent_name[p]);
+#endif
 	if (p < 0)
 		return -EINVAL;
 
@@ -1932,6 +1918,7 @@ static ulong stm32mp1_clk_set_rate(struct clk *clk, unsigned long clk_rate)
 		return result;
 	}
 #endif
+
 	case _PLL4_Q:
 		/* for LTDC_PX and DSI_PX case */
 		return pll_set_output_rate(clk->dev, _PLL4, _DIV_Q, clk_rate);
Signature · 1 line
2.7.4
#47 lore raw

PATCH 47/48 stm32mp1: clk: use gd to store frequency information

In reply to Patrick Delaunay

Use existing gd structure to store frequency information which can be used in drivers or arch without new request.

---

 drivers/clk/clk_stm32mp1.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/clk/clk_stm32mp1.c +9 -7
index 359c2b9..e87307f 100644
@@ -15,6 +15,8 @@
 #include <dt-bindings/clock/stm32mp1-clks.h>
 #include <dt-bindings/clock/stm32mp1-clksrc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifndef CONFIG_STM32MP1_TRUSTED
 #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
 /* activate clock tree initialization in the driver */
@@ -2042,22 +2044,22 @@ static int stm32mp1_clk_probe(struct udevice *dev)
 		stm32mp1_clk_dump(priv);
 #endif
 
+	gd->cpu_clk = stm32mp1_clk_get(priv, _CK_MPU);
+	gd->bus_clk = stm32mp1_clk_get(priv, _ACLK);
+	/* DDRPHYC father */
+	gd->mem_clk = stm32mp1_clk_get(priv, _PLL2_R);
 #if defined(CONFIG_DISPLAY_CPUINFO)
 	if (gd->flags & GD_FLG_RELOC) {
 		char buf[32];
 
 		printf("Clocks:\n");
-		printf("- MPU : %s MHz\n",
-		       strmhz(buf, stm32mp1_clk_get(priv, _CK_MPU)));
+		printf("- MPU : %s MHz\n", strmhz(buf, gd->cpu_clk));
 		printf("- MCU : %s MHz\n",
 		       strmhz(buf, stm32mp1_clk_get(priv, _CK_MCU)));
-		printf("- AXI : %s MHz\n",
-		       strmhz(buf, stm32mp1_clk_get(priv, _ACLK)));
+		printf("- AXI : %s MHz\n", strmhz(buf, gd->bus_clk));
 		printf("- PER : %s MHz\n",
 		       strmhz(buf, stm32mp1_clk_get(priv, _CK_PER)));
-		/* DDRPHYC father */
-		printf("- DDR : %s MHz\n",
-		       strmhz(buf, stm32mp1_clk_get(priv, _PLL2_R)));
+		printf("- DDR : %s MHz\n", strmhz(buf, gd->mem_clk));
 	}
 #endif /* CONFIG_DISPLAY_CPUINFO */
 #endif
Signature · 1 line
2.7.4
#48 lore raw

PATCH 48/48 MAINTAINERS: update ARM STM STM32MP and STM32MP1 BOARD

In reply to Patrick Delaunay

Add the missing driver and files for mach-stm32mp / stm32mp1 product.

---

 MAINTAINERS                   | 19 +++++++++++++++++--
 board/st/stm32mp1/MAINTAINERS |  5 +++--
 2 files changed, 20 insertions(+), 4 deletions(-)
MAINTAINERS +17 -2
index c28251e..8e2a999 100644
@@ -298,14 +298,19 @@ ARM STM STM32MP
 M:	Patrick Delaunay <[email protected]>
 M:	Patrice Chotard <[email protected]>
 L:	uboot-stm32 at st-md-mailman.stormreply.com (moderated for non-subscribers)
-T:	git https://gitlab.denx.de/u-boot/custodians/u-boot-stm
+T:	git https://gitlab.denx.de/u-boot/custodians/u-boot-stm.git
 S:	Maintained
 F:	arch/arm/mach-stm32mp/
+F:	drivers/adc/stm32-adc*
 F:	drivers/clk/clk_stm32mp1.c
+F:	drivers/gpio/stm32_gpio.c
+F:	drivers/hwspinlock/stm32_hwspinlock.c
 F:	drivers/i2c/stm32f7_i2c.c
 F:	drivers/mailbox/stm32-ipcc.c
 F:	drivers/misc/stm32mp_fuse.c
+F:	drivers/misc/stm32_rcc.c
 F:	drivers/mmc/stm32_sdmmc2.c
+F:	drivers/mtd/nand/raw/stm32_fmc2_nand.c
 F:	drivers/phy/phy-stm32-usbphyc.c
 F:	drivers/pinctrl/pinctrl_stm32.c
 F:	drivers/power/pmic/stpmic1.c
@@ -313,11 +318,21 @@ F:	drivers/power/regulator/stm32-vrefbuf.c
 F:	drivers/power/regulator/stpmic1.c
 F:	drivers/ram/stm32mp1/
 F:	drivers/remoteproc/stm32_copro.c
-F:	drivers/misc/stm32_rcc.c
 F:	drivers/reset/stm32-reset.c
+F:	drivers/rtc/stm32_rtc.c
+F:	drivers/serial/serial_stm32.*
 F:	drivers/spi/stm32_qspi.c
 F:	drivers/spi/stm32_spi.c
+F:	drivers/video/stm32/stm32_ltdc.c
 F:	drivers/watchdog/stm32mp_wdt.c
+F:	include/dt-bindings/clock/stm32fx-clock.h
+F:	include/dt-bindings/clock/stm32mp1-clks.h
+F:	include/dt-bindings/clock/stm32mp1-clksrc.h
+F:	include/dt-bindings/pinctrl/stm32-pinfunc.h
+F:	include/dt-bindings/reset/stm32mp1-resets.h
+F:	include/stm32_rcc.h
+F:	tools/stm32image.c
+
 
 ARM STM STV0991
 M:	Vikas Manocha <[email protected]>
board/st/stm32mp1/MAINTAINERS +3 -2
index 3bf4c21..2930947 100644
@@ -1,9 +1,10 @@
 STM32MP1 BOARD
 M:	Patrick Delaunay <[email protected]>
 L:	uboot-stm32 at st-md-mailman.stormreply.com (moderated for non-subscribers)
+T:	git https://gitlab.denx.de/u-boot/custodians/u-boot-stm.git
 S:	Maintained
-F:	arch/arm/dts/stm32mp157*
-F:	board/st/stm32mp1
+F:	arch/arm/dts/stm32mp15*
+F:	board/st/stm32mp1/
 F:	configs/stm32mp15_basic_defconfig
 F:	configs/stm32mp15_optee_defconfig
 F:	configs/stm32mp15_trusted_defconfig
Signature · 1 line
2.7.4