ramips: mt7620: use DTS to set PHY base address for external PHYs
authorMichael Pratt <mcpratt@pm.me>
Sat, 3 Apr 2021 18:42:51 +0000 (14:42 -0400)
committerChuanhong Guo <gch981213@gmail.com>
Wed, 23 Jun 2021 06:22:18 +0000 (14:22 +0800)
commit0976b6c4262a11a8d0dab9aeb64f5cdee266c44a
tree87b1b5830ce2614e04e34d5301bf462e123e416e
parentde5394a29dae9356a830d043e76591698411e97a
ramips: mt7620: use DTS to set PHY base address for external PHYs

Set the PHY base address to 12 for mt7530 and 8 for others,
which is based on the default setting for some devices
from printing the register with the following command
after it is written to by uboot during the boot cycle.

`md 0x10117014 1`

PHY_BASE option only uses 5 bits of the register,
bits 16 to 20, so use 8-bit integer type.

Set the option using the DTS property mediatek,ephy-base
and create the gsw node if missing.

Also, added a kernel message to display the EPHY base address.

Note:
If anything is written to a PHY address that is greater than 1 hex char (greater than 0xf)
then there is adverse effects with Atheros switches.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
24 files changed:
target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts
target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts
target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts
target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts
target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts
target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi
target/linux/ramips/dts/mt7620a_engenius_esr600.dts
target/linux/ramips/dts/mt7620a_fon_fon2601.dts
target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts
target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts
target/linux/ramips/dts/mt7620a_iptime_a1004ns.dts
target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts
target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts
target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts
target/linux/ramips/dts/mt7620a_linksys_e1700.dts
target/linux/ramips/dts/mt7620a_netis_wf2770.dts
target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts
target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts
target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts
target/linux/ramips/dts/mt7620a_sercomm_na930.dts
target/linux/ramips/dts/mt7620a_tplink_re210-v1.dts
target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts
target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts
target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c