@@ -512,6 +512,27 @@ static int rtl838x_dbgfs_port_init(struct dentry *parent, struct rtl838x_switch_
512
512
return 0 ;
513
513
}
514
514
515
+ static int rtl930x_dbgfs_port_init (struct dentry * parent , struct rtl838x_switch_priv * priv ,
516
+ int port )
517
+ {
518
+ struct dentry * port_dir ;
519
+ //struct debugfs_regset32 *port_ctrl_regset;
520
+
521
+ port_dir = debugfs_create_dir (priv -> ports [port ].dp -> name , parent );
522
+
523
+ debugfs_create_u32 ("id" , 0444 , port_dir , (u32 * )& priv -> ports [port ].dp -> index );
524
+
525
+ debugfs_create_x32 ("PB_VLAN" ,0666 ,port_dir ,(void * )(RTL838X_SW_BASE + RTL930X_VLAN_PORT_PB_VLAN + (port <<2 ))); //VLAN_PORT_PB_VLAN
526
+ debugfs_create_x32 ("FWD_CTRL" ,0666 ,port_dir ,(void * )(RTL838X_SW_BASE + RTL930X_VLAN_PORT_FWD + (port <<2 )));
527
+ debugfs_create_x32 ("TAG_STS_CTRL" ,0666 ,port_dir ,(void * )(RTL838X_SW_BASE + 0xCE24 + (port <<2 ))); //VLAN_PORT_TAG_STS_CTRL
528
+
529
+ debugfs_create_x32 ("LED_SW_CTRL" ,0666 ,port_dir ,(void * )(RTL838X_SW_BASE + 0xcc5c + (port <<2 ))); //LED_PORT_SW_CTRL
530
+
531
+ debugfs_create_x32 ("SFLOW_RATE_CTRL" ,0666 ,port_dir ,(void * )(RTL838X_SW_BASE + 0xbea4 + (port <<2 ))); //SFLOW_PORT_RATE_CTRL
532
+
533
+ return 0 ;
534
+ }
535
+
515
536
static int rtl838x_dbgfs_leds (struct dentry * parent , struct rtl838x_switch_priv * priv )
516
537
{
517
538
struct dentry * led_dir ;
@@ -588,6 +609,26 @@ static int rtl838x_dbgfs_leds(struct dentry *parent, struct rtl838x_switch_priv
588
609
return 0 ;
589
610
}
590
611
612
+ static int rtl930x_dbgfs_leds (struct dentry * parent , struct rtl838x_switch_priv * priv )
613
+ {
614
+ struct dentry * led_dir ;
615
+ pr_info ("%s called\n" , __func__ );
616
+ led_dir = debugfs_create_dir ("LED" , parent );
617
+ pr_info ("%s create dir %p\n" , __func__ ,led_dir );
618
+
619
+ debugfs_create_x32 ("SW_LED_LOAD" ,0666 ,led_dir ,(void * )(RTL838X_SW_BASE + 0xcc48 )); //SW_LED_LOAD //Write 1 to this field to apply new settings for software controlled LEDs. Auto clears when finished.
620
+
621
+ debugfs_create_x32 ("LED_SW_EN_CTRL_1-8" , 0666 ,led_dir ,(void * )(RTL838X_SW_BASE + 0xcc4c )); //LED_PORT_SW_EN_CTRL
622
+ debugfs_create_x32 ("LED_SW_EN_CTRL_24-27" ,0666 ,led_dir ,(void * )(RTL838X_SW_BASE + 0xcc4c + 12 )); //LED_PORT_SW_EN_CTRL
623
+
624
+ debugfs_create_x64 ("LED_SET3_CTRL" ,0666 ,led_dir ,(void * )(RTL838X_SW_BASE + 0xcc0c )); //LED_SET3_1_CTRL
625
+ debugfs_create_x64 ("LED_SET2_CTRL" ,0666 ,led_dir ,(void * )(RTL838X_SW_BASE + 0xcc14 )); //LED_SET2_1_CTRL
626
+ debugfs_create_x64 ("LED_SET1_CTRL" ,0666 ,led_dir ,(void * )(RTL838X_SW_BASE + 0xcc1c )); //LED_SET1_1_CTRL
627
+ debugfs_create_x64 ("LED_SET0_CTRL" ,0666 ,led_dir ,(void * )(RTL838X_SW_BASE + 0xcc24 )); //LED_SET0_1_CTRL
628
+
629
+ return 0 ;
630
+ }
631
+
591
632
void rtl838x_dbgfs_init (struct rtl838x_switch_priv * priv )
592
633
{
593
634
struct dentry * rtl838x_dir ;
@@ -726,4 +767,19 @@ void rtl930x_dbgfs_init(struct rtl838x_switch_priv *priv)
726
767
debugfs_create_file ("drop_counters" , 0400 , dbg_dir , priv , & drop_counter_fops );
727
768
728
769
debugfs_create_file ("l2_table" , 0400 , dbg_dir , priv , & l2_table_fops );
770
+
771
+ debugfs_create_x32 ("BPDU_CTRL_1-8" ,0666 ,dbg_dir ,(void * )(RTL838X_SW_BASE + 0x9e7c )); //RMA_PORT_BPDU_CTRL
772
+ debugfs_create_x32 ("LLDP_CTRL_1-8" ,0666 ,dbg_dir ,(void * )(RTL838X_SW_BASE + 0x9efc )); //RMA_PORT_LLDP_CTRL
773
+
774
+ debugfs_create_x32 ("SFLOW_CTRL" ,0666 ,dbg_dir ,(void * )(RTL838X_SW_BASE + 0xbea0 )); //SFLOW_CTRL
775
+
776
+ rtl930x_dbgfs_leds (dbg_dir , priv );
777
+
778
+ /* Create one directory per port */
779
+ for (int i = 0 ; i < priv -> cpu_port ; i ++ ) {
780
+ if (priv -> ports [i ].phy ) {
781
+ rtl930x_dbgfs_port_init (dbg_dir , priv , i );
782
+ }
783
+ }
784
+
729
785
}
0 commit comments