From: "Marek Behún" <marek.behun@nic.cz>
To: Tony Dinh <mibodhi@gmail.com>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
Stefan Roese <sr@denx.de>, David Purdy <david.c.purdy@gmail.com>,
Tom Rini <trini@konsulko.com>, Pali Roh_r <pali@kernel.org>
Subject: Re: [PATCH 7/8] arm: kirkwood: Pogoplug-V4 : Add board implementation
Date: Sat, 18 Dec 2021 23:59:13 +0100 [thread overview]
Message-ID: <20211218235913.7c5e30ee@thinkpad> (raw)
In-Reply-To: <20211218042335.5865-8-mibodhi@gmail.com>
> +#if defined(CONFIG_RESET_PHY_R)
> +/* Configure and initialize PHY */
> +void reset_phy(void)
> +{
> + u16 reg;
> + int phyaddr;
> + char *name = "ethernet-controller@72000";
> + char *eth0_path = "/ocp@f1000000/ethernet-controller@72000";
> +
> + if (miiphy_set_current_dev(name))
> + return;
> +
> + phyaddr = fdt_get_phy_addr(eth0_path);
> + if (phyaddr < 0)
> + return;
> +
> + /*
> + * Enable RGMII delay on Tx and Rx for CPU port
> + * Ref: sec 4.7.2 of chip datasheet
> + */
> + miiphy_write(name, phyaddr, MV88E1116_PGADR_REG, 2);
> + miiphy_read(name, phyaddr, MV88E1116_MAC_CTRL_REG, ®);
> + reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL);
> + miiphy_write(name, phyaddr, MV88E1116_MAC_CTRL_REG, reg);
> + miiphy_write(name, phyaddr, MV88E1116_PGADR_REG, 0);
> +
> + /* reset the phy */
> + miiphy_reset(name, phyaddr);
> +
> + printf("88E1116 Initialized on %s\n", name);
> +}
This PHY has a driver in U-Boot, drivers/net/phy/marvell.c,
structure M88E1118_driver.
There the m88e1118_config() method already does one thing of what you
are doing here: enabling rgmii delays. It also sets LED config, but
does not reset the PHY. You can add call to phy_reset() there...
Marek
next prev parent reply other threads:[~2021-12-18 22:59 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-18 4:23 [PATCH 0/8] arm: kirkwood: Add support for Pogoplug V4 Tony Dinh
2021-12-18 4:23 ` [PATCH 1/8] arm: kirkwood: Pogoplug-V4 : Add DTS files Tony Dinh
2021-12-18 16:38 ` Andre Przywara
2021-12-18 22:05 ` Tony Dinh
2021-12-19 0:03 ` Andre Przywara
2021-12-19 1:23 ` Tony Dinh
2021-12-18 4:23 ` [PATCH 2/8] arm: kirkwood: Pogoplug V4 : Add board defconfig file Tony Dinh
2021-12-18 13:17 ` Pali Rohár
2021-12-18 21:41 ` Tony Dinh
2021-12-20 7:18 ` Stefan Roese
2021-12-20 21:09 ` Tony Dinh
2021-12-18 4:23 ` [PATCH 3/8] arm: kirkwood: Pogoplug-V4 : Add Kconfig files Tony Dinh
2021-12-18 4:23 ` [PATCH 4/8] arm: kirkwood: Pogoplug-V4 : Add board include configs file Tony Dinh
2021-12-18 13:12 ` Pali Rohár
2021-12-18 21:27 ` Tony Dinh
2021-12-18 4:23 ` [PATCH 5/8] arm: kirkwood: Pogoplug-V4 : Add board kwbimage file Tony Dinh
2021-12-18 4:23 ` [PATCH 6/8] arm: kirkwood: Pogoplug-V4 : Add board implementation header Tony Dinh
2021-12-18 13:09 ` Pali Rohár
2021-12-18 21:47 ` Tony Dinh
2021-12-20 7:23 ` Stefan Roese
2021-12-20 21:14 ` Tony Dinh
2021-12-18 4:23 ` [PATCH 7/8] arm: kirkwood: Pogoplug-V4 : Add board implementation Tony Dinh
2021-12-18 22:59 ` Marek Behún [this message]
2021-12-18 23:28 ` Tony Dinh
2021-12-18 23:42 ` Marek Behún
2021-12-18 4:23 ` [PATCH 8/8] arm: kirkwood: Pogoplug-V4 : Add board maintainer Tony Dinh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211218235913.7c5e30ee@thinkpad \
--to=marek.behun@nic.cz \
--cc=david.c.purdy@gmail.com \
--cc=mibodhi@gmail.com \
--cc=pali@kernel.org \
--cc=sr@denx.de \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox