struct stmmac_version *ver)
{
enum dwmac_core_type core_type = priv->plat->core_type;
+ unsigned int version_offset;
+ ver->snpsver = 0;
ver->dev_id = 0;
- if (core_type == DWMAC_CORE_GMAC) {
- ver->snpsver = stmmac_get_id(priv, GMAC_VERSION);
- } else if (dwmac_is_xmac(core_type)) {
- ver->snpsver = stmmac_get_id(priv, GMAC4_VERSION);
- if (core_type == DWMAC_CORE_XGMAC)
- ver->dev_id = stmmac_get_dev_id(priv, GMAC4_VERSION);
- } else {
- ver->snpsver = 0;
- }
+ if (core_type == DWMAC_CORE_MAC100)
+ return;
+
+ if (core_type == DWMAC_CORE_GMAC)
+ version_offset = GMAC_VERSION;
+ else
+ version_offset = GMAC4_VERSION;
+
+ ver->snpsver = stmmac_get_id(priv, version_offset);
+ if (core_type == DWMAC_CORE_XGMAC)
+ ver->dev_id = stmmac_get_dev_id(priv, version_offset);
}
static void stmmac_dwmac_mode_quirk(struct stmmac_priv *priv)