[source] brcm63xx: setup internal switch leds for bcm6368

LEDE Commits lede-commits at lists.infradead.org
Thu Feb 9 05:31:23 PST 2017


jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/31d5c5bc90512cc9f06a9a916f9922782483acc3

commit 31d5c5bc90512cc9f06a9a916f9922782483acc3
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Wed Feb 1 12:58:22 2017 +0100

    brcm63xx: setup internal switch leds for bcm6368
    
    Setup the GPIO_MODE register bits for used internal switch port leds.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 target/linux/brcm63xx/dts/hg655b.dts               | 16 -------------
 target/linux/brcm63xx/dts/vr-3025u.dts             | 16 -------------
 target/linux/brcm63xx/dts/vr-3025un.dts            | 16 -------------
 target/linux/brcm63xx/dts/vr-3026e.dts             | 16 -------------
 ...tup-pinctrl-for-internal-switch-leds-on-b.patch | 27 ++++++++++++++++++++++
 .../403-6358-enet1-external-mii-clk.patch          |  2 +-
 ...-allow-providing-fixup-data-in-board-data.patch |  4 ++--
 ...8-MIPS-BCM63XX-pass-caldata-info-to-flash.patch |  2 +-
 .../420-BCM63XX-add-endian-check-for-ath9k.patch   |  2 +-
 .../421-BCM63XX-add-led-pin-for-ath9k.patch        |  2 +-
 ...22-BCM63XX-add-a-fixup-for-rt2x00-devices.patch |  2 +-
 11 files changed, 34 insertions(+), 71 deletions(-)

diff --git a/target/linux/brcm63xx/dts/hg655b.dts b/target/linux/brcm63xx/dts/hg655b.dts
index 7f4a7ca..58ef715 100644
--- a/target/linux/brcm63xx/dts/hg655b.dts
+++ b/target/linux/brcm63xx/dts/hg655b.dts
@@ -47,22 +47,6 @@
 			label = "HW65x:green:internet";
 			gpios = <&gpio0 5 1>;
 		};
-		lan1_green {
-			label = "HW65x:green:lan1";
-			gpios = <&gpio0 6 1>;
-		};
-		lan2_green {
-			label = "HW65x:green:lan2";
-			gpios = <&gpio0 7 1>;
-		};
-		lan3_green {
-			label = "HW65x:green:lan3";
-			gpios = <&gpio0 8 1>;
-		};
-		lan4_green {
-			label = "HW65x:green:lan4";
-			gpios = <&gpio0 9 1>;
-		};
 		usb_green {
 			label = "HW65x:green:usb";
 			gpios = <&gpio0 14 1>;
diff --git a/target/linux/brcm63xx/dts/vr-3025u.dts b/target/linux/brcm63xx/dts/vr-3025u.dts
index 7b37fad..63b1427 100644
--- a/target/linux/brcm63xx/dts/vr-3025u.dts
+++ b/target/linux/brcm63xx/dts/vr-3025u.dts
@@ -37,22 +37,6 @@
 			label = "VR-3025u:green:inet";
 			gpios = <&gpio0 5 0>;
 		};
-		lan1_green {
-			label = "VR-3025u:green:lan1";
-			gpios = <&gpio0 6 1>;
-		};
-		lan2_green {
-			label = "VR-3025u:green:lan2";
-			gpios = <&gpio0 7 1>;
-		};
-		lan3_green {
-			label = "VR-3025u:green:lan3";
-			gpios = <&gpio0 8 1>;
-		};
-		lan4_green {
-			label = "VR-3025u:green:lan4";
-			gpios = <&gpio0 9 1>;
-		};
 		power_green {
 			label = "VR-3025u:green:power";
 			gpios = <&gpio0 22 0>;
diff --git a/target/linux/brcm63xx/dts/vr-3025un.dts b/target/linux/brcm63xx/dts/vr-3025un.dts
index 9c7e0dc..864eb82 100644
--- a/target/linux/brcm63xx/dts/vr-3025un.dts
+++ b/target/linux/brcm63xx/dts/vr-3025un.dts
@@ -37,22 +37,6 @@
 			label = "VR-3025un:green:inet";
 			gpios = <&gpio0 5 0>;
 		};
-		lan1_green {
-			label = "VR-3025un:green:lan1";
-			gpios = <&gpio0 6 1>;
-		};
-		lan2_green {
-			label = "VR-3025un:green:lan2";
-			gpios = <&gpio0 7 1>;
-		};
-		lan3_green {
-			label = "VR-3025un:green:lan3";
-			gpios = <&gpio0 8 1>;
-		};
-		iptv_green {
-			label = "VR-3025un:green:iptv";
-			gpios = <&gpio0 9 1>;
-		};
 		power_green {
 			label = "VR-3025un:green:power";
 			gpios = <&gpio0 22 0>;
diff --git a/target/linux/brcm63xx/dts/vr-3026e.dts b/target/linux/brcm63xx/dts/vr-3026e.dts
index 5ecfdfd..eecbf56 100644
--- a/target/linux/brcm63xx/dts/vr-3026e.dts
+++ b/target/linux/brcm63xx/dts/vr-3026e.dts
@@ -37,22 +37,6 @@
 			label = "VR-3026e:green:inet";
 			gpios = <&gpio0 5 0>;
 		};
-		lan1_green {
-			label = "VR-3026e:green:lan1";
-			gpios = <&gpio0 6 1>;
-		};
-		lan2_green {
-			label = "VR-3026e:green:lan2";
-			gpios = <&gpio0 7 1>;
-		};
-		lan3_green {
-			label = "VR-3026e:green:lan3";
-			gpios = <&gpio0 8 1>;
-		};
-		lan4_green {
-			label = "VR-3026e:green:lan4";
-			gpios = <&gpio0 9 1>;
-		};
 		power_green {
 			label = "VR-3026e:green:power";
 			gpios = <&gpio0 22 0>;
diff --git a/target/linux/brcm63xx/patches-4.4/382-brcm63xx-setup-pinctrl-for-internal-switch-leds-on-b.patch b/target/linux/brcm63xx/patches-4.4/382-brcm63xx-setup-pinctrl-for-internal-switch-leds-on-b.patch
new file mode 100644
index 0000000..83e1ddc
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.4/382-brcm63xx-setup-pinctrl-for-internal-switch-leds-on-b.patch
@@ -0,0 +1,27 @@
+From 8940437e017d446d61a035e847c2a1d7a57a4354 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski at gmail.com>
+Date: Wed, 1 Feb 2017 12:17:13 +0100
+Subject: [PATCH] brcm63xx: setup pinctrl for internal switch leds on bcm6368
+
+---
+ arch/mips/bcm63xx/boards/board_common.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/arch/mips/bcm63xx/boards/board_common.c
++++ b/arch/mips/bcm63xx/boards/board_common.c
+@@ -104,6 +104,15 @@ void __init board_early_setup(const stru
+ 				GPIO_MODE_6348_G0_EXT_MII;
+ 	}
+ 
++	if (BCMCPU_IS_6368() && board.has_enetsw) {
++		int i;
++
++		for (i = 0; i < 4; i++) {
++			if (board.enetsw.used_ports[i].used)
++				val |= (GPIO_MODE_6368_EPHY0_LED << i);
++		}
++	}
++
+ 	bcm_gpio_writel(val, GPIO_MODE_REG);
+ 
+ #if IS_ENABLED(CONFIG_USB)
diff --git a/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch b/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch
index 9699cf3..206fc3f 100644
--- a/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch
+++ b/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch
@@ -8,7 +8,7 @@
 +			val |= GPIO_MODE_6358_ENET1_MII_CLK_INV;
  	}
  
- 	bcm_gpio_writel(val, GPIO_MODE_REG);
+ 	if (BCMCPU_IS_6368() && board.has_enetsw) {
 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
 @@ -651,6 +651,8 @@
diff --git a/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch b/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch
index ab44dc4..2d31f42 100644
--- a/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch
+++ b/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch
@@ -18,7 +18,7 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data
  
  #include "board_common.h"
  
-@@ -182,6 +183,7 @@ static struct of_device_id of_ids[] = {
+@@ -191,6 +192,7 @@ static struct of_device_id of_ids[] = {
  int __init board_register_devices(void)
  {
  	int usbh_ports = 0;
@@ -26,7 +26,7 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data
  
  #if CONFIG_OF
  	if (of_have_populated_dt()) {
-@@ -265,6 +267,10 @@ int __init board_register_devices(void)
+@@ -274,6 +276,10 @@ int __init board_register_devices(void)
  					board.ephy_reset_gpio_flags);
  	}
  
diff --git a/target/linux/brcm63xx/patches-4.4/418-MIPS-BCM63XX-pass-caldata-info-to-flash.patch b/target/linux/brcm63xx/patches-4.4/418-MIPS-BCM63XX-pass-caldata-info-to-flash.patch
index b393198..a0b2bdc 100644
--- a/target/linux/brcm63xx/patches-4.4/418-MIPS-BCM63XX-pass-caldata-info-to-flash.patch
+++ b/target/linux/brcm63xx/patches-4.4/418-MIPS-BCM63XX-pass-caldata-info-to-flash.patch
@@ -11,7 +11,7 @@ Subject: [PATCH 69/80] MIPS: BCM63XX: pass caldata info to flash
 
 --- a/arch/mips/bcm63xx/boards/board_common.c
 +++ b/arch/mips/bcm63xx/boards/board_common.c
-@@ -255,7 +255,7 @@ int __init board_register_devices(void)
+@@ -264,7 +264,7 @@ int __init board_register_devices(void)
  	if (board.num_spis)
  		spi_register_board_info(board.spis, board.num_spis);
  
diff --git a/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch b/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch
index fd5cbfb..6473c4d 100644
--- a/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch
+++ b/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch
@@ -39,7 +39,7 @@
  		return;
 --- a/arch/mips/bcm63xx/boards/board_common.c
 +++ b/arch/mips/bcm63xx/boards/board_common.c
-@@ -269,7 +269,8 @@ int __init board_register_devices(void)
+@@ -278,7 +278,8 @@ int __init board_register_devices(void)
  
  	/* register any fixups */
  	for (i = 0; i < board.has_caldata; i++)
diff --git a/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch b/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch
index c18d8db..d3d16a1 100644
--- a/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch
+++ b/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/boards/board_common.c
 +++ b/arch/mips/bcm63xx/boards/board_common.c
-@@ -270,7 +270,7 @@ int __init board_register_devices(void)
+@@ -279,7 +279,7 @@ int __init board_register_devices(void)
  	/* register any fixups */
  	for (i = 0; i < board.has_caldata; i++)
  		pci_enable_ath9k_fixup(board.caldata[i].slot, board.caldata[i].caldata_offset,
diff --git a/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch b/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch
index cdbecfd..2d4bb40 100644
--- a/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch
+++ b/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch
@@ -36,7 +36,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices
  
  #include "board_common.h"
  
-@@ -268,9 +269,19 @@ int __init board_register_devices(void)
+@@ -277,9 +278,19 @@ int __init board_register_devices(void)
  	}
  
  	/* register any fixups */



More information about the lede-commits mailing list