static void b53_arl_read_entry_25(struct b53_device *dev,
struct b53_arl_entry *ent, u8 idx)
{
+ u8 vid_entry;
u64 mac_vid;
+ b53_read8(dev, B53_ARLIO_PAGE, B53_ARLTBL_VID_ENTRY_25(idx),
+ &vid_entry);
b53_read64(dev, B53_ARLIO_PAGE, B53_ARLTBL_MAC_VID_ENTRY(idx),
&mac_vid);
- b53_arl_to_entry_25(ent, mac_vid);
+ b53_arl_to_entry_25(ent, mac_vid, vid_entry);
}
static void b53_arl_write_entry_25(struct b53_device *dev,
const struct b53_arl_entry *ent, u8 idx)
{
+ u8 vid_entry;
u64 mac_vid;
- b53_arl_from_entry_25(&mac_vid, ent);
+ b53_arl_from_entry_25(&mac_vid, &vid_entry, ent);
+ b53_write8(dev, B53_ARLIO_PAGE, B53_ARLTBL_VID_ENTRY_25(idx), vid_entry);
b53_write64(dev, B53_ARLIO_PAGE, B53_ARLTBL_MAC_VID_ENTRY(idx),
mac_vid);
}
}
static inline void b53_arl_to_entry_25(struct b53_arl_entry *ent,
- u64 mac_vid)
+ u64 mac_vid, u8 vid_entry)
{
memset(ent, 0, sizeof(*ent));
ent->is_valid = !!(mac_vid & ARLTBL_VALID_25);
ARLTBL_DATA_PORT_ID_S_25;
if (is_unicast_ether_addr(ent->mac) && ent->port == B53_CPU_PORT)
ent->port = B53_CPU_PORT_25;
- ent->vid = (mac_vid >> ARLTBL_VID_S_65) & ARLTBL_VID_MASK_25;
+ ent->vid = vid_entry;
}
static inline void b53_arl_to_entry_89(struct b53_arl_entry *ent,
*fwd_entry |= ARLTBL_AGE;
}
-static inline void b53_arl_from_entry_25(u64 *mac_vid,
+static inline void b53_arl_from_entry_25(u64 *mac_vid, u8 *vid_entry,
const struct b53_arl_entry *ent)
{
*mac_vid = ether_addr_to_u64(ent->mac);
else
*mac_vid |= ((u64)ent->port << ARLTBL_DATA_PORT_ID_S_25) &
ARLTBL_DATA_PORT_ID_MASK_25;
- *mac_vid |= (u64)(ent->vid & ARLTBL_VID_MASK_25) <<
- ARLTBL_VID_S_65;
if (ent->is_valid)
*mac_vid |= ARLTBL_VALID_25;
if (ent->is_static)
*mac_vid |= ARLTBL_STATIC_25;
if (ent->is_age)
*mac_vid |= ARLTBL_AGE_25;
+ *vid_entry = ent->vid;
}
static inline void b53_arl_from_entry_89(u64 *mac_vid, u32 *fwd_entry,
ent->is_age = !!(mac_vid & ARLTBL_AGE_25);
ent->is_static = !!(mac_vid & ARLTBL_STATIC_25);
u64_to_ether_addr(mac_vid, ent->mac);
- ent->vid = (mac_vid >> ARLTBL_VID_S_65) & ARLTBL_VID_MASK_25;
+ ent->vid = (mac_vid & ARL_SRCH_RSLT_VID_MASK_25) >>
+ ARL_SRCH_RSLT_VID_S_25;
ent->port = (mac_vid & ARL_SRCH_RSLT_PORT_ID_MASK_25) >>
ARL_SRCH_RSLT_PORT_ID_S_25;
if (is_multicast_ether_addr(ent->mac) && (ext & ARL_SRCH_RSLT_EXT_MC_MII))
#define B53_ARLTBL_MAC_VID_ENTRY(n) ((0x10 * (n)) + 0x10)
#define ARLTBL_MAC_MASK 0xffffffffffffULL
#define ARLTBL_VID_S 48
-#define ARLTBL_VID_MASK_25 0xff
#define ARLTBL_VID_MASK 0xfff
#define ARLTBL_DATA_PORT_ID_S_25 48
#define ARLTBL_DATA_PORT_ID_MASK_25 GENMASK_ULL(53, 48)
-#define ARLTBL_VID_S_65 53
#define ARLTBL_AGE_25 BIT_ULL(61)
#define ARLTBL_STATIC_25 BIT_ULL(62)
#define ARLTBL_VALID_25 BIT_ULL(63)
#define ARLTBL_STATIC_89 BIT(14)
#define ARLTBL_VALID_89 BIT(15)
+/* BCM5325/BCM565 ARL Table VID Entry N Registers (8 bit) */
+#define B53_ARLTBL_VID_ENTRY_25(n) ((0x2 * (n)) + 0x30)
+
/* Maximum number of bin entries in the ARL for all switches */
#define B53_ARLTBL_MAX_BIN_ENTRIES 4
#define B53_ARL_SRCH_RSTL_0_MACVID_25 0x24
#define ARL_SRCH_RSLT_PORT_ID_S_25 48
#define ARL_SRCH_RSLT_PORT_ID_MASK_25 GENMASK_ULL(52, 48)
+#define ARL_SRCH_RSLT_VID_S_25 53
+#define ARL_SRCH_RSLT_VID_MASK_25 GENMASK_ULL(60, 53)
/* BCM5325/5365 Search result extend register (8 bit) */
#define B53_ARL_SRCH_RSLT_EXT_25 0x2c