From 88bac434c81147fac3ca590ce7648f5887d70960 Mon Sep 17 00:00:00 2001 From: Grant Ramsay Date: Sat, 25 May 2024 14:56:44 +1200 Subject: [PATCH] boards: shields: Add support for WIZnet WIZ550io Ethernet shield Add support for WIZnet WIZ550io Ethernet shield Signed-off-by: Grant Ramsay --- .../wiznet_eth_wiz550io/Kconfig.defconfig | 13 ++++ .../wiznet_eth_wiz550io/Kconfig.shield | 5 ++ .../shields/wiznet_eth_wiz550io/doc/index.rst | 64 +++++++++++++++++++ .../wiznet_eth_wiz550io.overlay | 25 ++++++++ 4 files changed, 107 insertions(+) create mode 100644 boards/shields/wiznet_eth_wiz550io/Kconfig.defconfig create mode 100644 boards/shields/wiznet_eth_wiz550io/Kconfig.shield create mode 100644 boards/shields/wiznet_eth_wiz550io/doc/index.rst create mode 100644 boards/shields/wiznet_eth_wiz550io/wiznet_eth_wiz550io.overlay diff --git a/boards/shields/wiznet_eth_wiz550io/Kconfig.defconfig b/boards/shields/wiznet_eth_wiz550io/Kconfig.defconfig new file mode 100644 index 000000000000000..8292a8a9b8a3dc4 --- /dev/null +++ b/boards/shields/wiznet_eth_wiz550io/Kconfig.defconfig @@ -0,0 +1,13 @@ +# Copyright (c) 2024 Grant Ramsay +# SPDX-License-Identifier: Apache-2.0 + +if SHIELD_WIZNET_ETH_WIZ550IO + +if NETWORKING + +config NET_L2_ETHERNET + default y + +endif # NETWORKING + +endif # SHIELD_WIZNET_ETH_WIZ550IO diff --git a/boards/shields/wiznet_eth_wiz550io/Kconfig.shield b/boards/shields/wiznet_eth_wiz550io/Kconfig.shield new file mode 100644 index 000000000000000..e9fe393be77a546 --- /dev/null +++ b/boards/shields/wiznet_eth_wiz550io/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Grant Ramsay +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_WIZNET_ETH_WIZ550IO + def_bool $(shields_list_contains,wiznet_eth_wiz550io) diff --git a/boards/shields/wiznet_eth_wiz550io/doc/index.rst b/boards/shields/wiznet_eth_wiz550io/doc/index.rst new file mode 100644 index 000000000000000..7c4db619993fd9b --- /dev/null +++ b/boards/shields/wiznet_eth_wiz550io/doc/index.rst @@ -0,0 +1,64 @@ +.. _wiznet_eth_wiz550io: + +WIZnet WIZ550io ETH +################### + +Overview +******** + +WIZnet WIZ550io Ethernet is breakout board with SPI bus access. +`WIZ550io`_ contains a W5500 Ethernet controller with an extra PIC12F519 MCU. +The PIC12F519 MCU initialises the W5500 with a unique MAC address after a GPIO +reset. + +`W5500`_ is 10/100 MBPS stand alone Ethernet controller with on-board MAC & PHY, +16 KiloBytes for FIFO buffer and SPI serial interface. + +Pins Assignment of the WIZ550io Shield +====================================== + ++-----------------------+---------------------------------------------+ +| Shield Connector Pin | Function | ++=======================+=============================================+ +| RST# | Ethernet Controller's Reset | ++-----------------------+---------------------------------------------+ +| CS# | SPI's Chip Select | ++-----------------------+---------------------------------------------+ +| SCK | SPI's ClocK | ++-----------------------+---------------------------------------------+ +| SDO | SPI's Slave Data Output (MISO) | ++-----------------------+---------------------------------------------+ +| SDI | SPI's Slave Data Input (MISO) | ++-----------------------+---------------------------------------------+ +| INT | Ethernet Controller's Interrupt Output | ++-----------------------+---------------------------------------------+ +| RDY | WIZ550io Ready Output | ++-----------------------+---------------------------------------------+ + +Requirements +************ + +This shield/breakout board can be used with any board with SPI interfaces in +Arduino header or custom header (by adjusting the overlay). + +Programming +*********** + +Set ``-DSHIELD=wiznet_eth_wiz550io`` when you invoke ``west build``. For example: + +.. zephyr-app-commands:: + :zephyr-app: samples/net/dhcpv4_client + :board: nrf52840dk/nrf52840 + :shield: wiznet_eth_wiz550io + :goals: build + +References +********** + +.. target-notes:: + +.. _WIZ550io: + https://wiznet.io/products/network-modules/wiz550io + +.. _W5500: + https://wiznet.io/products/iethernet-chips/w5500 diff --git a/boards/shields/wiznet_eth_wiz550io/wiznet_eth_wiz550io.overlay b/boards/shields/wiznet_eth_wiz550io/wiznet_eth_wiz550io.overlay new file mode 100644 index 000000000000000..7a0074b1430b237 --- /dev/null +++ b/boards/shields/wiznet_eth_wiz550io/wiznet_eth_wiz550io.overlay @@ -0,0 +1,25 @@ +/* Copyright (c) 2024 Grant Ramsay + * SPDX-License-Identifier: Apache-2.0 + */ + +&arduino_spi { + status = "okay"; + + eth_w5500: eth_w5500@0 { + compatible = "wiznet,w5500"; + reg = <0x0>; + /* Note: Reducing spi-max-frequency may help with errors/stability */ + spi-max-frequency = ; + int-gpios = <&arduino_header 15 GPIO_ACTIVE_LOW>; /* D9 */ + /* Do not put the reset-gpios property here */ + }; +}; + +/ { + wiz550io { + compatible = "wiznet,wiz550io"; + wiznet,w5500 = <ð_w5500>; + reset-gpios = <&arduino_header 14 GPIO_ACTIVE_LOW>; /* D8 */ + ready-gpios = <&arduino_header 13 GPIO_ACTIVE_HIGH>; /* D7 */ + }; +};