From f4400fe41a5a80ea58f8881eaa263aae99636698 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sat, 19 Oct 2024 17:36:28 -0600 Subject: finish w5500? --- cmd/sbc_harness/hw/w5500.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'cmd/sbc_harness/hw/w5500.h') diff --git a/cmd/sbc_harness/hw/w5500.h b/cmd/sbc_harness/hw/w5500.h index 4f02152..d0c8d48 100644 --- a/cmd/sbc_harness/hw/w5500.h +++ b/cmd/sbc_harness/hw/w5500.h @@ -7,6 +7,8 @@ #ifndef _HW_W5500_H_ #define _HW_W5500_H_ +#include +#include #include #include "hw/spi.h" @@ -29,22 +31,26 @@ struct _w5500_listener { /* mutable */ uint16_t port; + cr_mutex_t cmd_mu; + cr_sema_t listen_sema, read_sema; }; struct w5500 { /* const-after-init */ struct spi *spidev; + uint pin_intr; uint pin_reset; /* mutable */ uint16_t next_local_port; struct _w5500_listener listeners[8]; + cr_sema_t intr; }; /** * Initialize a WIZnet W5500 Ethernet-and-TCP/IP-offload chip. * - * The W5500 has 3 channels of communication with the MCU: + * The W5500 has 3 lines of communication with the MCU: * * - An SPI-based RPC protocol: * + mode: mode 0 or mode 3 @@ -67,7 +73,12 @@ void _w5500_init(struct w5500 *self, /** * TODO. */ -void w5500_reset(struct w5500 *self, struct net_eth_addr addr); +void w5500_hard_reset(struct w5500 *self, struct net_eth_addr addr); + +/** + * TODO. + */ +void w5500_soft_reset(struct w5500 *self, struct net_eth_addr addr); struct w5500_netcfg { struct net_ip4_addr gateway_addr; -- cgit v1.2.3-2-g168b