Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 60941C32796 for ; Wed, 24 Aug 2022 15:22:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7682381F69; Wed, 24 Aug 2022 17:22:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.b="gRoG6DdG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D5EF581727; Wed, 24 Aug 2022 17:21:59 +0200 (CEST) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4B37F84236 for ; Wed, 24 Aug 2022 17:21:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=4235f02c3f=patrice.chotard@foss.st.com Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27OFILg5031074; Wed, 24 Aug 2022 17:21:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=lKROC2+NvkNDK1O1KcvNLWSy2C6z4eFs4NdAtXiN2/Q=; b=gRoG6DdGtcBT5fxB6WdGm4mbrzORduv4VfuEezTNTyag7qCMj9sKtjIkxXtlpAKaFM+x 9BZlLTWtGC189kTwlthvmJidJc4JRTT4IowssbVNg6mRu72siVACjV4xUzn/dmXDmqzL bfiSUfMUCeIQ8C34h789C3MClHUSDfA4CHXp3WjYfUrtCLhOJqVeZv/eWsDhdDzliSxr eWTNCtnErfr2iNor6bpgCwC3Sk7uK0J7h+2M0rCg3Y1YEgmWW0PoNq+l9OHQ8ilZQlWP bzj4ugI2hy8FyXuBxMkJ6n34lfm78P9fkFBpG85EqHo5+ur1eRhJuh8tYWprVHWtMIRn Rg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3j4w3d8f4w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Aug 2022 17:21:56 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4BE1610002A; Wed, 24 Aug 2022 17:21:55 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 3E70E236959; Wed, 24 Aug 2022 17:21:55 +0200 (CEST) Received: from [10.201.21.72] (10.75.127.47) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.20; Wed, 24 Aug 2022 17:21:54 +0200 Message-ID: Date: Wed, 24 Aug 2022 17:21:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] ARM: stm32: Switch DHSOM to FMC2 EBI driver Content-Language: en-US To: Marek Vasut , CC: Patrick Delaunay References: <20220823172708.338146-1-marex@denx.de> From: Patrice CHOTARD In-Reply-To: <20220823172708.338146-1-marex@denx.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-24_08,2022-08-22_02,2022-06-22_01 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Hi Marek On 8/23/22 19:27, Marek Vasut wrote: > Perform long overdue conversion of ad-hoc FMC2 EBI bus initialization > to upstream FMC2 EBI driver. No functional change. > > Signed-off-by: Marek Vasut > Cc: Patrice Chotard > Cc: Patrick Delaunay > --- > .../dts/stm32mp15xx-dhcom-picoitx-u-boot.dtsi | 8 --- > arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi | 14 ----- > .../stm32mp15xx-dhcor-drc-compact-u-boot.dtsi | 16 ------ > board/dhelectronics/dh_stm32mp1/board.c | 52 ------------------- > configs/stm32mp15_dhcom_basic_defconfig | 1 + > configs/stm32mp15_dhcor_basic_defconfig | 1 + > 6 files changed, 2 insertions(+), 90 deletions(-) > > diff --git a/arch/arm/dts/stm32mp15xx-dhcom-picoitx-u-boot.dtsi b/arch/arm/dts/stm32mp15xx-dhcom-picoitx-u-boot.dtsi > index 5bc6698f87f..0bcaec50198 100644 > --- a/arch/arm/dts/stm32mp15xx-dhcom-picoitx-u-boot.dtsi > +++ b/arch/arm/dts/stm32mp15xx-dhcom-picoitx-u-boot.dtsi > @@ -5,14 +5,6 @@ > > #include "stm32mp15xx-dhcom-u-boot.dtsi" > > -/ { > - aliases { > - /delete-property/ ethernet1; > - }; > -}; > - > -/delete-node/ &ks8851; > - > &usbotg_hs { > dr_mode = "peripheral"; > }; > diff --git a/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi b/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi > index ee747a52bb7..8a7156c93bf 100644 > --- a/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi > +++ b/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi > @@ -9,8 +9,6 @@ > #include "stm32mp15-ddr3-dhsom-2x2Gb-1066-binG.dtsi" > #include "stm32mp15-ddr3-dhsom-2x4Gb-1066-binG.dtsi" > > -/delete-node/ &ksz8851; > - > / { > aliases { > i2c1 = &i2c2; > @@ -21,7 +19,6 @@ > spi0 = &qspi; > usb0 = &usbotg_hs; > eeprom0 = &eeprom0; > - ethernet1 = &ks8851; > }; > > config { > @@ -30,12 +27,6 @@ > dh,som-coding-gpios = <&gpiof 12 0>, <&gpiof 13 0>, <&gpiof 15 0>; > dh,ddr3-coding-gpios = <&gpioz 6 0>, <&gpioz 7 0>; > }; > - > - /* This is actually on FMC2, but we do not have bus driver for that */ > - ks8851: ks8851mll@64000000 { > - compatible = "micrel,ks8851-mll"; > - reg = <0x64000000 0x20000>; > - }; > }; > > ðernet0 { > @@ -74,11 +65,6 @@ > }; > > &pinctrl { > - /* These should bound to FMC2 bus driver, but we do not have one */ > - pinctrl-0 = <&fmc_pins_b &mco2_pins_a>; > - pinctrl-1 = <&fmc_sleep_pins_b &mco2_sleep_pins_a>; > - pinctrl-names = "default", "sleep"; > - > mco2_pins_a: mco2-0 { > pins { > pinmux = ; /* MCO2 */ > diff --git a/arch/arm/dts/stm32mp15xx-dhcor-drc-compact-u-boot.dtsi b/arch/arm/dts/stm32mp15xx-dhcor-drc-compact-u-boot.dtsi > index 407fed56167..b6a6a78647a 100644 > --- a/arch/arm/dts/stm32mp15xx-dhcor-drc-compact-u-boot.dtsi > +++ b/arch/arm/dts/stm32mp15xx-dhcor-drc-compact-u-boot.dtsi > @@ -5,25 +5,16 @@ > > #include "stm32mp15xx-dhcor-u-boot.dtsi" > > -/delete-node/ &ksz8851; > - > / { > aliases { > mmc0 = &sdmmc1; > mmc1 = &sdmmc2; > usb0 = &usbotg_hs; > - ethernet1 = &ks8851; > }; > > config { > dh,board-coding-gpios = <&gpioh 9 0>, <&gpioh 8 0>, <&gpioh 3 0>; > }; > - > - /* This is actually on FMC2, but we do not have bus driver for that */ > - ks8851: ks8851mll@64000000 { > - compatible = "micrel,ks8851-mll"; > - reg = <0x64000000 0x20000>; > - }; > }; > > ðernet0 { > @@ -38,13 +29,6 @@ > }; > }; > > -&pinctrl { > - /* These should bound to FMC2 bus driver, but we do not have one */ > - pinctrl-0 = <&fmc_pins_b>; > - pinctrl-1 = <&fmc_sleep_pins_b>; > - pinctrl-names = "default", "sleep"; > -}; > - > &sdmmc1 { > u-boot,dm-spl; > st,use-ckin; > diff --git a/board/dhelectronics/dh_stm32mp1/board.c b/board/dhelectronics/dh_stm32mp1/board.c > index e3c7ed10492..9188f5381eb 100644 > --- a/board/dhelectronics/dh_stm32mp1/board.c > +++ b/board/dhelectronics/dh_stm32mp1/board.c > @@ -527,56 +527,6 @@ static void sysconf_init(void) > #endif > } > > -static void board_init_fmc2(void) > -{ > -#define STM32_FMC2_BCR1 0x0 > -#define STM32_FMC2_BTR1 0x4 > -#define STM32_FMC2_BWTR1 0x104 > -#define STM32_FMC2_BCR(x) ((x) * 0x8 + STM32_FMC2_BCR1) > -#define STM32_FMC2_BCRx_FMCEN BIT(31) > -#define STM32_FMC2_BCRx_WREN BIT(12) > -#define STM32_FMC2_BCRx_RSVD BIT(7) > -#define STM32_FMC2_BCRx_FACCEN BIT(6) > -#define STM32_FMC2_BCRx_MWID(n) ((n) << 4) > -#define STReviewed-by: Patrice Chotard M32_FMC2_BCRx_MTYP(n) ((n) << 2) > -#define STM32_FMC2_BCRx_MUXEN BIT(1) > -#define STM32_FMC2_BCRx_MBKEN BIT(0) > -#define STM32_FMC2_BTR(x) ((x) * 0x8 + STM32_FMC2_BTR1) > -#define STM32_FMC2_BTRx_DATAHLD(n) ((n) << 30) > -#define STM32_FMC2_BTRx_BUSTURN(n) ((n) << 16) > -#define STM32_FMC2_BTRx_DATAST(n) ((n) << 8) > -#define STM32_FMC2_BTRx_ADDHLD(n) ((n) << 4) > -#define STM32_FMC2_BTRx_ADDSET(n) ((n) << 0) > - > -#define RCC_MP_AHB6RSTCLRR 0x218 > -#define RCC_MP_AHB6RSTCLRR_FMCRST BIT(12) > -#define RCC_MP_AHB6ENSETR 0x19c > -#define RCC_MP_AHB6ENSETR_FMCEN BIT(12) > - > - const u32 bcr = STM32_FMC2_BCRx_WREN |STM32_FMC2_BCRx_RSVD | > - STM32_FMC2_BCRx_FACCEN | STM32_FMC2_BCRx_MWID(1) | > - STM32_FMC2_BCRx_MTYP(2) | STM32_FMC2_BCRx_MUXEN | > - STM32_FMC2_BCRx_MBKEN; > - const u32 btr = STM32_FMC2_BTRx_DATAHLD(3) | > - STM32_FMC2_BTRx_BUSTURN(2) | > - STM32_FMC2_BTRx_DATAST(0x22) | > - STM32_FMC2_BTRx_ADDHLD(2) | > - STM32_FMC2_BTRx_ADDSET(2); > - > - /* Set up FMC2 bus for KS8851-16MLL and X11 SRAM */ > - writel(RCC_MP_AHB6RSTCLRR_FMCRST, STM32_RCC_BASE + RCC_MP_AHB6RSTCLRR); > - writel(RCC_MP_AHB6ENSETR_FMCEN, STM32_RCC_BASE + RCC_MP_AHB6ENSETR); > - > - /* KS8851-16MLL -- Muxed mode */ > - writel(bcr, STM32_FMC2_BASE + STM32_FMC2_BCR(1)); > - writel(btr, STM32_FMC2_BASE + STM32_FMC2_BTR(1)); > - /* AS7C34098 SRAM on X11 -- Muxed mode */ > - writel(bcr, STM32_FMC2_BASE + STM32_FMC2_BCR(3)); > - writel(btr, STM32_FMC2_BASE + STM32_FMC2_BTR(3)); > - > - setbits_le32(STM32_FMC2_BASE + STM32_FMC2_BCR1, STM32_FMC2_BCRx_FMCEN); > -} > - > #ifdef CONFIG_DM_REGULATOR > #define STPMIC_NVM_BUCKS_VOUT_SHR 0xfc > #define STPMIC_NVM_BUCKS_VOUT_SHR_BUCK_1V2 0 > @@ -671,8 +621,6 @@ int board_init(void) > > sysconf_init(); > > - board_init_fmc2(); > - > return 0; > } > > diff --git a/configs/stm32mp15_dhcom_basic_defconfig b/configs/stm32mp15_dhcom_basic_defconfig > index 4f478c13120..eba83694912 100644 > --- a/configs/stm32mp15_dhcom_basic_defconfig > +++ b/configs/stm32mp15_dhcom_basic_defconfig > @@ -108,6 +108,7 @@ CONFIG_DM_I2C=y > CONFIG_SYS_I2C_STM32F7=y > CONFIG_LED=y > CONFIG_LED_GPIO=y > +CONFIG_STM32_FMC2_EBI=y > CONFIG_I2C_EEPROM=y > CONFIG_SYS_I2C_EEPROM_ADDR=0x50 > CONFIG_SUPPORT_EMMC_BOOT=y > diff --git a/configs/stm32mp15_dhcor_basic_defconfig b/configs/stm32mp15_dhcor_basic_defconfig > index 01fbb05123a..1200a213e84 100644 > --- a/configs/stm32mp15_dhcor_basic_defconfig > +++ b/configs/stm32mp15_dhcor_basic_defconfig > @@ -105,6 +105,7 @@ CONFIG_DM_I2C=y > CONFIG_SYS_I2C_STM32F7=y > CONFIG_LED=y > CONFIG_LED_GPIO=y > +CONFIG_STM32_FMC2_EBI=y > CONFIG_I2C_EEPROM=y > CONFIG_SYS_I2C_EEPROM_ADDR=0x53 > CONFIG_SUPPORT_EMMC_BOOT=y Reviewed-by: Patrice Chotard Thanks