Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3733270pxa; Sun, 9 Aug 2020 09:48:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNwis1+tFjaBAwBMb2deqOaDAS/T0k/P3mFHEgRKHjD2Ev5+2U3M8c1J994n8IYX2MShk0 X-Received: by 2002:a17:907:372:: with SMTP id rs18mr17664899ejb.146.1596991739751; Sun, 09 Aug 2020 09:48:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596991739; cv=none; d=google.com; s=arc-20160816; b=XpZE9jLNymaTNyKBoKc6/xZqoU7URZRy9EvRTxFWIuUp2k9gIVkNJxXYaZhLqR1uhG qQlSBQ5YiD0EdHE/n4VApeHVzpehyhwiQv+IzywNHcpgfez3y742P7gS3wAiTk3xjLvl 19hogiwsPpNja030F9tyggYUUe5ilmNLh48r3bAjYMnc4Bs2x1v+xWo5KN8NzrctRIIj 4useaDTPQSjlJvz8GKXCH0jsdR3fX4tY4E1LOOXjNSgzRo6CpibtAcK36kHehIKqcFwY +n4SA3DHXwyylIvYdujxkPaUSz11xtVIP7VK2s2DK7+XSam41gR0vFnzc15f5VY2IKU5 MTdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=f6GceXpV/IHfaJaRQd7xDBG5y4ojnE6AoHD31OqAqtA=; b=V/Q+2wZavCabCNFI0qRfahKNkR78I2ZeIxB1zOFX9lf/wrNJmRXSFHdbqJUV+cHVFE c1zyVnuBBRVCVJmJxaqHL8hTzVljg+/e42JUDiI1bvkwA/qlO265Gs4nK/z5RS/Wk1pW UUGvCh3Zli20zECiPFxIQWIhvYGKZZFZ3vWbjbAV+bJyV+/8g6ouMDIVHU0Kg8o4rU8E SPz9ERcZUBQp/ArVoTdLb1zXW4LZevYpuehkwz7SVQNg3aW4cttXgzn7jwfToFu+B6aG +nYZpcHipFNpJ2IOP8qwVFy3e9eV0LzODZ4oyNgbkWio0bGJ3mSQPT31nZ1iGlGxlM+T Qd2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OTGomXpC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x22si9664445ejc.278.2020.08.09.09.48.36; Sun, 09 Aug 2020 09:48:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OTGomXpC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726469AbgHIQpZ (ORCPT + 99 others); Sun, 9 Aug 2020 12:45:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726406AbgHIQpJ (ORCPT ); Sun, 9 Aug 2020 12:45:09 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95F8FC061786; Sun, 9 Aug 2020 09:45:08 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id qc22so7065666ejb.4; Sun, 09 Aug 2020 09:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=f6GceXpV/IHfaJaRQd7xDBG5y4ojnE6AoHD31OqAqtA=; b=OTGomXpCHuuP4cJikykUt9HwkJ1qH/DYmiroDHoq79GuH2nYaC6VWSwlmPs6A7IcqQ NkAijzPA8TWdAjiW1nxx+XfNrq/ne/NmRj4RMxUeU4nGL+Lz+qHd1/Ylcw976OYJW9Ki HxVUA0/4lOm6zpMdf7p8G3xSex3M+XEO66SInaspMKIA4kbkk/Otm3DJsO0MqXE7C7R9 nay6ZFl1tYQy77y1VMbT/kTDXQyaktoz12wPv0wodzcL1mxIz1YO50hI5teX2lzNM+RX M910zlR0wWkg2flqFyYtMQPvpv6n1Gzm2EoWUBFEab08SiFo0K+vBNjLpNdPsCtvqgsS Vypw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f6GceXpV/IHfaJaRQd7xDBG5y4ojnE6AoHD31OqAqtA=; b=ZbCyBo1hMNV830ZVWop7WbKxrEP0N6V6DFmY7lcgKC4QqC3bfiIcbgMQpvvEUzNBVb yEzScQsLYiv17UcgkbxbKxd3HgcgbMUU60adadt2ehjQIDqNW2qtzlHV4SlP9eDZAx2N L/FQKh7wtAJ453GeqHVJYT5UUeF+vjFtZr792hrXkZn+GfpfgMIVbNC3HuzoZZGAgbr/ SqZ9bjZGTxGZLSsCaFkvY3kn/SaPUVy+ZFIXn5YQOuYUpo/DtmcyzyKfUh+7w9meEzym 34O1O+fI562wC7K7OjKrR6KX6kIbOvyogX0Rrp4mKI94b2nJms0Xk5mqLZM41aZnFkr1 JUcA== X-Gm-Message-State: AOAM533nQGju150zcl3eOUycn8XtLVzGSHSlwuW5aBVdx7xi5zhF0Mex w0TH7168/34Ah/zFBtvSkPU= X-Received: by 2002:a17:906:a84f:: with SMTP id dx15mr17924296ejb.377.1596991506778; Sun, 09 Aug 2020 09:45:06 -0700 (PDT) Received: from blackhead.home ([2a01:112f:a1c:7900:7316:ce1e:7b0b:6bd7]) by smtp.gmail.com with ESMTPSA id b24sm10423215edn.33.2020.08.09.09.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Aug 2020 09:45:06 -0700 (PDT) From: Marcin Sloniewski To: linux-arm-kernel@lists.infradead.org Cc: robh+dt@kernel.org, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, mani@kernel.org, marcin.sloniewski@gmail.com, a.fatoum@pengutronix.de, sam@ravnborg.org, linus.walleij@linaro.org, arnd@arndb.de, broonie@kernel.org, lkundrak@v3.sk, daniel@0x0f.com, kuninori.morimoto.gx@renesas.com, allen.chen@ite.com.tw, robh@kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-kernel@vger.kernel.org Subject: [PATCH v7 3/3] ARM: dts: stm32: add initial support for stm32mp157-odyssey board Date: Sun, 9 Aug 2020 18:44:50 +0200 Message-Id: <20200809164450.289731-3-marcin.sloniewski@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200809164450.289731-1-marcin.sloniewski@gmail.com> References: <20200809164450.289731-1-marcin.sloniewski@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for Seeed Studio's stm32mp157c odyssey board. Board consists of SoM with stm32mp157c with 4GB eMMC and 512 MB DDR3 RAM and carrier board with USB and ETH interfaces, SD card connector, wifi and BT chip AP6236. In this patch only basic kernel boot is supported and interfacing SD card and on-board eMMC. Signed-off-by: Marcin Sloniewski --- Changes in v7: - fix eth: added clock assignement for phy. It gets clock from PLL4_P which must be configured in u-boot/ATF as stmicroelectronics suggests. Changes in v6: - add reset pin for eth phy - move pinctrl for sdmmc2 to stm32mp15-pinctrl.dtsi Changes in v5: - fix schema for board's dts Changes in v4: - add seeed,stm32mp157c-odyssey-som in compatible for carrier board - fix sdmmc2 interface by changing one of the pins to use - change eth phy address to 7 Changes in v3: - fix compilation on tip of stm32-next due to change in names for pinctrl - fix deprecated binding for led node - fix redundant "okay" statuses - add phy part number for eth in comment Changes in v2: - add new odyssey dts to Makefile arch/arm/boot/dts/Makefile | 3 +- arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 18 ++ .../arm/boot/dts/stm32mp157c-odyssey-som.dtsi | 276 ++++++++++++++++++ arch/arm/boot/dts/stm32mp157c-odyssey.dts | 80 +++++ 4 files changed, 376 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/stm32mp157c-odyssey-som.dtsi create mode 100644 arch/arm/boot/dts/stm32mp157c-odyssey.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 4572db3fa5ae..f4a43a9420f1 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -1056,7 +1056,8 @@ dtb-$(CONFIG_ARCH_STM32) += \ stm32mp157c-dk2.dtb \ stm32mp157c-ed1.dtb \ stm32mp157c-ev1.dtb \ - stm32mp157c-lxa-mc1.dtb + stm32mp157c-lxa-mc1.dtb \ + stm32mp157c-odyssey.dtb dtb-$(CONFIG_MACH_SUN4I) += \ sun4i-a10-a1000.dtb \ sun4i-a10-ba10-tvbox.dtb \ diff --git a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi index b5a66429670c..a47eaecbde42 100644 --- a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi +++ b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi @@ -1437,6 +1437,24 @@ pins { }; }; + sdmmc2_d47_pins_d: sdmmc2-d47-3 { + pins { + pinmux = , /* SDMMC2_D4 */ + , /* SDMMC2_D5 */ + , /* SDMMC2_D6 */ + ; /* SDMMC2_D7 */ + }; + }; + + sdmmc2_d47_sleep_pins_d: sdmmc2-d47-sleep-3 { + pins { + pinmux = , /* SDMMC2_D4 */ + , /* SDMMC2_D5 */ + , /* SDMMC2_D6 */ + ; /* SDMMC2_D7 */ + }; + }; + sdmmc3_b4_pins_a: sdmmc3-b4-0 { pins1 { pinmux = , /* SDMMC3_D0 */ diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey-som.dtsi b/arch/arm/boot/dts/stm32mp157c-odyssey-som.dtsi new file mode 100644 index 000000000000..6cf49a0a9e69 --- /dev/null +++ b/arch/arm/boot/dts/stm32mp157c-odyssey-som.dtsi @@ -0,0 +1,276 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright (C) 2020 Marcin Sloniewski . + */ + +/dts-v1/; + +#include "stm32mp157.dtsi" +#include "stm32mp15xc.dtsi" +#include "stm32mp15-pinctrl.dtsi" +#include "stm32mp15xxac-pinctrl.dtsi" +#include +#include +#include + +/ { + model = "Seeed Studio Odyssey-STM32MP157C SOM"; + compatible = "seeed,stm32mp157c-odyssey-som", "st,stm32mp157"; + + memory@c0000000 { + device_type = "memory"; + reg = <0xc0000000 0x20000000>; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + mcuram2: mcuram2@10000000 { + compatible = "shared-dma-pool"; + reg = <0x10000000 0x40000>; + no-map; + }; + + vdev0vring0: vdev0vring0@10040000 { + compatible = "shared-dma-pool"; + reg = <0x10040000 0x1000>; + no-map; + }; + + vdev0vring1: vdev0vring1@10041000 { + compatible = "shared-dma-pool"; + reg = <0x10041000 0x1000>; + no-map; + }; + + vdev0buffer: vdev0buffer@10042000 { + compatible = "shared-dma-pool"; + reg = <0x10042000 0x4000>; + no-map; + }; + + mcuram: mcuram@30000000 { + compatible = "shared-dma-pool"; + reg = <0x30000000 0x40000>; + no-map; + }; + + retram: retram@38000000 { + compatible = "shared-dma-pool"; + reg = <0x38000000 0x10000>; + no-map; + }; + + gpu_reserved: gpu@d4000000 { + reg = <0xd4000000 0x4000000>; + no-map; + }; + }; + + led { + compatible = "gpio-leds"; + led-blue { + color = ; + function = LED_FUNCTION_HEARTBEAT; + gpios = <&gpiog 3 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + }; + }; +}; + +&gpu { + contiguous-area = <&gpu_reserved>; + status = "okay"; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_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 = <800000>; + 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; + interrupts = ; + }; + + v3v3_hdmi: ldo2 { + regulator-name = "v3v3_hdmi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + interrupts = ; + }; + + 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>; + interrupts = ; + }; + + vdda: ldo5 { + regulator-name = "vdda"; + regulator-min-microvolt = <2900000>; + regulator-max-microvolt = <2900000>; + interrupts = ; + regulator-boot-on; + }; + + v1v2_hdmi: ldo6 { + regulator-name = "v1v2_hdmi"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-always-on; + interrupts = ; + }; + + vref_ddr: vref_ddr { + regulator-name = "vref_ddr"; + regulator-always-on; + regulator-over-current-protection; + }; + + bst_out: boost { + regulator-name = "bst_out"; + interrupts = ; + }; + + vbus_otg: pwr_sw1 { + regulator-name = "vbus_otg"; + interrupts = ; + }; + + vbus_sw: pwr_sw2 { + regulator-name = "vbus_sw"; + interrupts = ; + regulator-active-discharge; + }; + }; + + onkey { + compatible = "st,stpmic1-onkey"; + interrupts = , ; + interrupt-names = "onkey-falling", "onkey-rising"; + power-off-time-sec = <10>; + }; + + watchdog { + compatible = "st,stpmic1-wdt"; + status = "disabled"; + }; + }; +}; + +&ipcc { + status = "okay"; +}; + +&iwdg2 { + timeout-sec = <32>; + status = "okay"; +}; + +&m4_rproc { + memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>, + <&vdev0vring1>, <&vdev0buffer>; + mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>; + mbox-names = "vq0", "vq1", "shutdown"; + interrupt-parent = <&exti>; + interrupts = <68 1>; + status = "okay"; +}; + +&rng1 { + status = "okay"; +}; + +&rtc { + status = "okay"; +}; + +&sdmmc2 { + pinctrl-names = "default", "opendrain", "sleep"; + pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_d>; + pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_d>; + pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_d>; + non-removable; + no-sd; + no-sdio; + st,neg-edge; + bus-width = <8>; + vmmc-supply = <&v3v3>; + vqmmc-supply = <&v3v3>; + mmc-ddr-3_3v; + status = "okay"; +}; + diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts new file mode 100644 index 000000000000..a7ffec8f1516 --- /dev/null +++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright (C) 2020 Marcin Sloniewski . + */ + +/dts-v1/; + +#include "stm32mp157c-odyssey-som.dtsi" + +/ { + model = "Seeed Studio Odyssey-STM32MP157C Board"; + compatible = "seeed,stm32mp157c-odyssey", + "seeed,stm32mp157c-odyssey-som", "st,stm32mp157"; + + aliases { + ethernet0 = ðernet0; + serial0 = &uart4; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +ðernet0 { + status = "okay"; + pinctrl-0 = <ðernet0_rgmii_pins_a>; + pinctrl-1 = <ðernet0_rgmii_sleep_pins_a>; + pinctrl-names = "default", "sleep"; + phy-mode = "rgmii-id"; + max-speed = <1000>; + phy-handle = <&phy0>; + assigned-clocks = <&rcc ETHCK_K>, <&rcc PLL4_P>; + assigned-clock-parents = <&rcc PLL4_P>; + assigned-clock-rates = <125000000>; /* Clock PLL4 to 750Mhz in ATF/U-Boot */ + st,eth-clk-sel; + + mdio0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + phy0: ethernet-phy@7 { /* KSZ9031RN */ + reg = <7>; + reset-gpios = <&gpiog 0 GPIO_ACTIVE_LOW>; /* ETH_RST# */ + reset-assert-us = <10000>; + reset-deassert-us = <300>; + }; + }; +}; + +&i2c1 { + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&i2c1_pins_a>; + pinctrl-1 = <&i2c1_sleep_pins_a>; + i2c-scl-rising-time-ns = <100>; + i2c-scl-falling-time-ns = <7>; + status = "okay"; + /delete-property/dmas; + /delete-property/dma-names; +}; + +&sdmmc1 { + pinctrl-names = "default", "opendrain", "sleep"; + pinctrl-0 = <&sdmmc1_b4_pins_a>; + pinctrl-1 = <&sdmmc1_b4_od_pins_a>; + pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>; + cd-gpios = <&gpiob 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + disable-wp; + st,neg-edge; + bus-width = <4>; + vmmc-supply = <&v3v3>; + status = "okay"; +}; + +&uart4 { + pinctrl-names = "default"; + pinctrl-0 = <&uart4_pins_a>; + status = "okay"; +}; + -- 2.27.0