Merge pull request #389 from adamgreig/stm32h7-eth-fix

STM32H7: Ethernet: Disable RA in MAC filtering, fix order of MACA0 register writes
This commit is contained in:
Dario Nieuwenhuis 2021-09-07 11:12:46 +02:00 committed by GitHub
commit 9082e5f6c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,6 +98,10 @@ impl<'d, P: PHY, const TX: usize, const RX: usize> Ethernet<'d, P, TX, RX> {
// TODO: Carrier sense ? ECRSFD
});
// Note: Writing to LR triggers synchronisation of both LR and HR into the MAC core,
// so the LR write must happen after the HR write.
mac.maca0hr()
.modify(|w| w.set_addrhi(u16::from(mac_addr[4]) | (u16::from(mac_addr[5]) << 8)));
mac.maca0lr().write(|w| {
w.set_addrlo(
u32::from(mac_addr[0])
@ -106,10 +110,7 @@ impl<'d, P: PHY, const TX: usize, const RX: usize> Ethernet<'d, P, TX, RX> {
| (u32::from(mac_addr[3]) << 24),
)
});
mac.maca0hr()
.modify(|w| w.set_addrhi(u16::from(mac_addr[4]) | (u16::from(mac_addr[5]) << 8)));
mac.macpfr().modify(|w| w.set_ra(true));
mac.macqtx_fcr().modify(|w| w.set_pt(0x100));
mtl.mtlrx_qomr().modify(|w| w.set_rsf(true));