1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef _SOC_ELKHARTLAKE_TSN_GBE_H_ 4 #define _SOC_ELKHARTLAKE_TSN_GBE_H_ 5 6 #define GMII_TIMEOUT_MS 20 7 8 #define MAC_MDIO_ADR 0x200 /* MAC MDIO address register */ 9 #define MAC_MDIO_ADR_MASK 0x03FF7F0E 10 #define MAC_PHYAD(pa) (pa << 21) /* Physical Layer address */ 11 #define MAC_REGAD(rda) (rda << 16) /* Register/Device address */ 12 #define MAC_CLK_TRAIL_4 (4 << 12) /* 4 trailing clocks */ 13 #define MAC_CSR_CLK_DIV_102 (1 << 10) /* 100: CSR=150-250 MHz; CSR/102 */ 14 #define MAC_OP_CMD_WRITE (1 << 2) /* GMII Operation Command Write */ 15 #define MAC_OP_CMD_READ (3 << 2) /* GMII Operation Command Read */ 16 #define MAC_GMII_BUSY (1 << 0) /* GMII Busy bit */ 17 #define MAC_MDIO_DATA 0x204 /* MAC MDIO data register */ 18 19 #define MAC_ADDR_LEN 6 20 21 #define TSN_MAC_ADD0_HIGH 0x300 /* MAC Address0 High register */ 22 #define TSN_MAC_ADD0_LOW 0x304 /* MAC Address0 Low register */ 23 24 /* MDIO - Adhoc PHY Sublayer Register */ 25 #define TSN_MAC_MDIO_ADHOC_ADR 0x15 26 /* Global Configuration Register */ 27 #define TSN_MAC_MDIO_GCR 0x0 28 /* PHY to MAC Interrupt Polarity bit */ 29 #define TSN_MAC_PHY2MAC_INTR_POL (1 << 6) 30 31 /* We need one function we can call to get a MAC address to use. */ 32 /* This function can be coded somewhere else but must exist. */ 33 enum cb_err mainboard_get_mac_address(struct device *dev, uint8_t mac[MAC_ADDR_LEN]); 34 35 #endif /* _SOC_ELKHARTLAKE_TSN_GBE_H_ */ 36