Skip to contentSkip to conversation

x86: tangier: acpi: Create buffers outside of the methods

PATCH New Andy Shevchenko 2 participants 12 messages May 28, 2020 – Jun 1, 2020 x86

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/4 x86: tangier: acpi: Create buffers outside of the methods

Create buffers outside of the methods as ACPICA 20200214 complains about this:

Remark 2173 - Creation of named objects within a method is highly inefficient, use globals or method local variables instead

---
v2: rebased on top of rc3 (Bin)

 .../asm/arch-tangier/acpi/southcluster.asl    | 95 ++++++++++---------
 1 file changed, 49 insertions(+), 46 deletions(-)
arch/x86/include/asm/arch-tangier/acpi/southcluster.asl +49 -46
index f088fe3cf51f..9d81abbdb674 100644
@@ -338,12 +338,12 @@ Device (PCI0)
         {
             Name (_ADR, Zero)
 
+            Name (PCKG, Package () {
+                Buffer (0x14) {}
+            })
+
             /* GPLD: Generate Port Location Data (PLD) */
             Method (GPLD, 1, Serialized) {
-                Name (PCKG, Package () {
-                    Buffer (0x14) {}
-                })
-
                 /* REV: Revision 0x02 for ACPI 5.0 */
                 CreateField (DerefOf (Index (PCKG, Zero)), Zero, 0x07, REV)
                 Store (0x0002, REV)
@@ -401,20 +401,21 @@ Device (PCI0)
                 Return (STA_VISIBLE)
             }
 
+            Name (RBUF, ResourceTemplate()
+            {
+                UartSerialBus(0x0001C200, DataBitsEight, StopBitsOne,
+                    0xFC, LittleEndian, ParityTypeNone, FlowControlHardware,
+                    0x20, 0x20, "\\_SB.PCI0.HSU0", 0, ResourceConsumer, , )
+                GpioInt(Level, ActiveHigh, Exclusive, PullNone, 0,
+                    "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 185 }
+                GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
+                    "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 184 }
+                GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
+                    "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 71 }
+            })
+
             Method (_CRS, 0, Serialized)
             {
-                Name (RBUF, ResourceTemplate()
-                {
-                    UartSerialBus(0x0001C200, DataBitsEight, StopBitsOne,
-                        0xFC, LittleEndian, ParityTypeNone, FlowControlHardware,
-                        0x20, 0x20, "\\_SB.PCI0.HSU0", 0, ResourceConsumer, , )
-                    GpioInt(Level, ActiveHigh, Exclusive, PullNone, 0,
-                        "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 185 }
-                    GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
-                        "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 184 }
-                    GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
-                        "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 71 }
-                })
                 Return (RBUF)
             }
 
@@ -454,33 +455,34 @@ Device (PCI0)
                 Return (STA_VISIBLE)
             }
 
+            Name (RBUF, ResourceTemplate()
+            {
+                /*
+                 * Shadow registers in SRAM for PMIC:
+                 *   SRAM    PMIC register
+                 *   --------------------
+                 *   0x00-    Unknown
+                 *   0x03    THRMIRQ (0x04)
+                 *   0x04    BCUIRQ (0x05)
+                 *   0x05    ADCIRQ (0x06)
+                 *   0x06    CHGRIRQ0 (0x07)
+                 *   0x07    CHGRIRQ1 (0x08)
+                 *   0x08-    Unknown
+                 *   0x0a    PBSTATUS (0x27)
+                 *   0x0b-    Unknown
+                 */
+                Memory32Fixed(ReadWrite, 0xFFFFF610, 0x00000010)
+                Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 30 }
+                Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 23 }
+                Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 52 }
+                Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 51 }
+                Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 50 }
+                Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 27 }
+                Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 49 }
+            })
+
             Method (_CRS, 0, Serialized)
             {
-                Name (RBUF, ResourceTemplate()
-                {
-                    /*
-                     * Shadow registers in SRAM for PMIC:
-                     *   SRAM    PMIC register
-                     *   --------------------
-                     *   0x00-    Unknown
-                     *   0x03    THRMIRQ (0x04)
-                     *   0x04    BCUIRQ (0x05)
-                     *   0x05    ADCIRQ (0x06)
-                     *   0x06    CHGRIRQ0 (0x07)
-                     *   0x07    CHGRIRQ1 (0x08)
-                     *   0x08-    Unknown
-                     *   0x0a    PBSTATUS (0x27)
-                     *   0x0b-    Unknown
-                     */
-                    Memory32Fixed(ReadWrite, 0xFFFFF610, 0x00000010)
-                    Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 30 }
-                    Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 23 }
-                    Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 52 }
-                    Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 51 }
-                    Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 50 }
-                    Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 27 }
-                    Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 49 }
-                })
                 Return (RBUF)
             }
 
@@ -527,13 +529,14 @@ Device (PCI0)
             Return (STA_VISIBLE)
         }
 
+        Name (RBUF, ResourceTemplate ()
+        {
+                Memory32Fixed(ReadWrite, 0xFF192000, 0x00001000)
+                Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 32 }
+        })
+
         Method (_CRS, 0, Serialized)
         {
-            Name (RBUF, ResourceTemplate ()
-            {
-                    Memory32Fixed(ReadWrite, 0xFF192000, 0x00001000)
-                    Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 32 }
-            })
             Return (RBUF)
         }
     }
Signature · 1 line
2.26.2
#1 lore raw

PATCH v2 2/4 x86: tangier: acpi: Replace _ADR() by _UID() in description of PCI host bridge

PCI Firmware specification requires _UID() and doesn't require _ADR() to be set. Replace latter by former.

---
v2: no changes

 arch/x86/include/asm/arch-tangier/acpi/southcluster.asl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/arch-tangier/acpi/southcluster.asl +1 -1
index 9d81abbdb674..11b06e5fe94f 100644
@@ -10,7 +10,7 @@ Device (PCI0)
     Name (_HID, EISAID("PNP0A08"))    /* PCIe */
     Name (_CID, EISAID("PNP0A03"))    /* PCI */
 
-    Name (_ADR, Zero)
+    Name (_UID, Zero)
     Name (_BBN, Zero)
 
     Name (MCRS, ResourceTemplate()
Signature · 1 line
2.26.2
#4 lore raw

PATCH v2 3/4 x86: tangier: acpi: Drop _ADR() where _HID() is present

In reply to Andy Shevchenko

ACPICA complains that either _HID() or _ADR() should be used. Drop _ADR() where _HID() is present.

---
v2: no changes

 arch/x86/include/asm/arch-tangier/acpi/southcluster.asl | 1 -
 1 file changed, 1 deletion(-)
arch/x86/include/asm/arch-tangier/acpi/southcluster.asl +0 -1
index 11b06e5fe94f..f9da188b38f6 100644
@@ -441,7 +441,6 @@ Device (PCI0)
 
         Device (PMIC)
         {
-            Name (_ADR, Zero)
             Name (_HID, "INTC100E")
             Name (_CID, "INTC100E")
             Name (_DDN, "Basin Cove PMIC")
Signature · 1 line
2.26.2
#7 lore raw

PATCH v2 4/4 x86: tangier: acpi: Drop _HID() where enumerated by _ADR()

In reply to Andy Shevchenko

ACPICA complains that either _HID() or _ADR() should be used. For General Purpose DMA we may not drop the _ADR() because the device is enumerated by PCI. Thus, simple drop _HID().

---
v2: no changes

 arch/x86/include/asm/arch-tangier/acpi/southcluster.asl | 1 -
 1 file changed, 1 deletion(-)
arch/x86/include/asm/arch-tangier/acpi/southcluster.asl +0 -1
index f9da188b38f6..df666259308d 100644
@@ -520,7 +520,6 @@ Device (PCI0)
     Device (GDMA)
     {
         Name (_ADR, 0x00150000)
-        Name (_HID, "808611A2")
         Name (_UID, Zero)
 
         Method (_STA, 0, NotSerialized)
Signature · 1 line
2.26.2
#10 lore raw

PATCH v2 1/4 x86: tangier: acpi: Create buffers outside of the methods

In reply to Andy Shevchenko
Quoted 7 lines · Andy Shevchenko

Create buffers outside of the methods as ACPICA 20200214 complains about this:

Remark 2173 - Creation of named objects within a method is highly inefficient, use globals or method local variables instead

Quoted 7 lines

---
v2: rebased on top of rc3 (Bin)

 .../asm/arch-tangier/acpi/southcluster.asl    | 95 ++++++++++---------
 1 file changed, 49 insertions(+), 46 deletions(-)
#2 lore raw

PATCH v2 2/4 x86: tangier: acpi: Replace _ADR() by _UID() in description of PCI host bridge

In reply to Andy Shevchenko
Quoted 11 lines · Andy Shevchenko

PCI Firmware specification requires _UID() and doesn't require _ADR() to be set. Replace latter by former.

---
v2: no changes

 arch/x86/include/asm/arch-tangier/acpi/southcluster.asl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#5 lore raw

PATCH v2 3/4 x86: tangier: acpi: Drop _ADR() where _HID() is present

In reply to Andy Shevchenko
Quoted 11 lines · Andy Shevchenko

ACPICA complains that either _HID() or _ADR() should be used. Drop _ADR() where _HID() is present.

---
v2: no changes

 arch/x86/include/asm/arch-tangier/acpi/southcluster.asl | 1 -
 1 file changed, 1 deletion(-)
#8 lore raw

PATCH v2 4/4 x86: tangier: acpi: Drop _HID() where enumerated by _ADR()

In reply to Andy Shevchenko
Quoted 5 lines · Andy Shevchenko

ACPICA complains that either _HID() or _ADR() should be used. For General Purpose DMA we may not drop the _ADR() because the device is enumerated by PCI. Thus, simple drop _HID().

Quoted 7 lines

---
v2: no changes

 arch/x86/include/asm/arch-tangier/acpi/southcluster.asl | 1 -
 1 file changed, 1 deletion(-)
#11 lore raw

PATCH v2 1/4 x86: tangier: acpi: Create buffers outside of the methods

In reply to Bin Meng
Quoted 18 lines · Bin Meng
Quoted 7 lines · Andy Shevchenko

Create buffers outside of the methods as ACPICA 20200214 complains about this:

Remark 2173 - Creation of named objects within a method is highly inefficient, use globals or method local variables instead

Quoted 7 lines

---
v2: rebased on top of rc3 (Bin)

 .../asm/arch-tangier/acpi/southcluster.asl    | 95 ++++++++++---------
 1 file changed, 49 insertions(+), 46 deletions(-)
Quoted 2 lines

applied to u-boot-x86, thanks!

#3 lore raw

PATCH v2 2/4 x86: tangier: acpi: Replace _ADR() by _UID() in description of PCI host bridge

In reply to Bin Meng
Quoted 15 lines · Bin Meng
Quoted 11 lines · Andy Shevchenko

PCI Firmware specification requires _UID() and doesn't require _ADR() to be set. Replace latter by former.

---
v2: no changes

 arch/x86/include/asm/arch-tangier/acpi/southcluster.asl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 2 lines

applied to u-boot-x86, thanks!

#6 lore raw

PATCH v2 3/4 x86: tangier: acpi: Drop _ADR() where _HID() is present

In reply to Bin Meng
Quoted 15 lines · Bin Meng
Quoted 11 lines · Andy Shevchenko

ACPICA complains that either _HID() or _ADR() should be used. Drop _ADR() where _HID() is present.

---
v2: no changes

 arch/x86/include/asm/arch-tangier/acpi/southcluster.asl | 1 -
 1 file changed, 1 deletion(-)
Quoted 2 lines

applied to u-boot-x86, thanks!

#9 lore raw

PATCH v2 4/4 x86: tangier: acpi: Drop _HID() where enumerated by _ADR()

In reply to Bin Meng
Quoted 16 lines · Bin Meng
Quoted 5 lines · Andy Shevchenko

ACPICA complains that either _HID() or _ADR() should be used. For General Purpose DMA we may not drop the _ADR() because the device is enumerated by PCI. Thus, simple drop _HID().

Quoted 7 lines

---
v2: no changes

 arch/x86/include/asm/arch-tangier/acpi/southcluster.asl | 1 -
 1 file changed, 1 deletion(-)
Quoted 2 lines

applied to u-boot-x86, thanks!