mirror of
https://github.com/ipxe/ipxe
synced 2025-12-13 15:31:42 +03:00
[intelxl] Read MAC address from PRTPM_SA[HL] instead of PRTGL_SA[HL]
The datasheet is fairly incomprehensible in terms of identifying the appropriate MAC address for use by the physical function driver. Choose to read the MAC address from PRTPM_SAH and PRTPM_SAL, which at least matches the MAC address as selected by the Linux i40e driver. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -87,15 +87,16 @@ static int intelxl_reset ( struct intelxl_nic *intelxl ) {
|
|||||||
static int intelxl_fetch_mac ( struct intelxl_nic *intelxl,
|
static int intelxl_fetch_mac ( struct intelxl_nic *intelxl,
|
||||||
struct net_device *netdev ) {
|
struct net_device *netdev ) {
|
||||||
union intelxl_receive_address mac;
|
union intelxl_receive_address mac;
|
||||||
uint32_t prtgl_sal;
|
uint32_t prtpm_sal;
|
||||||
|
uint32_t prtpm_sah;
|
||||||
uint32_t prtgl_sah;
|
uint32_t prtgl_sah;
|
||||||
size_t mfs;
|
size_t mfs;
|
||||||
|
|
||||||
/* Read NVM-loaded address */
|
/* Read NVM-loaded address */
|
||||||
prtgl_sal = readl ( intelxl->regs + INTELXL_PRTGL_SAL );
|
prtpm_sal = readl ( intelxl->regs + INTELXL_PRTPM_SAL );
|
||||||
prtgl_sah = readl ( intelxl->regs + INTELXL_PRTGL_SAH );
|
prtpm_sah = readl ( intelxl->regs + INTELXL_PRTPM_SAH );
|
||||||
mac.reg.low = cpu_to_le32 ( prtgl_sal );
|
mac.reg.low = cpu_to_le32 ( prtpm_sal );
|
||||||
mac.reg.high = cpu_to_le32 ( prtgl_sah );
|
mac.reg.high = cpu_to_le32 ( prtpm_sah );
|
||||||
|
|
||||||
/* Check that address is valid */
|
/* Check that address is valid */
|
||||||
if ( ! is_valid_ether_addr ( mac.raw ) ) {
|
if ( ! is_valid_ether_addr ( mac.raw ) ) {
|
||||||
@@ -110,6 +111,7 @@ static int intelxl_fetch_mac ( struct intelxl_nic *intelxl,
|
|||||||
memcpy ( netdev->hw_addr, mac.raw, ETH_ALEN );
|
memcpy ( netdev->hw_addr, mac.raw, ETH_ALEN );
|
||||||
|
|
||||||
/* Get maximum frame size */
|
/* Get maximum frame size */
|
||||||
|
prtgl_sah = readl ( intelxl->regs + INTELXL_PRTGL_SAH );
|
||||||
mfs = INTELXL_PRTGL_SAH_MFS_GET ( prtgl_sah );
|
mfs = INTELXL_PRTGL_SAH_MFS_GET ( prtgl_sah );
|
||||||
netdev->max_pkt_len = ( mfs - 4 /* CRC */ );
|
netdev->max_pkt_len = ( mfs - 4 /* CRC */ );
|
||||||
|
|
||||||
|
|||||||
@@ -1005,6 +1005,12 @@ intelxl_init_ring ( struct intelxl_ring *ring, unsigned int count, size_t len,
|
|||||||
#define INTELXL_PRTGL_SAH_MFS_GET(x) ( (x) >> 16 ) /**< Max frame size */
|
#define INTELXL_PRTGL_SAH_MFS_GET(x) ( (x) >> 16 ) /**< Max frame size */
|
||||||
#define INTELXL_PRTGL_SAH_MFS_SET(x) ( (x) << 16 ) /**< Max frame size */
|
#define INTELXL_PRTGL_SAH_MFS_SET(x) ( (x) << 16 ) /**< Max frame size */
|
||||||
|
|
||||||
|
/** Physical Function MAC Address Low Register */
|
||||||
|
#define INTELXL_PRTPM_SAL 0x1e4440
|
||||||
|
|
||||||
|
/** Physical Function MAC Address High Register */
|
||||||
|
#define INTELXL_PRTPM_SAH 0x1e44c0
|
||||||
|
|
||||||
/** Receive address */
|
/** Receive address */
|
||||||
union intelxl_receive_address {
|
union intelxl_receive_address {
|
||||||
struct {
|
struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user