drivers: eth_enc424j600: explicitly disable INTIE after reset

After system reset (SETETHRST) interrupt enable register (EIE)
has the default value 0x8010 and global interrupt enable flag (INTIE)
is set. This is not desired and the INTIE flag should be set only at
the end of the initialization.

Disable INTIE flag and set desired interrupts sources in
a single write command just right after system reset.

Resolves: #35091

Reported-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2021-05-18 19:28:16 +02:00 committed by Anas Nashif
parent 6de9c18f03
commit de974efebb
1 changed files with 9 additions and 9 deletions

View File

@ -690,6 +690,15 @@ static int enc424j600_init(const struct device *dev)
return -EIO;
}
/* Disable INTIE and setup interrupt logic */
enc424j600_write_sfru(dev, ENC424J600_SFR3_EIEL,
ENC424J600_EIE_PKTIE | ENC424J600_EIE_LINKIE);
if (CONFIG_ETHERNET_LOG_LEVEL == LOG_LEVEL_DBG) {
enc424j600_read_sfru(dev, ENC424J600_SFR3_EIEL, &tmp);
LOG_DBG("EIE: 0x%04x", tmp);
}
/* Configure TX and RX buffer */
enc424j600_write_sfru(dev, ENC424J600_SFR0_ETXSTL,
ENC424J600_TXSTART);
@ -721,15 +730,6 @@ static int enc424j600_init(const struct device *dev)
enc424j600_init_filters(dev);
enc424j600_init_phy(dev);
/* Setup interrupt logic */
enc424j600_set_sfru(dev, ENC424J600_SFR3_EIEL,
ENC424J600_EIE_PKTIE | ENC424J600_EIE_LINKIE);
if (CONFIG_ETHERNET_LOG_LEVEL == LOG_LEVEL_DBG) {
enc424j600_read_sfru(dev, ENC424J600_SFR3_EIEL, &tmp);
LOG_DBG("EIE: 0x%04x", tmp);
}
/* Enable Reception */
enc424j600_set_sfru(dev, ENC424J600_SFRX_ECON1L, ENC424J600_ECON1_RXEN);
if (CONFIG_ETHERNET_LOG_LEVEL == LOG_LEVEL_DBG) {