Page 1 of 1

LAN_RUN/RESET from /boot/config.txt

Posted: Wed Jul 08, 2020 8:30 pm
by arahasya
I have successfully setup CM3+ with LAN9512. The only issue remaining is to RESET the lan with gpio

I have GPIO31 connected to LAN_RESET/RUN

Is it possible to set this GPIO for LAN_RUN in /boot/config.txt?

I have tried with this code but not successfully - gpio=31=op,pd

Thanks!

Re: LAN_RUN/RESET from /boot/config.txt

Posted: Wed Jul 08, 2020 9:01 pm
by cleverca22
i think you would do that via dt-blobs.dtb? not entirely sure on the exact details though

Re: LAN_RUN/RESET from /boot/config.txt

Posted: Wed Jul 08, 2020 9:08 pm
by arahasya
having a hard time doing that.
Followed a link and the module refused to start after the new dtb file was loaded.
Had to flash Emmc again

Re: LAN_RUN/RESET from /boot/config.txt

Posted: Thu Jul 09, 2020 1:14 am
by cleverca22
which link did you follow?
if you hook up the uart, and set `uart_2ndstage=1` in config.txt, does it give any errors?

Re: LAN_RUN/RESET from /boot/config.txt

Posted: Thu Jul 09, 2020 6:50 am
by arahasya
When I use a script to manually set GPIO 33 to high before shutdown or reboot it works perfectly. But it does not shutdown when using device tree

Why is the terminationn = "pull_up" not working? If I don't enter polarity = "active_low" the LAN chip doesn't even start

Here is my dt-blob.dts file -

/dts-v1/;


/ {
videocore {

pins_cm3 {

pin_config {

pin@default {
polarity = "active_low";
termination = "pull_down";
startup_state = "inactive";
function = "input";
}; // pin

pin@p31 { function = "output"; termination = "pull_up"; startup_state = "active"; polarity = "active_low";}; // LAN_RUN
pin@p128 { function = "input"; termination = "no_pulling"; polarity = "active_low"; }; // Hotplug
pin@p129 { function = "output"; termination = "no_pulling"; polarity = "active_low"; }; // EMMC_ENABLE_N
}; // pin_config

pin_defines {
pin_define@LAN_RUN {
type = "internal";
number = <31>;
};
}; // pin_defines

}; // pins_cm3

};

};

Re: LAN_RUN/RESET from /boot/config.txt

Posted: Thu Jul 09, 2020 11:45 am
by cleverca22
i'm pretty sure you need to include all of the sdcard and uart pins as well, or the firmware likely wont be able to access the SD/uart

Re: LAN_RUN/RESET from /boot/config.txt

Posted: Thu Jul 09, 2020 1:32 pm
by arahasya
I am using Emmc only

This device tree does boot up my module and I can ssh through ethernet port