Hi Frank,

Where exactly do I need to put this code in the device tree?

I tried adding this code in am33xx.dtsi, but my GPIO is not getting 
triggered. It looks like this:

mac: ethernet@4a100000 {
compatible = "ti,am335x-cpsw","ti,cpsw";
ti,hwmods = "cpgmac0";
clocks = <&cpsw_125mhz_gclk>, <&cpsw_cpts_rft_clk>;
clock-names = "fck", "cpts";
cpdma_channels = <8>;
ale_entries = <1024>;
bd_ram_size = <0x2000>;
mac_control = <0x20>;
slaves = <2>;
active_slave = <0>;
cpts_clock_mult = <0x80000000>;
cpts_clock_shift = <29>;
reg = <0x4a100000 0x800
       0x4a101200 0x100>;
#address-cells = <1>;
#size-cells = <1>;
/*
* c0_rx_thresh_pend
* c0_rx_pend
* c0_tx_pend
* c0_misc_pend
*/
interrupts = <40 41 42 43>;
ranges;
syscon = <&scm_conf>;
status = "disabled";

davinci_mdio: mdio@4a101000 {
compatible = "ti,cpsw-mdio","ti,davinci_mdio";
#address-cells = <1>;
#size-cells = <0>;
ti,hwmods = "davinci_mdio";
bus_freq = <1000000>;
reg = <0x4a101000 0x100>;

status = "disabled";
};
*&davinci_mdio { *
* pinctrl-names = "default", "sleep"; *
* pinctrl-0 = <&davinci_mdio_default>; *
* pinctrl-1 = <&davinci_mdio_sleep>; *
* status = "okay"; *

* reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; *
* reset-delay-us = <100>; *
* ethphy0: @cpsw_emac0 {}; *
* };*

cpsw_emac0: slave@4a100200 {
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
};

cpsw_emac1: slave@4a100300 {
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
};

phy_sel: cpsw-phy-sel@44e10650 {
compatible = "ti,am3352-cpsw-phy-sel";
reg= <0x44e10650 0x4>;
reg-names = "gmii-sel";
};
};

Thank you,
Samer

On Tuesday, August 7, 2018 at 9:28:45 PM UTC-6, Frank Hunleth wrote:
>
> On Tue, Aug 7, 2018 at 8:29 PM <[email protected] <javascript:>> wrote: 
> > 
> > So I cut the trace for reset pin on Lan8710 and jumpered a wire to a 
> gpio pin. And I added the reset gpio/reset-delay-us as shown in this link: 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/mdio.txt
>  
> > 
> > I added following commands in am335x.dtsi on line 1057 
> > 
> > reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; 
> > reset-delay-us = <100>; 
> > 
>
> I had a similar problem. I believe that you need to specify the phy as 
> a child node to trigger the reset GPIO logic in the mdio driver. 
> Here's the relevant section of my device tree: 
>
> &davinci_mdio { 
>         pinctrl-names = "default", "sleep"; 
>         pinctrl-0 = <&davinci_mdio_default>; 
>         pinctrl-1 = <&davinci_mdio_sleep>; 
>         status = "okay"; 
>
>         reset-gpios = <&gpio3 21 GPIO_ACTIVE_LOW>; 
>         reset-delay-us = <100>; 
>         ethphy0: @cpsw_emac0 {}; 
> }; 
>
> I've only done some quick tests, but it appears to be working. 
>
> -Frank 
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/e4c0d040-4f9c-4a6b-bb13-90c809a52f04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to