Skip to content

Commit

Permalink
drivers: eth_enc424j600: explicitly disable INTIE after reset
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Johann Fischer <[email protected]>
  • Loading branch information
jfischer-no authored and nashif committed May 21, 2021
1 parent 6de9c18 commit de974ef
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions drivers/ethernet/eth_enc424j600.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit de974ef

Please sign in to comment.