mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-10-03 11:41:38 +02:00
net: sun8i-emac: Add a flag for RMII support
Describe this feature instead of using the SoC ID. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
This commit is contained in:
parent
c86d47328e
commit
c5ac4b160f
@ -137,6 +137,7 @@ enum emac_variant_id {
|
|||||||
|
|
||||||
struct emac_variant {
|
struct emac_variant {
|
||||||
enum emac_variant_id variant;
|
enum emac_variant_id variant;
|
||||||
|
bool support_rmii;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct emac_dma_desc {
|
struct emac_dma_desc {
|
||||||
@ -337,9 +338,7 @@ static int sun8i_emac_set_syscon(struct sun8i_eth_pdata *pdata,
|
|||||||
reg = sun8i_emac_set_syscon_ephy(priv, reg);
|
reg = sun8i_emac_set_syscon_ephy(priv, reg);
|
||||||
|
|
||||||
reg &= ~(SC_ETCS_MASK | SC_EPIT);
|
reg &= ~(SC_ETCS_MASK | SC_EPIT);
|
||||||
if (priv->variant->variant == H3_EMAC ||
|
if (priv->variant->support_rmii)
|
||||||
priv->variant->variant == A64_EMAC ||
|
|
||||||
priv->variant->variant == H6_EMAC)
|
|
||||||
reg &= ~SC_RMII_EN;
|
reg &= ~SC_RMII_EN;
|
||||||
|
|
||||||
switch (priv->interface) {
|
switch (priv->interface) {
|
||||||
@ -353,13 +352,10 @@ static int sun8i_emac_set_syscon(struct sun8i_eth_pdata *pdata,
|
|||||||
reg |= SC_EPIT | SC_ETCS_INT_GMII;
|
reg |= SC_EPIT | SC_ETCS_INT_GMII;
|
||||||
break;
|
break;
|
||||||
case PHY_INTERFACE_MODE_RMII:
|
case PHY_INTERFACE_MODE_RMII:
|
||||||
if (priv->variant->variant == H3_EMAC ||
|
if (priv->variant->support_rmii) {
|
||||||
priv->variant->variant == A64_EMAC ||
|
|
||||||
priv->variant->variant == H6_EMAC) {
|
|
||||||
reg |= SC_RMII_EN | SC_ETCS_EXT_GMII;
|
reg |= SC_RMII_EN | SC_ETCS_EXT_GMII;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* RMII not supported on A83T */
|
|
||||||
default:
|
default:
|
||||||
debug("%s: Invalid PHY interface\n", __func__);
|
debug("%s: Invalid PHY interface\n", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -910,6 +906,7 @@ static const struct emac_variant emac_variant_a83t = {
|
|||||||
|
|
||||||
static const struct emac_variant emac_variant_h3 = {
|
static const struct emac_variant emac_variant_h3 = {
|
||||||
.variant = H3_EMAC,
|
.variant = H3_EMAC,
|
||||||
|
.support_rmii = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct emac_variant emac_variant_r40 = {
|
static const struct emac_variant emac_variant_r40 = {
|
||||||
@ -918,10 +915,12 @@ static const struct emac_variant emac_variant_r40 = {
|
|||||||
|
|
||||||
static const struct emac_variant emac_variant_a64 = {
|
static const struct emac_variant emac_variant_a64 = {
|
||||||
.variant = A64_EMAC,
|
.variant = A64_EMAC,
|
||||||
|
.support_rmii = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct emac_variant emac_variant_h6 = {
|
static const struct emac_variant emac_variant_h6 = {
|
||||||
.variant = H6_EMAC,
|
.variant = H6_EMAC,
|
||||||
|
.support_rmii = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct udevice_id sun8i_emac_eth_ids[] = {
|
static const struct udevice_id sun8i_emac_eth_ids[] = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user