From patchwork Tue Jun 18 22:01:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1118358 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45T2B7583Pz9s9y for ; Wed, 19 Jun 2019 08:02:21 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 552D0C2201D; Tue, 18 Jun 2019 22:02:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=KHOP_BIG_TO_CC autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0DB45C21F3C; Tue, 18 Jun 2019 22:02:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E49CAC21F3C; Tue, 18 Jun 2019 22:02:09 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by lists.denx.de (Postfix) with ESMTPS id 920F1C21F0F for ; Tue, 18 Jun 2019 22:02:09 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 45T29r5KgLz1rD8q; Wed, 19 Jun 2019 00:02:08 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 45T29r3Szyz1qqkD; Wed, 19 Jun 2019 00:02:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 2Dxh1nSweUhT; Wed, 19 Jun 2019 00:02:05 +0200 (CEST) X-Auth-Info: BF7qWO3kmMK8oarjU55Py922gg3bfRuBzzjdp31hbFQ= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 19 Jun 2019 00:02:05 +0200 (CEST) From: Lukasz Majewski To: Stefano Babic , Fabio Estevam , Simon Glass , Tom Rini , u-boot@lists.denx.de, Jagan Teki , Marcel Ziswiler , Adam Ford , Peng Fan , Marek Vasut , Shyam Saini , Michael Nazzareno Trimarchi , Angelo Compagnucci Date: Wed, 19 Jun 2019 00:01:47 +0200 Message-Id: <20190618220153.11245-1-lukma@denx.de> X-Mailer: git-send-email 2.11.0 Cc: "NXP i.MX U-Boot Team" , Joe Hershberger Subject: [U-Boot] [PATCH v4 0/6] DM: Convert i.MX28 gpio, pinmux, spi and eth drivers to DM/DTS X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch series converts some i.MX28 drivers to use DM/DTS. Converted drivers: - mxs_gpio.c - gpio driver - pinctrl-mxs.c - pinmux driver - Adjust fec_eth.c to support also i.MX28 SoC. - mxs_spi.c - SPI driver After applying this series it is possible to use ETH on i.MX28 board with following DTS description: &mac0 { phy-mode = "rmii"; pinctrl-names = "default"; pinctrl-0 = <&mac0_pins_a>; phy-supply = <®_fec_3v3>; phy-reset-gpios = <&gpio2 13 GPIO_ACTIVE_LOW>; phy-reset-duration = <1>; phy-reset-post-delay = <1>; status = "okay"; fixed-link { speed = <100>; full-duplex; }; }; And store the received binaries on SPI-NOR memory. Travis-CI: https://travis-ci.org/lmajewski/u-boot-dfu/builds/547299325 Applied on top of u-boot/master branch SHA1: c2ea87883ef309570c8903e6de4b8b78685d73d0 Changes in v4: - Add 12 digit SHA1 ID for tag v5.1.9 - Sort the entries for compatibles and Kconfig - New file - imx28-u-boot.dtsi - Use BIT() macro instead of 1 << offset - Use devfdt_get_addr to get gpio number - Use gpio-ranges property to setup gpios - Use Linux kernel code to setup pins instead of Barebox - Add soc specific data and compatible for i.MX23 and i.MX28 - Use devm_kfree() to release temporary memory - Adjust the driver to support i.MX23 (add compatible, adjust clk code) - Use BIT() macro where applicable Changes in v3: - Update tag to 5.1.9 - Set more apropriate tags - Set more apropriate tags - Set more apropriate tags - Set more apropriate tags - Set more appropriate tags Changes in v2: - Use #if !CONFIG_IS_ENABLED(DM_GPIO) instead of plain #ifdef CONFIG_DM_GPIO - New patch (conversion of mxs_spi.c to DM_SPI) Lukasz Majewski (6): ARM: dts: imx: Copy imx28 device tree related files from Linux kernel (v5.1.9) ARM: imx: net: Enable support for i.MX28 DM_ETH in the fec_mxc.c driver DTS: dm: mxs: gpio: Provide 'gpio-ranges' for mxs_gpio driver ARM: dm: mxs: gpio: Add support for DM/DTS in the mxs_gpio.c driver (DM_GPIO) ARM: imx: pinctrl: Add support for i.MX2[38] mxs pinctrl driver ARM: dm: spi: Add support DM/DTS for i.MX28 mxs SPI driver (DM_SPI conversion) arch/arm/dts/imx28-pinfunc.h | 506 ++++++++++++++ arch/arm/dts/imx28-u-boot.dtsi | 28 + arch/arm/dts/imx28.dtsi | 1330 +++++++++++++++++++++++++++++++++++++ arch/arm/dts/mxs-pinfunc.h | 31 + drivers/gpio/mxs_gpio.c | 148 +++++ drivers/net/Kconfig | 2 +- drivers/net/fec_mxc.c | 1 + drivers/pinctrl/nxp/Kconfig | 10 + drivers/pinctrl/nxp/Makefile | 1 + drivers/pinctrl/nxp/pinctrl-mxs.c | 200 ++++++ drivers/pinctrl/nxp/pinctrl-mxs.h | 55 ++ drivers/spi/mxs_spi.c | 400 ++++++++--- 12 files changed, 2628 insertions(+), 84 deletions(-) create mode 100644 arch/arm/dts/imx28-pinfunc.h create mode 100644 arch/arm/dts/imx28-u-boot.dtsi create mode 100644 arch/arm/dts/imx28.dtsi create mode 100644 arch/arm/dts/mxs-pinfunc.h create mode 100644 drivers/pinctrl/nxp/pinctrl-mxs.c create mode 100644 drivers/pinctrl/nxp/pinctrl-mxs.h