Skip to content

Commit d9f5824

Browse files
committed
Merge branch 'enetc-v4-hardware-integration-fixes'
Claudiu Manoil says: ==================== ENETC v4 hardware integration fixes ENETC v4 targeted fixes addressing SoC level integration issues regarding AXI settings and register access width. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 74d9391 + c28d765 commit d9f5824

4 files changed

Lines changed: 24 additions & 14 deletions

File tree

drivers/net/ethernet/freescale/enetc/enetc.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2512,10 +2512,13 @@ int enetc_configure_si(struct enetc_ndev_priv *priv)
25122512
struct enetc_hw *hw = &si->hw;
25132513
int err;
25142514

2515-
/* set SI cache attributes */
2516-
enetc_wr(hw, ENETC_SICAR0,
2517-
ENETC_SICAR_RD_COHERENT | ENETC_SICAR_WR_COHERENT);
2518-
enetc_wr(hw, ENETC_SICAR1, ENETC_SICAR_MSI);
2515+
if (is_enetc_rev1(si)) {
2516+
/* set SI cache attributes */
2517+
enetc_wr(hw, ENETC_SICAR0,
2518+
ENETC_SICAR_RD_COHERENT | ENETC_SICAR_WR_COHERENT);
2519+
enetc_wr(hw, ENETC_SICAR1, ENETC_SICAR_MSI);
2520+
}
2521+
25192522
/* enable SI */
25202523
enetc_wr(hw, ENETC_SIMR, ENETC_SIMR_EN);
25212524

drivers/net/ethernet/freescale/enetc/enetc4_pf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ static void enetc4_pf_set_si_primary_mac(struct enetc_hw *hw, int si,
5959

6060
if (si != 0) {
6161
__raw_writel(upper, hw->port + ENETC4_PSIPMAR0(si));
62-
__raw_writew(lower, hw->port + ENETC4_PSIPMAR1(si));
62+
__raw_writel(lower, hw->port + ENETC4_PSIPMAR1(si));
6363
} else {
6464
__raw_writel(upper, hw->port + ENETC4_PMAR0);
65-
__raw_writew(lower, hw->port + ENETC4_PMAR1);
65+
__raw_writel(lower, hw->port + ENETC4_PMAR1);
6666
}
6767
}
6868

@@ -73,7 +73,7 @@ static void enetc4_pf_get_si_primary_mac(struct enetc_hw *hw, int si,
7373
u16 lower;
7474

7575
upper = __raw_readl(hw->port + ENETC4_PSIPMAR0(si));
76-
lower = __raw_readw(hw->port + ENETC4_PSIPMAR1(si));
76+
lower = __raw_readl(hw->port + ENETC4_PSIPMAR1(si));
7777

7878
put_unaligned_le32(upper, addr);
7979
put_unaligned_le16(lower, addr + 4);

drivers/net/ethernet/freescale/enetc/enetc_cbdr.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ int enetc4_setup_cbdr(struct enetc_si *si)
7474
if (!user->ring)
7575
return -ENOMEM;
7676

77-
/* set CBDR cache attributes */
78-
enetc_wr(hw, ENETC_SICAR2,
79-
ENETC_SICAR_RD_COHERENT | ENETC_SICAR_WR_COHERENT);
80-
8177
regs.pir = hw->reg + ENETC_SICBDRPIR;
8278
regs.cir = hw->reg + ENETC_SICBDRCIR;
8379
regs.mr = hw->reg + ENETC_SICBDRMR;

drivers/net/ethernet/freescale/enetc/enetc_hw.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,13 +708,24 @@ struct enetc_cmd_rfse {
708708
#define ENETC_RFSE_EN BIT(15)
709709
#define ENETC_RFSE_MODE_BD 2
710710

711+
static inline void enetc_get_primary_mac_addr(struct enetc_hw *hw, u8 *addr)
712+
{
713+
u32 upper;
714+
u16 lower;
715+
716+
upper = __raw_readl(hw->reg + ENETC_SIPMAR0);
717+
lower = __raw_readl(hw->reg + ENETC_SIPMAR1);
718+
719+
put_unaligned_le32(upper, addr);
720+
put_unaligned_le16(lower, addr + 4);
721+
}
722+
711723
static inline void enetc_load_primary_mac_addr(struct enetc_hw *hw,
712724
struct net_device *ndev)
713725
{
714-
u8 addr[ETH_ALEN] __aligned(4);
726+
u8 addr[ETH_ALEN];
715727

716-
*(u32 *)addr = __raw_readl(hw->reg + ENETC_SIPMAR0);
717-
*(u16 *)(addr + 4) = __raw_readw(hw->reg + ENETC_SIPMAR1);
728+
enetc_get_primary_mac_addr(hw, addr);
718729
eth_hw_addr_set(ndev, addr);
719730
}
720731

0 commit comments

Comments
 (0)