widora BIT3 更新源码后 WLED/P0_LED等LED无法控制



  • 更新openwrt源码后,WLED_N、P0_LED无法控制,通过reg命令读取WLED
    root@Widora:/etc# reg r 0x10000064
    add:0x10000064 = 0x550
    网寄存器里面写0x552,WLED电平没有反应。

    P1_LED到P4_LED可以控制。


  • administrators

    @edward 你丢了一步,忘了设置GPIO的DIR和DATA



  • 新的源码中,WLED_N、P0_LED的IO口有作为他用吗?



  • 设备树文件是这样配置的。

         pinctrl {
    	state_default: pinctrl0 {
    
    		gpio {
    			ralink,group = "gpio";
    			ralink,function = "gpio";
    		};
    
    		perst {
    			ralink,group = "perst";
    			ralink,function = "gpio";
    		};
    
    		refclk {
    			ralink,group = "refclk";
    			ralink,function = "gpio";
    		};
    
    		i2s {
    			ralink,group = "i2s";
    			ralink,function = "gpio";
    		};
    
    		spis {
    			ralink,group = "spis";
    			ralink,function = "gpio";
    		};
    		
    		wled_an {
    			ralink,group = "wled_an";
    			ralink,function = "gpio";
    		};
    	
    		ephy_p0{
    			ralink,group = "ephy_p0";
    			ralink,function = "gpio";
    		};
    		ephy_p1 {
    			ralink,group = "ephy_p1";
    			ralink,function = "gpio";
    		};
    		ephy_p2 {
    			ralink,group = "ephy_p2";
    			ralink,function = "gpio";
    		};
    		ephy_p3 {
    			ralink,group = "ephy_p3";
    			ralink,function = "gpio";
    		};
    		ephy_p4 {
    			ralink,group = "ephy_p4";
    			ralink,function = "gpio";
    		};
    		wdt {
    			ralink,group = "wdt";
    			ralink,function = "gpio";
    		};
    	};
    };
      
     gpio-leds {
    
    	compatible = "gpio-leds";
    
    	sys {
    		label = "mediatek:orange:sys";
    		gpios = <&gpio1 9 0>;
    		default-state = "on";
    	};
    
    	wifi {
    		label = "mediatek:orange:wifi";
    		gpios = <&gpio1 12 1>;
    		default-state = "on";
    	};
    
    	wan {
    		label = "mediatek:orange:wan";
    		gpios = <&gpio1 11 0>;
    		default-state = "off";
    	};
    
    	lan1 {
    		label = "mediatek:orange:lan";
    		gpios = <&gpio1 8 0>;
    		default-state = "off";
    	};
    };

  • administrators

    @edward 我们这边的源码中,WLED和LINK0一只是把GPIO_MODE寄存器调整到PHY的那边,所以看到的闪烁灯都是PHY直驱的,不是openwrt系统驱动的。
    你的这个dts的调整,相当于注册成gpio来主动驱动,估计你要实用net-trig包来驱动。


Log in to reply