diff --git a/boards/arm/lpcxpresso55s69/pinmux.c b/boards/arm/lpcxpresso55s69/pinmux.c index 37fc154d9518..939f99ee952f 100644 --- a/boards/arm/lpcxpresso55s69/pinmux.c +++ b/boards/arm/lpcxpresso55s69/pinmux.c @@ -125,8 +125,12 @@ static int lpcxpresso_55s69_pinmux_init(struct device *dev) IOCON_PIO_SLEW_STANDARD | IOCON_PIO_OPENDRAIN_DI); + uint32_t pio_func = IOCON_PIO_FUNC5; /* Flexcomm controlled CS*/ +#if DT_NODE_HAS_PROP(DT_NODELABEL(hs_lspi), cs_gpios) + pio_func = IOCON_PIO_FUNC0; /* GPIO controlled CS*/ +#endif /* PORT1 PIN1 is configured as HS_SPI_SSEL1 */ - pinmux_pin_set(port1, 1, IOCON_PIO_FUNC5 | + pinmux_pin_set(port1, 1, pio_func | IOCON_PIO_MODE_PULLUP | IOCON_PIO_INV_DI | IOCON_PIO_DIGITAL_EN | diff --git a/drivers/ethernet/eth_enc28j60.c b/drivers/ethernet/eth_enc28j60.c index 947f3585b5fd..2a6981fb255a 100644 --- a/drivers/ethernet/eth_enc28j60.c +++ b/drivers/ethernet/eth_enc28j60.c @@ -382,18 +382,18 @@ static void eth_enc28j60_init_mac(struct device *dev) } /* Configure MAC address */ - eth_enc28j60_set_bank(dev, ENC28J60_REG_MAADR0); - eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR0, + eth_enc28j60_set_bank(dev, ENC28J60_REG_MAADR1); + eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR6, context->mac_address[5]); - eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR1, + eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR5, context->mac_address[4]); - eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR2, + eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR4, context->mac_address[3]); eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR3, context->mac_address[2]); - eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR4, + eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR2, context->mac_address[1]); - eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR5, + eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR1, context->mac_address[0]); } @@ -510,6 +510,7 @@ static int eth_enc28j60_rx(struct device *dev, uint16_t *vlan_tag) struct eth_enc28j60_runtime *context = dev->driver_data; uint16_t lengthfr; uint8_t counter; + uint8_t dummy[4]; /* Errata 6. The Receive Packet Pending Interrupt Flag (EIR.PKTIF) * does not reliably/accurately report the status of pending packet. @@ -600,13 +601,13 @@ static int eth_enc28j60_rx(struct device *dev, uint16_t *vlan_tag) } while (frm_len > 0); /* Let's pop the useless CRC */ - eth_enc28j60_read_mem(dev, NULL, 4); + eth_enc28j60_read_mem(dev, dummy, 4); /* Pops one padding byte from spi circular buffer * introduced by the device when the frame length is odd */ if (lengthfr & 0x01) { - eth_enc28j60_read_mem(dev, NULL, 1); + eth_enc28j60_read_mem(dev, dummy, 1); } #if defined(CONFIG_NET_VLAN) diff --git a/drivers/ethernet/eth_enc28j60_priv.h b/drivers/ethernet/eth_enc28j60_priv.h index 14a73eeea44f..11828c0a1c62 100644 --- a/drivers/ethernet/eth_enc28j60_priv.h +++ b/drivers/ethernet/eth_enc28j60_priv.h @@ -99,12 +99,12 @@ #define ENC28J60_REG_MIRDH 0x2219 /* Bank 3 Registers */ -#define ENC28J60_REG_MAADR1 0x1300 -#define ENC28J60_REG_MAADR0 0x1301 +#define ENC28J60_REG_MAADR5 0x1300 +#define ENC28J60_REG_MAADR6 0x1301 #define ENC28J60_REG_MAADR3 0x1302 -#define ENC28J60_REG_MAADR2 0x1303 -#define ENC28J60_REG_MAADR5 0x1304 -#define ENC28J60_REG_MAADR4 0x1305 +#define ENC28J60_REG_MAADR4 0x1303 +#define ENC28J60_REG_MAADR1 0x1304 +#define ENC28J60_REG_MAADR2 0x1305 #define ENC28J60_REG_EBSTSD 0x0306 #define ENC28J60_REG_EBSTCON 0x0307 #define ENC28J60_REG_EBSTCSL 0x0308 diff --git a/dts/arm/nxp/nxp_lpc55S6x_common.dtsi b/dts/arm/nxp/nxp_lpc55S6x_common.dtsi index 985be1bc5d7a..37a1eaaa6243 100644 --- a/dts/arm/nxp/nxp_lpc55S6x_common.dtsi +++ b/dts/arm/nxp/nxp_lpc55S6x_common.dtsi @@ -192,6 +192,8 @@ hs_lspi: spi@9f000 { compatible = "nxp,lpc-spi"; + cs-gpios = <&gpio0 20 0>,<&gpio1 1 0>,<&gpio1 12 0>, + <&gpio1 26 0>; reg = <0x9f000 0x1000>; interrupts = <59 0>; label = "HS_LSPI";