From patchwork Thu Dec 17 17:32:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Purna Chandra Mandal X-Patchwork-Id: 558480 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 9E549140297 for ; Fri, 18 Dec 2015 04:34:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4130F4BCDC; Thu, 17 Dec 2015 18:34:54 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FELwTkGdC3kd; Thu, 17 Dec 2015 18:34:54 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BAF084BCAB; Thu, 17 Dec 2015 18:34:53 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4C32C4BCAB for ; Thu, 17 Dec 2015 18:34:50 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YEIkY-g_XzNo for ; Thu, 17 Dec 2015 18:34:50 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from email.microchip.com (exsmtp03.microchip.com [198.175.253.49]) by theia.denx.de (Postfix) with ESMTPS id 69E9C4B942 for ; Thu, 17 Dec 2015 18:34:49 +0100 (CET) Received: from [10.41.20.11] (10.10.76.4) by chn-sv-exch03.mchp-main.com (10.10.76.49) with Microsoft SMTP Server id 14.3.181.6; Thu, 17 Dec 2015 10:34:46 -0700 To: From: Purna Chandra Mandal Message-ID: <5672F1CB.1080600@microchip.com> Date: Thu, 17 Dec 2015 23:02:59 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Cc: Joe Hershberger Subject: [U-Boot] [PATCH v1 14/18] board: Add gpio and ethernet support to pic32mzdask board. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Add GPIO and network (DHCP. BOOTP, TFTP protocol) support. Signed-off-by: Purna Chandra Mandal --- arch/mips/dts/pic32mzda.dtsi | 92 ++++++++++++++++++++++++++++++++++++++++++ arch/mips/dts/pic32mzda_sk.dts | 5 +++ configs/pic32mzdask_defconfig | 9 +++++ include/configs/pic32mzdask.h | 22 ++++++++++ 4 files changed, 128 insertions(+) diff --git a/arch/mips/dts/pic32mzda.dtsi b/arch/mips/dts/pic32mzda.dtsi index 1333573..cf76825 100644 --- a/arch/mips/dts/pic32mzda.dtsi +++ b/arch/mips/dts/pic32mzda.dtsi @@ -5,12 +5,26 @@ * SPDX-License-Identifier: GPL-2.0+ */ +#include #include #include "skeleton.dtsi" / { compatible = "microchip,pic32mzda", "microchip,pic32mz"; + aliases { + gpio0 = &gpioA; + gpio1 = &gpioB; + gpio2 = &gpioC; + gpio3 = &gpioD; + gpio4 = &gpioE; + gpio5 = &gpioF; + gpio6 = &gpioG; + gpio7 = &gpioH; + gpio8 = &gpioJ; + gpio9 = &gpioK; + }; + cpus { cpu@0 { compatible = "mips,mips14kc"; @@ -56,4 +70,82 @@ <0xbf801500 0x200>; /* out */ status = "disabled"; }; + + gpioA: gpio0@1f860000 { + compatible = "microchip,gpio-bank"; + reg = <0xbf860000 0x24>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpioB: gpio1@1f860100 { + compatible = "microchip,gpio-bank"; + reg = <0xbf860100 0x24>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpioC: gpio2@1f860200 { + compatible = "microchip,gpio-bank"; + reg = <0xbf860200 0x24>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpioD: gpio3@1f860300 { + compatible = "microchip,gpio-bank"; + reg = <0xbf860300 0x24>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpioE: gpio4@1f860400 { + compatible = "microchip,gpio-bank"; + reg = <0xbf860400 0x24>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpioF: gpio5@1f860500 { + compatible = "microchip,gpio-bank"; + reg = <0xbf860500 0x24>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpioG: gpio6@1f860600 { + compatible = "microchip,gpio-bank"; + reg = <0xbf860600 0x24>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpioH: gpio7@1f860700 { + compatible = "microchip,gpio-bank"; + reg = <0xbf860700 0x24>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpioJ: gpio8@1f860800 { + compatible = "microchip,gpio-bank"; + reg = <0xbf860800 0x24>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpioK: gpio9@1f860900 { + compatible = "microchip,gpio-bank"; + reg = <0xbf860900 0x24>; + gpio-controller; + #gpio-cells = <2>; + }; + + ethernet: ethernet@1f882000 { + compatible = "microchip,pic32mzda-eth"; + reg = <0xbf882000 0x1000>; + interrupts = <153 IRQ_TYPE_LEVEL_HIGH>; + phy-mode = "rmii"; + status = "disabled"; + }; }; diff --git a/arch/mips/dts/pic32mzda_sk.dts b/arch/mips/dts/pic32mzda_sk.dts index 99e7f64..38ef9c0 100644 --- a/arch/mips/dts/pic32mzda_sk.dts +++ b/arch/mips/dts/pic32mzda_sk.dts @@ -36,3 +36,8 @@ status = "okay"; u-boot,dm-pre-reloc; }; + +ðernet { + reset-gpios = <&gpioJ 15 0>; + status = "okay"; +}; diff --git a/configs/pic32mzdask_defconfig b/configs/pic32mzdask_defconfig index df06f8b..d74d169 100644 --- a/configs/pic32mzdask_defconfig +++ b/configs/pic32mzdask_defconfig @@ -7,6 +7,7 @@ CONFIG_SYS_LITTLE_ENDIAN=y CONFIG_HUSH_PARSER=y CONFIG_SYS_HUSH_PARSER=y CONFIG_SYS_PROMPT="dask # " +CONFIG_CMD_NET=y CONFIG_CMD_TIME=y # CONFIG_CMD_IMLS is not set CONFIG_SUPPORT_OF_CONTROL=y @@ -20,3 +21,11 @@ CONFIG_CLK=y CONFIG_PINCTRL=y # CONFIG_PINCTRL_FULL is not set CONFIG_PIC32_PINCTRL=y +CONFIG_DM_GPIO=y +CONFIG_CMD_GPIO=y +CONFIG_PIC32_GPIO=y +CONFIG_NET=y +CONFIG_DM_ETH=y +CONFIG_PHYLIB=y +CONFIG_NETDEVICES=y +CONFIG_PIC32_ETH=y diff --git a/include/configs/pic32mzdask.h b/include/configs/pic32mzdask.h index 89925f6..8e5c31b 100644 --- a/include/configs/pic32mzdask.h +++ b/include/configs/pic32mzdask.h @@ -100,6 +100,28 @@ (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) #define CONFIG_CMDLINE_EDITING 1 +/*----------------------------------------------------------------------- + * Networking Configuration + */ +#define CONFIG_MII +#define CONFIG_PHY_SMSC + +#define CONFIG_CMD_MII +#define CONFIG_CMD_PING +#define CONFIG_CMD_DHCP +#define CONFIG_PHY_ADDR 0 /* LAN87XX */ +#define CONFIG_ARP_TIMEOUT 500 /* millisec */ +#define CONFIG_NET_RETRY_COUNT 20 +#define CONFIG_SYS_RX_ETH_BUFFER 8 + +/* + * BOOTP options + */ +#define CONFIG_BOOTP_BOOTFILESIZE +#define CONFIG_BOOTP_BOOTPATH +#define CONFIG_BOOTP_GATEWAY +#define CONFIG_BOOTP_HOSTNAME + /* * Handover flattened device tree (dtb file) to Linux kernel */