Commit 4373c932 authored by Pravin M. Bathija's avatar Pravin M. Bathija Committed by Jeff Garzik

NEWEMAC: fix support for pause packets

Problem Description and Fix
---------------------------
When a pause packet(with destination as reserved Multicast address) is
received by the EMAC hardware to control the flow of frames being
transmitted by it, it is dropped by the hardware unless the reserved
Multicast address is hashed in to the GAHT[1-4] registers. This code fix
adds the default reserved multicast address to the GAHT[1-4] registers
in the EMAC(s) present on the chip. The flow control with Pause packets
will only work if the following register bits are programmed in EMAC:
EMACx_MR1[APP] = 1
EMACx_RMR[BAE] = 1
EMACx_RMR[MAE] = 1

Behavior that may be observed in a running system
-------------------------------------------------
A host transferring data from a PPC based system may send a Pause packet
to the PPC EMAC requesting it to slow down the flow of packets. If the
default reserved multicast MAC address is not programmed into the
GAHT[1-4] registers this Pause packet will be dropped by PPC EMAC and no
Flow Control will be done.
Signed-off-by: default avatarPravin M. Bathija <pbathija@amcc.com>
Signed-off-by: default avatarStefan Roese <sr@denx.de>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 16bb547e
...@@ -143,6 +143,10 @@ static inline void emac_report_timeout_error(struct emac_instance *dev, ...@@ -143,6 +143,10 @@ static inline void emac_report_timeout_error(struct emac_instance *dev,
#define STOP_TIMEOUT_1000 13 #define STOP_TIMEOUT_1000 13
#define STOP_TIMEOUT_1000_JUMBO 73 #define STOP_TIMEOUT_1000_JUMBO 73
static unsigned char default_mcast_addr[] = {
0x01, 0x80, 0xC2, 0x00, 0x00, 0x01
};
/* Please, keep in sync with struct ibm_emac_stats/ibm_emac_error_stats */ /* Please, keep in sync with struct ibm_emac_stats/ibm_emac_error_stats */
static const char emac_stats_keys[EMAC_ETHTOOL_STATS_COUNT][ETH_GSTRING_LEN] = { static const char emac_stats_keys[EMAC_ETHTOOL_STATS_COUNT][ETH_GSTRING_LEN] = {
"rx_packets", "rx_bytes", "tx_packets", "tx_bytes", "rx_packets_csum", "rx_packets", "rx_bytes", "tx_packets", "tx_bytes", "rx_packets_csum",
...@@ -618,6 +622,9 @@ static int emac_configure(struct emac_instance *dev) ...@@ -618,6 +622,9 @@ static int emac_configure(struct emac_instance *dev)
if (emac_phy_gpcs(dev->phy.mode)) if (emac_phy_gpcs(dev->phy.mode))
emac_mii_reset_phy(&dev->phy); emac_mii_reset_phy(&dev->phy);
/* Required for Pause packet support in EMAC */
dev_mc_add(ndev, default_mcast_addr, sizeof(default_mcast_addr), 1);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment