eth: compatible internal phy enet efuse map for some chip [1/1]
authorqi duan <qi.duan@amlogic.com>
Wed, 25 Sep 2019 07:31:39 +0000 (03:31 -0400)
committerTao Zeng <tao.zeng@amlogic.com>
Wed, 25 Sep 2019 13:35:28 +0000 (06:35 -0700)
PD#SWPL-14596

Problem:
some g12a chip,efuse map for enet is diff
So need compatible for these chip

Solution:
read valid bit from valid block,not data block

Verify:
verified by tl1 and g12a

Change-Id: I564209d865cbc2ff1151df07d06593b12ea225d8
Signed-off-by: qi duan <qi.duan@amlogic.com>
drivers/amlogic/ethernet/phy/amlogic.c

index f22be80..86d9ee6 100644 (file)
@@ -150,13 +150,12 @@ void custom_internal_config(struct phy_device *phydev)
         *if env tx_amp ==0 we will use the efuse
         */
        efuse_amp = scpi_get_ethernet_calc();
+       pr_info("efuse tx_amp = %d\n", efuse_amp);
        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_valid = ((efuse_amp >> 4) & 0x3);
                efuse_amp = efuse_amp & 0xf;
        }
        env_valid = (tx_amp >> 7);
@@ -166,11 +165,9 @@ void custom_internal_config(struct phy_device *phydev)
                if (env_valid) {
                        /*debug mode use env tx_amp*/
                        setup_amp = tx_amp & (~0x80);
-                       pr_info("debug mode tx_amp = %d\n", setup_amp);
                } else {
                        /* efuse is valid but env not*/
                        setup_amp = efuse_amp;
-                       pr_info("use efuse tx_amp = %d\n", setup_amp);
                }
                /*Enable Analog and DSP register Bank access by*/
                phy_write(phydev, 0x14, 0x0000);