From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Ahmad Fatoum Date: Fri, 24 Apr 2020 19:17:22 +0200 Message-Id: <20200424171726.8330-3-a.fatoum@pengutronix.de> In-Reply-To: <20200424171726.8330-1-a.fatoum@pengutronix.de> References: <20200424171726.8330-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 Subject: [DistroKit] [PATCH 3/7] v7a: tf-a: add support for Linux Automation MC-1 List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: distrokit-bounces@pengutronix.de Sender: "DistroKit" To: distrokit@pengutronix.de Cc: Ahmad Fatoum The MC-1 can boot from SD-Card with the DK2 TF-A, but for use in production, it's meant to boot from eMMC. Patch in the MC-1 device tree, which enables the appropriate SDMMC controller. RAM timings are those of the DK-2, which have worked so far, but should be reconsidered prior to upstreaming. [Note: eMMC boot doesn't yet work, presumably due to hardware issues.] Signed-off-by: Ahmad Fatoum --- ...d-support-for-Linux-Automation-MC-1-.patch | 414 ++++++++++++++++++ configs/platform-v7a/patches/tf-a-v2.3/series | 1 + configs/platform-v7a/platformconfig | 2 +- 3 files changed, 416 insertions(+), 1 deletion(-) create mode 100644 configs/platform-v7a/patches/tf-a-v2.3/0001-fdts-stm32mp1-add-support-for-Linux-Automation-MC-1-.patch create mode 100644 configs/platform-v7a/patches/tf-a-v2.3/series diff --git a/configs/platform-v7a/patches/tf-a-v2.3/0001-fdts-stm32mp1-add-support-for-Linux-Automation-MC-1-.patch b/configs/platform-v7a/patches/tf-a-v2.3/0001-fdts-stm32mp1-add-support-for-Linux-Automation-MC-1-.patch new file mode 100644 index 000000000000..abfbd7efa8bf --- /dev/null +++ b/configs/platform-v7a/patches/tf-a-v2.3/0001-fdts-stm32mp1-add-support-for-Linux-Automation-MC-1-.patch @@ -0,0 +1,414 @@ +From 8713c33c448dddcaee33d71fe3d5d2ed40c49283 Mon Sep 17 00:00:00 2001 +From: Ahmad Fatoum +Date: Wed, 29 Jan 2020 16:04:18 +0100 +Subject: [PATCH] fdts: stm32mp1: add support for Linux Automation MC-1 + board + +The Linux Automation MC-1 is a SBC built around the Octavo Systems +OSD32MP15x SiP. The SiP features up to 1 GB DDR3 RAM, EEPROM and +PMIC. The board has eMMC and a SD slot for storage. + +Signed-off-by: Ahmad Fatoum +--- + fdts/stm32mp157c-lxa-mc1.dts | 110 ++++++++++++++ + fdts/stm32mp15xx-osd32.dtsi | 271 +++++++++++++++++++++++++++++++++++ + 2 files changed, 381 insertions(+) + create mode 100644 fdts/stm32mp157c-lxa-mc1.dts + create mode 100644 fdts/stm32mp15xx-osd32.dtsi + +diff --git a/fdts/stm32mp157c-lxa-mc1.dts b/fdts/stm32mp157c-lxa-mc1.dts +new file mode 100644 +index 000000000000..e75e7b5ba28b +--- /dev/null ++++ b/fdts/stm32mp157c-lxa-mc1.dts +@@ -0,0 +1,110 @@ ++/* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) */ ++/* ++ * Copyright (C) 2020 STMicroelectronics - All Rights Reserved ++ * Copyright (C) 2020 Ahmad Fatoum, Pengutronix ++ */ ++ ++/dts-v1/; ++ ++#include "stm32mp157c.dtsi" ++#include "stm32mp15-ddr3-1x4Gb-1066-binG.dtsi" ++#include "stm32mp157c-security.dtsi" ++#include "stm32mp15xx-osd32.dtsi" ++ ++/ { ++ model = "Linux Automation MC-1 board"; ++ compatible = "lxa,stm32mp157c-mc1", "oct,stm32mp157c-osd32", "st,stm32mp157"; ++ ++ aliases { ++ mmc0 = &sdmmc1; ++ mmc1 = &sdmmc2; ++ serial0 = &uart4; ++ }; ++ ++ chosen { ++ stdout-path = &uart4; ++ }; ++ ++ led-act { ++ compatible = "gpio-leds"; ++ ++ green { ++ label = "mc1:green:act"; ++ gpios = <&gpioa 13 1>; ++ linux,default-trigger = "heartbeat"; ++ default-state = "off"; ++ }; ++ }; ++ ++ reg_3v3: regulator_3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "3V3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&v3v3>; ++ }; ++}; ++ ++&sdmmc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc1_b4_pu_pins_a>; ++ cd-gpios = <&gpioh 3 1>; ++ st,neg-edge; ++ bus-width = <4>; ++ vmmc-supply = <®_3v3>; ++ no-1-8-v; ++ status = "okay"; ++}; ++ ++&sdmmc2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_b>; ++ non-removable; ++ no-sd; ++ no-sdio; ++ st,neg-edge; ++ bus-width = <8>; ++ vmmc-supply = <®_3v3>; ++ no-1-8-v; ++ mmc-ddr-3_3v; ++ status = "okay"; ++}; ++ ++&uart4 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart4_pins_a>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ sdmmc1_b4_pu_pins_a: sdmmc1-pu-b4-0 { ++ pins1 { ++ pinmux = , /* SDMMC1_D0 */ ++ , /* SDMMC1_D1 */ ++ , /* SDMMC1_D2 */ ++ , /* SDMMC1_D3 */ ++ ; /* SDMMC1_CMD */ ++ slew-rate = <1>; ++ drive-push-pull; ++ bias-pull-up; ++ }; ++ pins2 { ++ pinmux = ; /* SDMMC1_CK */ ++ slew-rate = <2>; ++ drive-push-pull; ++ bias-pull-up; ++ }; ++ }; ++ ++ sdmmc2_d47_pins_b: sdmmc2-d47-1 { ++ pins { ++ pinmux = , /* eMMC_D4 */ ++ , /* eMMC_D5 */ ++ , /* eMMC_D6 */ ++ ; /* eMMC_D7 */ ++ slew-rate = <1>; ++ drive-push-pull; ++ bias-disable; ++ }; ++ }; ++}; +diff --git a/fdts/stm32mp15xx-osd32.dtsi b/fdts/stm32mp15xx-osd32.dtsi +new file mode 100644 +index 000000000000..453f18c30873 +--- /dev/null ++++ b/fdts/stm32mp15xx-osd32.dtsi +@@ -0,0 +1,271 @@ ++/* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) */ ++/* ++ * Copyright (C) 2020 STMicroelectronics - All Rights Reserved ++ * Copyright (C) 2020 Ahmad Fatoum, Pengutronix ++ */ ++ ++#include "stm32mp157cac-pinctrl.dtsi" ++ ++&i2c4 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c4_pins_a>; ++ i2c-scl-rising-time-ns = <185>; ++ i2c-scl-falling-time-ns = <20>; ++ status = "okay"; ++ ++ /* spare dmas for other usage */ ++ /delete-property/ dmas; ++ /delete-property/ dma-names; ++ ++ pmic: stpmic@33 { ++ compatible = "st,stpmic1"; ++ reg = <0x33>; ++ interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>; ++ interrupt-controller; ++ #interrupt-cells = <2>; ++ ++ regulators { ++ compatible = "st,stpmic1-regulators"; ++ ++ ldo1-supply = <&v3v3>; ++ ldo3-supply = <&vdd_ddr>; ++ ldo6-supply = <&v3v3>; ++ pwr_sw1-supply = <&bst_out>; ++ pwr_sw2-supply = <&bst_out>; ++ ++ vddcore: buck1 { ++ regulator-name = "vddcore"; ++ regulator-min-microvolt = <1200000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-always-on; ++ regulator-initial-mode = <0>; ++ regulator-over-current-protection; ++ }; ++ ++ vdd_ddr: buck2 { ++ regulator-name = "vdd_ddr"; ++ regulator-min-microvolt = <1350000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-always-on; ++ regulator-initial-mode = <0>; ++ regulator-over-current-protection; ++ }; ++ ++ vdd: buck3 { ++ regulator-name = "vdd"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ st,mask-reset; ++ regulator-initial-mode = <0>; ++ regulator-over-current-protection; ++ }; ++ ++ v3v3: buck4 { ++ regulator-name = "v3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ regulator-over-current-protection; ++ regulator-initial-mode = <0>; ++ }; ++ ++ v1v8_audio: ldo1 { ++ regulator-name = "v1v8_audio"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++ ++ }; ++ ++ v3v3_hdmi: ldo2 { ++ regulator-name = "v3v3_hdmi"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ ++ }; ++ ++ vtt_ddr: ldo3 { ++ regulator-name = "vtt_ddr"; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <750000>; ++ regulator-always-on; ++ regulator-over-current-protection; ++ }; ++ ++ vdd_usb: ldo4 { ++ regulator-name = "vdd_usb"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ ++ vdda: ldo5 { ++ regulator-name = "vdda"; ++ regulator-min-microvolt = <2900000>; ++ regulator-max-microvolt = <2900000>; ++ regulator-boot-on; ++ }; ++ ++ v1v2_hdmi: ldo6 { ++ regulator-name = "v1v2_hdmi"; ++ regulator-min-microvolt = <1200000>; ++ regulator-max-microvolt = <1200000>; ++ regulator-always-on; ++ ++ }; ++ ++ vref_ddr: vref_ddr { ++ regulator-name = "vref_ddr"; ++ regulator-always-on; ++ regulator-over-current-protection; ++ }; ++ ++ bst_out: boost { ++ regulator-name = "bst_out"; ++ }; ++ ++ vbus_otg: pwr_sw1 { ++ regulator-name = "vbus_otg"; ++ regulator-active-discharge; ++ }; ++ ++ vbus_sw: pwr_sw2 { ++ regulator-name = "vbus_sw"; ++ regulator-active-discharge; ++ }; ++ }; ++ ++ pmic_watchdog: watchdog { ++ compatible = "st,stpmic1-wdt"; ++ status = "disabled"; ++ }; ++ }; ++ ++ sip_eeprom: eeprom@50 { ++ compatible = "atmel,24c32"; ++ reg = <0x50>; ++ }; ++}; ++ ++&rng1 { ++ status = "okay"; ++}; ++ ++/* ATF Specific */ ++#include ++ ++/ { ++ aliases { ++ gpio0 = &gpioa; ++ gpio1 = &gpiob; ++ gpio2 = &gpioc; ++ gpio3 = &gpiod; ++ gpio4 = &gpioe; ++ gpio5 = &gpiof; ++ gpio6 = &gpiog; ++ gpio7 = &gpioh; ++ gpio8 = &gpioi; ++ gpio25 = &gpioz; ++ i2c3 = &i2c4; ++ }; ++}; ++ ++/* CLOCK init */ ++&rcc { ++ secure-status = "disabled"; ++ st,clksrc = < ++ CLK_MPU_PLL1P ++ CLK_AXI_PLL2P ++ CLK_MCU_PLL3P ++ CLK_PLL12_HSE ++ CLK_PLL3_HSE ++ CLK_PLL4_HSE ++ CLK_RTC_LSE ++ CLK_MCO1_DISABLED ++ CLK_MCO2_DISABLED ++ >; ++ ++ st,clkdiv = < ++ 1 /*MPU*/ ++ 0 /*AXI*/ ++ 0 /*MCU*/ ++ 1 /*APB1*/ ++ 1 /*APB2*/ ++ 1 /*APB3*/ ++ 1 /*APB4*/ ++ 2 /*APB5*/ ++ 23 /*RTC*/ ++ 0 /*MCO1*/ ++ 0 /*MCO2*/ ++ >; ++ ++ st,pkcs = < ++ CLK_CKPER_HSE ++ CLK_FMC_ACLK ++ CLK_QSPI_ACLK ++ CLK_ETH_DISABLED ++ CLK_SDMMC12_PLL4P ++ CLK_DSI_DSIPLL ++ CLK_STGEN_HSE ++ CLK_USBPHY_HSE ++ CLK_SPI2S1_PLL3Q ++ CLK_SPI2S23_PLL3Q ++ CLK_SPI45_HSI ++ CLK_SPI6_HSI ++ CLK_I2C46_HSI ++ CLK_SDMMC3_PLL4P ++ CLK_USBO_USBPHY ++ CLK_ADC_CKPER ++ CLK_CEC_LSE ++ CLK_I2C12_HSI ++ CLK_I2C35_HSI ++ CLK_UART1_HSI ++ CLK_UART24_HSI ++ CLK_UART35_HSI ++ CLK_UART6_HSI ++ CLK_UART78_HSI ++ CLK_SPDIF_PLL4P ++ CLK_FDCAN_PLL4R ++ CLK_SAI1_PLL3Q ++ CLK_SAI2_PLL3Q ++ CLK_SAI3_PLL3Q ++ CLK_SAI4_PLL3Q ++ CLK_RNG1_LSI ++ CLK_RNG2_LSI ++ CLK_LPTIM1_PCLK1 ++ CLK_LPTIM23_PCLK3 ++ CLK_LPTIM45_LSE ++ >; ++ ++ /* VCO = 1300.0 MHz => P = 650 (CPU) */ ++ pll1: st,pll@0 { ++ cfg = < 2 80 0 0 0 PQR(1,0,0) >; ++ frac = < 0x800 >; ++ }; ++ ++ /* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */ ++ pll2: st,pll@1 { ++ cfg = < 2 65 1 0 0 PQR(1,1,1) >; ++ frac = < 0x1400 >; ++ }; ++ ++ /* VCO = 417.8 MHz => P = 209, Q = 24, R = 11 */ ++ pll3: st,pll@2 { ++ cfg = < 1 33 1 16 36 PQR(1,1,1) >; ++ frac = < 0x1a04 >; ++ }; ++ ++ /* VCO = 594.0 MHz => P = 99, Q = 74, R = 74 */ ++ pll4: st,pll@3 { ++ cfg = < 3 98 5 7 7 PQR(1,1,1) >; ++ }; ++}; ++ ++&bsec { ++ board_id: board_id@ec { ++ reg = <0xec 0x4>; ++ status = "okay"; ++ secure-status = "okay"; ++ }; ++}; +-- +2.25.0 + diff --git a/configs/platform-v7a/patches/tf-a-v2.3/series b/configs/platform-v7a/patches/tf-a-v2.3/series new file mode 100644 index 000000000000..2f7ede32179f --- /dev/null +++ b/configs/platform-v7a/patches/tf-a-v2.3/series @@ -0,0 +1 @@ +0001-fdts-stm32mp1-add-support-for-Linux-Automation-MC-1-.patch diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig index 04b01f93f017..cdda0418da6f 100644 --- a/configs/platform-v7a/platformconfig +++ b/configs/platform-v7a/platformconfig @@ -190,7 +190,7 @@ PTXCONF_TF_A_ARM_ARCH_MAJOR_7=y # PTXCONF_TF_A_ARM_ARCH_MAJOR_8_32_BIT is not set PTXCONF_TF_A_ARM_ARCH_MAJOR=7 PTXCONF_TF_A_PLATFORM="stm32mp1" -PTXCONF_TF_A_EXTRA_ARGS="DTB_FILE_NAME=stm32mp157c-dk2.dtb STM32MP_EMMC=1 STM32MP_SDMMC=1 STM32MP_RAW_NAND=1 STM32MP_SPI_NAND=1 STM32MP_SPI_NOR=1" +PTXCONF_TF_A_EXTRA_ARGS="DTB_FILE_NAME='stm32mp157c-dk2.dtb stm32mp157c-lxa-mc1.dtb' STM32MP_EMMC=1 STM32MP_SDMMC=1 STM32MP_RAW_NAND=1 STM32MP_SPI_NAND=1 STM32MP_SPI_NOR=1" PTXCONF_TF_A_ARTIFACTS="tf-a-*.stm32" # -- 2.26.1 _______________________________________________ DistroKit mailing list DistroKit@pengutronix.de