From: Andrew Lunn <andrew@lunn.ch>
To: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
Cc: Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Russell King <linux@armlinux.org.uk>, Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
Jon Mason <jonmason@broadcom.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Kishon Vijay Abraham I <kishon@ti.com>,
bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/6] net: mdio-mux: Add MDIO mux driver for NSP SoC
Date: Wed, 9 Nov 2016 15:45:15 +0100 [thread overview]
Message-ID: <20161109144515.GF15386@lunn.ch> (raw)
In-Reply-To: <1478683994-12008-4-git-send-email-yendapally.reddy@broadcom.com>
> +#define NSP_MDIO_EXT_BUS_START_ADDR 16
> +#define NSP_MDIO_EXT_SELECT_BIT BIT(9)
> +
> +static int mdio_mux_nsp_switch_fn(int current_child, int desired_child,
> + void *priv)
> +{
> + struct nsp_mdiomux_desc *md = priv;
> + u32 data, bus_id;
> +
> + /* select internal or external bus */
> + data = readl(md->mgmt_ctrl);
> + if (desired_child == NSP_MDIO_EXT_BUS_START_ADDR)
> + data |= NSP_MDIO_EXT_SELECT_BIT;
> + else
> + data &= ~NSP_MDIO_EXT_SELECT_BIT;
> + writel(data, md->mgmt_ctrl);
> +
> + /* select bus number */
> + if (md->bus_ctrl) {
> + bus_id = desired_child & (NSP_MDIO_EXT_BUS_START_ADDR - 1);
> + writel(bus_id, md->bus_ctrl);
> + }
> +
> + return 0;
So address 16 is external. What happens which you try to access
address 16 internally? Does the chip raise an abort? Reads just give
0xffff?
I'm wondering if it would be better to implement this as two nested
muxes. One mux doing internal/external, and the other doing the bus.
If you do that, you can use the existing mdio-mux-mmioreg.c and don't
need any new code at all.
Andrew
next prev parent reply other threads:[~2016-11-09 14:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-09 9:33 [PATCH 0/6] USB support for Broadcom NSP SoC Yendapally Reddy Dhananjaya Reddy
2016-11-09 9:33 ` [PATCH 1/6] dt-bindings: mdio-mux: Add documentation for mdio mux for " Yendapally Reddy Dhananjaya Reddy
2016-11-09 14:34 ` Andrew Lunn
2016-11-09 22:23 ` Scott Branden
[not found] ` <1478683994-12008-2-git-send-email-yendapally.reddy-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-11-14 17:22 ` Rob Herring
2016-11-09 9:33 ` [PATCH 2/6] dt-bindings: phy: Add documentation for NSP USB3 PHY Yendapally Reddy Dhananjaya Reddy
2016-11-14 17:23 ` Rob Herring
2016-11-09 9:33 ` [PATCH 3/6] net: mdio-mux: Add MDIO mux driver for NSP SoC Yendapally Reddy Dhananjaya Reddy
2016-11-09 14:45 ` Andrew Lunn [this message]
2016-11-09 9:33 ` [PATCH 4/6] net: phy: Initialize mdio clock at probe function Yendapally Reddy Dhananjaya Reddy
2016-11-09 9:33 ` [PATCH 5/6] phy: Add USB3 PHY support for Broadcom NSP SoC Yendapally Reddy Dhananjaya Reddy
2016-11-09 9:33 ` [PATCH 6/6] arm: dts: nsp: Add USB nodes to device tree Yendapally Reddy Dhananjaya Reddy
2016-12-13 2:20 ` [PATCH 0/6] USB support for Broadcom NSP SoC Florian Fainelli
2017-01-16 9:17 ` Kishon Vijay Abraham I
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=20161109144515.GF15386@lunn.ch \
--to=andrew@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=jonmason@broadcom.com \
--cc=kishon@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mark.rutland@arm.com \
--cc=netdev@vger.kernel.org \
--cc=rjui@broadcom.com \
--cc=robh+dt@kernel.org \
--cc=sbranden@broadcom.com \
--cc=yendapally.reddy@broadcom.com \
/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;
as well as URLs for NNTP newsgroup(s).