
On Tue, Jun 18, 2019 at 10:58 PM Alexandru Marginean alexandru.marginean@nxp.com wrote:
Adds a test using a makeshift MDIO MUX. The test is based on the existing MDIO test. It uses the last emulated PHY register to verify MUX selection.
Signed-off-by: Alex Marginean alexm.osslist@gmail.com
Changes in v2: - no change Changes in v3: - no change, just fighting with the email server
arch/Kconfig | 1 + arch/sandbox/dts/test.dts | 21 +++++++- drivers/net/Kconfig | 10 ++++ drivers/net/Makefile | 1 + drivers/net/mdio_mux_sandbox.c | 97 ++++++++++++++++++++++++++++++++++ test/dm/Makefile | 1 + test/dm/mdio_mux.c | 80 ++++++++++++++++++++++++++++ 7 files changed, 210 insertions(+), 1 deletion(-) create mode 100644 drivers/net/mdio_mux_sandbox.c create mode 100644 test/dm/mdio_mux.c
diff --git a/arch/Kconfig b/arch/Kconfig index 1e62a7615d..1a0f1ab8a7 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -122,6 +122,7 @@ config SANDBOX imply PCH imply PHYLIB imply DM_MDIO
imply DM_MDIO_MUX
config SH bool "SuperH architecture" diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index dd50a951a8..a05e437abf 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -808,7 +808,26 @@ dma-names = "m2m", "tx0", "rx0"; };
mdio-test {
/*
* keep mdio-mux ahead of mdio, u-boot doesn't do reference count on
nits: U-Boot
* these devices and we don't want mdio-parent-bus to be released before
* the mux.
I did not get it why there is a ordering issue? Could you please elaborate?
*/
mdio-mux-test {
compatible = "sandbox,mdio-mux";
#address-cells = <1>;
#size-cells = <0>;
mdio-parent-bus = <&mdio>;
mdio-ch-test@0 {
reg = <0>;
};
mdio-ch-test@1 {
reg = <1>;
};
};
Test codes looks good to me though.
Regards, Bin