From: Purna Chandra Mandal <purna.mandal@microchip.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 14/18] board: Add gpio and ethernet support to pic32mzdask board.
Date: Thu, 17 Dec 2015 23:02:59 +0530 [thread overview]
Message-ID: <5672F1CB.1080600@microchip.com> (raw)
Add GPIO and network (DHCP. BOOTP, TFTP protocol) support.
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
---
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 <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#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 at 0 {
compatible = "mips,mips14kc";
@@ -56,4 +70,82 @@
<0xbf801500 0x200>; /* out */
status = "disabled";
};
+
+ gpioA: gpio0 at 1f860000 {
+ compatible = "microchip,gpio-bank";
+ reg = <0xbf860000 0x24>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpioB: gpio1 at 1f860100 {
+ compatible = "microchip,gpio-bank";
+ reg = <0xbf860100 0x24>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpioC: gpio2 at 1f860200 {
+ compatible = "microchip,gpio-bank";
+ reg = <0xbf860200 0x24>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpioD: gpio3 at 1f860300 {
+ compatible = "microchip,gpio-bank";
+ reg = <0xbf860300 0x24>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpioE: gpio4 at 1f860400 {
+ compatible = "microchip,gpio-bank";
+ reg = <0xbf860400 0x24>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpioF: gpio5 at 1f860500 {
+ compatible = "microchip,gpio-bank";
+ reg = <0xbf860500 0x24>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpioG: gpio6 at 1f860600 {
+ compatible = "microchip,gpio-bank";
+ reg = <0xbf860600 0x24>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpioH: gpio7 at 1f860700 {
+ compatible = "microchip,gpio-bank";
+ reg = <0xbf860700 0x24>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpioJ: gpio8 at 1f860800 {
+ compatible = "microchip,gpio-bank";
+ reg = <0xbf860800 0x24>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpioK: gpio9 at 1f860900 {
+ compatible = "microchip,gpio-bank";
+ reg = <0xbf860900 0x24>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ ethernet: ethernet at 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
*/
--
1.8.3.1
reply other threads:[~2015-12-17 17:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5672F1CB.1080600@microchip.com \
--to=purna.mandal@microchip.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.