diff mbox

[OpenWrt-Devel,3/3] ramips: Disable all ethernet ports except port 4 on HT-TM02.

Message ID owrt-patch-20151205-3@vittgam.net
State Superseded, archived
Headers show

Commit Message

Vittorio Gambaletta Dec. 5, 2015, 11:04 a.m. UTC
Port 4 is the only ethernet port on this router, so disable all other PHYs
in order to save power.

Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>

---

Comments

John Crispin Dec. 11, 2015, 11:29 a.m. UTC | #1
On 05/12/2015 12:04, Vittorio G (VittGam) wrote:
> Port 4 is the only ethernet port on this router, so disable all other PHYs
> in order to save power.
> 
> Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
> 
> ---
> 
> --- a/target/linux/ramips/dts/HT-TM02.dts
> +++ b/target/linux/ramips/dts/HT-TM02.dts
> @@ -63,6 +63,7 @@
>  
>  	esw@10110000 {
>  		ralink,portmap = <0x10>;
> +		ralink,portdisable = <0x2f>;
>  	};

i think it makes more sense to derive 0x2f from the 0x10 as both
together will always be 0x3f

	John

>  
>  	wmac@10180000 {
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
Vittorio Gambaletta Dec. 11, 2015, 1:55 p.m. UTC | #2
Hi,

On 11/12/2015 12:29:00 CET, John Crispin wrote:
> On 05/12/2015 12:04, Vittorio G (VittGam) wrote:
>>  	esw@10110000 {
>>  		ralink,portmap = <0x10>;
>> +		ralink,portdisable = <0x2f>;
>>  	};
>
> i think it makes more sense to derive 0x2f from the 0x10 as both
> together will always be 0x3f

No, it does not.

Portmap selects which ports are LAN ports and which are WAN ports.
Here the only port (4) is selected as LAN.

Portdisable instead selects which port we need to power down in order
to save power. In this case, every port except 4 is selected because
4 is the only port.

The fact that for this router the combination is 0x3f is just a
coincidence.

Cheers,
Vittorio G
diff mbox

Patch

--- a/target/linux/ramips/dts/HT-TM02.dts
+++ b/target/linux/ramips/dts/HT-TM02.dts
@@ -63,6 +63,7 @@ 
 
 	esw@10110000 {
 		ralink,portmap = <0x10>;
+		ralink,portdisable = <0x2f>;
 	};
 
 	wmac@10180000 {