diff --git a/drivers/amlogic/ethernet/phy/amlogic.c b/drivers/amlogic/ethernet/phy/amlogic.c index 4db2444ec9bd..f22be8009124 100644 --- a/drivers/amlogic/ethernet/phy/amlogic.c +++ b/drivers/amlogic/ethernet/phy/amlogic.c @@ -32,6 +32,7 @@ #include #include #include +#include #define SMI_ADDR_TSTWRITE 23 @@ -149,7 +150,15 @@ void custom_internal_config(struct phy_device *phydev) *if env tx_amp ==0 we will use the efuse */ efuse_amp = scpi_get_ethernet_calc(); - efuse_valid = (efuse_amp >> 3); + if (is_meson_g12b_cpu() && is_meson_rev_a()) { + pr_info("g12b a\n"); + efuse_valid = (efuse_amp >> 3); + efuse_amp = efuse_amp & 0x7; + } else { + pr_info("others\n"); + efuse_valid = (efuse_amp >> 4); + efuse_amp = efuse_amp & 0xf; + } env_valid = (tx_amp >> 7); if (env_valid || efuse_valid) { diff --git a/drivers/amlogic/mailbox/scpi_protocol.c b/drivers/amlogic/mailbox/scpi_protocol.c index 22883ee98e59..f0ebfc3dce07 100644 --- a/drivers/amlogic/mailbox/scpi_protocol.c +++ b/drivers/amlogic/mailbox/scpi_protocol.c @@ -591,7 +591,7 @@ u8 scpi_get_ethernet_calc(void) SCPI_SETUP_DBUF(sdata, mdata, SCPI_CL_NONE, SCPI_CMD_GET_ETHERNET_CALC, temp, buf); if (scpi_execute_cmd(&sdata)) - return -EPERM; + return 0; return buf.eth_calc; } EXPORT_SYMBOL_GPL(scpi_get_ethernet_calc);