Skip to contentSkip to conversation

rainier: Add LEDs that are controlled by ASPEED

PATCH In review [email protected] 4 participants 4 messages Jul 29, 2020 – Aug 13, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 rainier: Add LEDs that are controlled by ASPEED

From: Vishwanatha Subbanna <[email protected]>

These are the LEDs that have direct GPIO connection from ASPEED

---
 arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts +22 -2
index 9b28a30..d1a588f 100644
@@ -124,6 +124,26 @@
 	leds {
 		compatible = "gpio-leds";
 
+		/* BMC Card fault LED at the back */
+		bmc-ingraham0 {
+			gpios = <&gpio0 ASPEED_GPIO(H, 1) GPIO_ACTIVE_LOW>;
+		};
+
+		/* Enclosure ID LED at the back */
+		rear-enc-id0 {
+			gpios = <&gpio0 ASPEED_GPIO(H, 2) GPIO_ACTIVE_LOW>;
+		};
+
+		/* Enclosure fault LED at the back */
+		rear-enc-fault0 {
+			gpios = <&gpio0 ASPEED_GPIO(H, 3) GPIO_ACTIVE_LOW>;
+		};
+
+		/* PCIE slot power LED */
+		pcieslot-power {
+			gpios = <&gpio0 ASPEED_GPIO(P, 4) GPIO_ACTIVE_LOW>;
+		};
+
 		/* System ID LED that is at front on Op Panel */
 		front-sys-id0 {
 			retain-state-shutdown;
@@ -167,7 +187,7 @@
 	/*E0-E7*/	"","","","","","","","",
 	/*F0-F7*/	"","","","","","","","",
 	/*G0-G7*/	"","","","","","","","",
-	/*H0-H7*/	"","","","","","","","",
+	/*H0-H7*/	"","bmc-ingraham0","rear-enc-id0","rear-enc-fault0","","","","",
 	/*I0-I7*/	"","","","","","","","",
 	/*J0-J7*/	"","","","","","","","",
 	/*K0-K7*/	"","","","","","","","",
@@ -175,7 +195,7 @@
 	/*M0-M7*/	"","","","","","","","",
 	/*N0-N7*/	"","","","","","","","",
 	/*O0-O7*/	"","","","usb-power","","","","",
-	/*P0-P7*/	"","","","","","","","",
+	/*P0-P7*/	"","","","","pcieslot-power","","","",
 	/*Q0-Q7*/	"cfam-reset","","","","","","","",
 	/*R0-R7*/	"","","","","","","","",
 	/*S0-S7*/	"presence-ps0","presence-ps1","presence-ps2","presence-ps3",
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 4 lines · On Wed, 29 Jul 2020 at 11:30, <[email protected]> wrote:

From: Vishwanatha Subbanna <[email protected]>

These are the LEDs that have direct GPIO connection from ASPEED

Do you mean directly connected to the BMC, and not via a GPIO expander?

Convetion is to name the patches with a prefix:

ARM: dts: aspeed: rainier: Add directly controlled LEDs

Quoted 39 lines
---
 arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts +20 -0
index 9b28a30..d1a588f 100644
@@ -124,6 +124,26 @@
        leds {
                compatible = "gpio-leds";
 
+               /* BMC Card fault LED at the back */
+               bmc-ingraham0 {
+                       gpios = <&gpio0 ASPEED_GPIO(H, 1) GPIO_ACTIVE_LOW>;
+               };
+
+               /* Enclosure ID LED at the back */
+               rear-enc-id0 {
+                       gpios = <&gpio0 ASPEED_GPIO(H, 2) GPIO_ACTIVE_LOW>;
+               };
+
+               /* Enclosure fault LED at the back */
+               rear-enc-fault0 {
+                       gpios = <&gpio0 ASPEED_GPIO(H, 3) GPIO_ACTIVE_LOW>;
+               };
+
+               /* PCIE slot power LED */
+               pcieslot-power {
+                       gpios = <&gpio0 ASPEED_GPIO(P, 4) GPIO_ACTIVE_LOW>;
+               };
+
                /* System ID LED that is at front on Op Panel */
                front-sys-id0 {
                        retain-state-shutdown;

arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts line 190

Quoted 5 lines
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts +1 -1
@@ -167,7 +187,7 @@
        /*E0-E7*/       "","","","","","","","",
        /*F0-F7*/       "","","","","","","","",
        /*G0-G7*/       "","","","","","","","",
-       /*H0-H7*/       "","","","","","","","",
+       /*H0-H7*/       "","bmc-ingraham0","rear-enc-id0","rear-enc-fault0","","","","",

I think the guideline is to name GPIOs based on their use, so bmc-ingraham0 should be fault-bmc-ingraham0 if we follow the psu presence GPIO convention of function-name.

I think we had some documentation written up on naming conventions.

Brad, do you have any input here?

Quoted 15 lines
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts +1 -2
        /*I0-I7*/       "","","","","","","","",
        /*J0-J7*/       "","","","","","","","",
        /*K0-K7*/       "","","","","","","","",
@@ -175,7 +195,7 @@
        /*M0-M7*/       "","","","","","","","",
        /*N0-N7*/       "","","","","","","","",
        /*O0-O7*/       "","","","usb-power","","","","",
-       /*P0-P7*/       "","","","","","","","",
+       /*P0-P7*/       "","","","","pcieslot-power","","","",
        /*Q0-Q7*/       "cfam-reset","","","","","","","",
        /*R0-R7*/       "","","","","","","","",
        /*S0-S7*/       "presence-ps0","presence-ps1","presence-ps2","presence-ps3",
--

1.8.3.1

#2 lore raw

On 13/08/20, 8:45 AM, "Joel Stanley" <[email protected]> wrote:

On Wed, 29 Jul 2020 at 11:30, <[email protected]> wrote:
>
> From: Vishwanatha Subbanna <[email protected]>
>
> These are the LEDs that have direct GPIO connection from ASPEED

Do you mean directly connected to the BMC, and not via a GPIO expander?

Correct. Directly connected to ASPEED.

Convetion is to name the patches with a prefix:

ARM: dts: aspeed: rainier: Add directly controlled LEDs

I will update

Quoted 39 lines
---
 arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts +20 -0
index 9b28a30..d1a588f 100644
@@ -124,6 +124,26 @@
        leds {
                compatible = "gpio-leds";
 
+               /* BMC Card fault LED at the back */
+               bmc-ingraham0 {
+                       gpios = <&gpio0 ASPEED_GPIO(H, 1) GPIO_ACTIVE_LOW>;
+               };
+
+               /* Enclosure ID LED at the back */
+               rear-enc-id0 {
+                       gpios = <&gpio0 ASPEED_GPIO(H, 2) GPIO_ACTIVE_LOW>;
+               };
+
+               /* Enclosure fault LED at the back */
+               rear-enc-fault0 {
+                       gpios = <&gpio0 ASPEED_GPIO(H, 3) GPIO_ACTIVE_LOW>;
+               };
+
+               /* PCIE slot power LED */
+               pcieslot-power {
+                       gpios = <&gpio0 ASPEED_GPIO(P, 4) GPIO_ACTIVE_LOW>;
+               };
+
                /* System ID LED that is at front on Op Panel */
                front-sys-id0 {
                        retain-state-shutdown;

arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts line 190

Quoted 5 lines
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts +1 -1
@@ -167,7 +187,7 @@
        /*E0-E7*/       "","","","","","","","",
        /*F0-F7*/       "","","","","","","","",
        /*G0-G7*/       "","","","","","","","",
-       /*H0-H7*/       "","","","","","","","",
+       /*H0-H7*/       "","bmc-ingraham0","rear-enc-id0","rear-enc-fault0","","","","",

I think the guideline is to name GPIOs based on their use, so bmc-ingraham0 should be fault-bmc-ingraham0 if we follow the psu presence GPIO convention of function-name.

This LED is used for Identification and Fault as well.

    I think we had some documentation written up on naming conventions.

    Brad, do you have any input here?

    >         /*I0-I7*/       "","","","","","","","",
    >         /*J0-J7*/       "","","","","","","","",
    >         /*K0-K7*/       "","","","","","","","",
    > @@ -175,7 +195,7 @@
    >         /*M0-M7*/       "","","","","","","","",
    >         /*N0-N7*/       "","","","","","","","",
    >         /*O0-O7*/       "","","","usb-power","","","","",
    > -       /*P0-P7*/       "","","","","","","","",
    > +       /*P0-P7*/       "","","","","pcieslot-power","","","",
    >         /*Q0-Q7*/       "cfam-reset","","","","","","","",
    >         /*R0-R7*/       "","","","","","","","",
    >         /*S0-S7*/       "presence-ps0","presence-ps1","presence-ps2","presence-ps3",
    > --
    > 1.8.3.1
    >
#3 lore raw
In reply to Joel Stanley
Quoted 62 lines · Joel Stanley
Quoted 4 lines · On Wed, 29 Jul 2020 at 11:30, <[email protected]> wrote:

From: Vishwanatha Subbanna <[email protected]>

These are the LEDs that have direct GPIO connection from ASPEED

Do you mean directly connected to the BMC, and not via a GPIO expander?

Convetion is to name the patches with a prefix:

ARM: dts: aspeed: rainier: Add directly controlled LEDs

Quoted 39 lines
---
  arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts | 24 ++++++++++++++++++++++--
  1 file changed, 22 insertions(+), 2 deletions(-)
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts +20 -0
index 9b28a30..d1a588f 100644
@@ -124,6 +124,26 @@
         leds {
                 compatible = "gpio-leds";
 
+               /* BMC Card fault LED at the back */
+               bmc-ingraham0 {
+                       gpios = <&gpio0 ASPEED_GPIO(H, 1) GPIO_ACTIVE_LOW>;
+               };
+
+               /* Enclosure ID LED at the back */
+               rear-enc-id0 {
+                       gpios = <&gpio0 ASPEED_GPIO(H, 2) GPIO_ACTIVE_LOW>;
+               };
+
+               /* Enclosure fault LED at the back */
+               rear-enc-fault0 {
+                       gpios = <&gpio0 ASPEED_GPIO(H, 3) GPIO_ACTIVE_LOW>;
+               };
+
+               /* PCIE slot power LED */
+               pcieslot-power {
+                       gpios = <&gpio0 ASPEED_GPIO(P, 4) GPIO_ACTIVE_LOW>;
+               };
+
                 /* System ID LED that is at front on Op Panel */
                 front-sys-id0 {
                         retain-state-shutdown;

arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts line 190

Quoted 5 lines
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts +1 -1
@@ -167,7 +187,7 @@
         /*E0-E7*/       "","","","","","","","",
         /*F0-F7*/       "","","","","","","","",
         /*G0-G7*/       "","","","","","","","",
-       /*H0-H7*/       "","","","","","","","",
+       /*H0-H7*/       "","bmc-ingraham0","rear-enc-id0","rear-enc-fault0","","","","",

I think the guideline is to name GPIOs based on their use, so bmc-ingraham0 should be fault-bmc-ingraham0 if we follow the psu presence GPIO convention of function-name.

Quoted 1 line

I think we had some documentation written up on naming conventions.

There is https://github.com/openbmc/docs/blob/master/designs/device-tree-gpio-naming.md.

Regards,
Deepak