Get rid of a compile time dprintf warning
by Dave Frodin
This patch gets rid of a compile time dprintf warning.
A 'long int' was being passed to a '%d'.
Signed-off-by: Dave Frodin <dave.frodin(a)se-eng.com>
---
src/post.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/post.c b/src/post.c
index 924b311..b84d19e 100644
--- a/src/post.c
+++ b/src/post.c
@@ -345,7 +345,7 @@ reloc_init(void)
panic("No space for init relocation.\n");
// Copy code and update relocs (init absolute, init relative, and runtime)
- dprintf(1, "Relocating low data from %p to %p (size %d)\n"
+ dprintf(1, "Relocating low data from %p to %p (size %ld)\n"
, datalow_start, final_datalow_start, datalow_end - datalow_start);
updateRelocs(code32flat_start, _reloc_datalow_start, _reloc_datalow_end
, final_datalow_start - datalow_start);
--
1.7.9
6 years, 11 months
[PATCH] esp: enable busmaster
by Paolo Bonzini
The HBA does DMA, thus we must enable the busmaster bit,
otherwise dma access will fail with recent qemu versions.
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
---
src/esp-scsi.c | 2 ++
1 file modificato, 2 inserzioni(+)
diff --git a/src/esp-scsi.c b/src/esp-scsi.c
index b795012..c43e55b 100644
--- a/src/esp-scsi.c
+++ b/src/esp-scsi.c
@@ -202,6 +202,8 @@ init_esp_scsi(struct pci_device *pci)
pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf),
pci_bdf_to_fn(bdf), iobase);
+ pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER);
+
// reset
outb(ESP_CMD_RESET, iobase + ESP_CMD);
--
1.7.12.1
6 years, 11 months
[PATCH 00/20] q35 support patch series
by Gerd Hoffmann
Hi,
Next round of the q35 patch series, addressing review
comments from Jason and Kevin.
cheers,
Gerd
Gerd Hoffmann (14):
simplify chipset detection
acpi: add mcfg table for mmconfig
acpi: move DBUG() to separate file
acpi: move DBUG() to separate file [q35]
acpi: move \_SB.HPET to separate file
acpi: move \_SB.HPET to separate file [q35]
acpi: move \_SB.PCI0._CRS to separate file
acpi: move \_SB.PCI0._CRS to separate file [q35]
acpi: move cpu hotplug to separate file
acpi: move cpu hotplug to separate file [q35]
acpi: rework enable bits
acpi: move isa devices to separate file
acpi: move isa devices to separate file [q35]
q35: fix default vga address
Isaku Yamahata (4):
seabios: acpi, fadt: make while fadt initialization chipset specific
seabios: pci: enable SERR of normal device.
seabios: add q35 initialization functions.
seabios: q35: add dsdt
Jan Kiszka (1):
seabios: q35: Register PCI IRQs as active high in APIC mode
Jason Baron (1):
seabios: make mttr UC area setup dynamic
Makefile | 2 +-
src/acpi-dsdt-cpu-hotplug.dsl | 77 +++++++
src/acpi-dsdt-dbug.dsl | 30 +++
src/acpi-dsdt-hpet.dsl | 36 ++++
src/acpi-dsdt-isa.dsl | 134 ++++++++++++
src/acpi-dsdt-pci-crs.dsl | 108 ++++++++++
src/acpi-dsdt.dsl | 450 ++-------------------------------------
src/acpi.c | 108 +++++++----
src/acpi.h | 17 ++
src/config.h | 1 -
src/dev-q35.h | 46 ++++
src/mtrr.c | 5 +-
src/pci.h | 2 +
src/pciinit.c | 94 ++++++++-
src/post.c | 6 +-
src/q35-acpi-dsdt.dsl | 464 +++++++++++++++++++++++++++++++++++++++++
src/shadow.c | 13 ++
src/smm.c | 37 ++++
18 files changed, 1153 insertions(+), 477 deletions(-)
create mode 100644 src/acpi-dsdt-cpu-hotplug.dsl
create mode 100644 src/acpi-dsdt-dbug.dsl
create mode 100644 src/acpi-dsdt-hpet.dsl
create mode 100644 src/acpi-dsdt-isa.dsl
create mode 100644 src/acpi-dsdt-pci-crs.dsl
create mode 100644 src/dev-q35.h
create mode 100644 src/q35-acpi-dsdt.dsl
7 years
[PATCH 00/20] q35 support patch series
by Gerd Hoffmann
Hi,
Next round of the q35 patch series, rebased to master.
Patches 1-6 carry the C code bits. They have been adapted to the recent
changes in master. mcfg acpi table generator simply uses the q35
constants as suggested by Kevin. Otherwise unmodified.
Patches 7+ carry the ACPI bits. First the original unmodified dsdt
patches, then a bunch of cleanup patches on top of that which for the
most part split sharable AML code into separate files.
cheers,
Gerd
PS: Anthony just pulled the q35 patches into qemu/master.
Gerd Hoffmann (14):
simplify chipset detection
acpi: add mcfg table for mmconfig
acpi: move DBUG() to separate file
acpi: move DBUG() to separate file [q35]
acpi: move \_SB.HPET to separate file
acpi: move \_SB.HPET to separate file [q35]
acpi: move \_SB.PCI0._CRS to separate file
acpi: move \_SB.PCI0._CRS to separate file [q35]
acpi: move cpu hotplug to separate file
acpi: move cpu hotplug to separate file [q35]
acpi: rework enable bits
acpi: move isa devices to separate file
acpi: move isa devices to separate file [q35]
q35: fix default vga address
Isaku Yamahata (4):
seabios: acpi, fadt: make while fadt initialization chipset specific
seabios: pci: enable SERR of normal device.
seabios: add q35 initialization functions.
seabios: q35: add dsdt
Jan Kiszka (1):
seabios: q35: Register PCI IRQs as active high in APIC mode
Jason Baron (1):
seabios: make mttr UC area setup dynamic
Makefile | 2 +-
src/acpi-dsdt-cpu-hotplug.dsl | 78 ++++++
src/acpi-dsdt-dbug.dsl | 30 +++
src/acpi-dsdt-hpet.dsl | 36 +++
src/acpi-dsdt-isa.dsl | 113 ++++++++
src/acpi-dsdt-pci-crs.dsl | 104 ++++++++
src/acpi-dsdt.dsl | 437 ++------------------------------
src/acpi.c | 108 +++++---
src/acpi.h | 17 ++
src/config.h | 1 -
src/dev-q35.h | 46 ++++
src/mtrr.c | 5 +-
src/pci.h | 3 +
src/pciinit.c | 97 +++++++-
src/post.c | 6 +-
src/q35-acpi-dsdt.dsl | 563 +++++++++++++++++++++++++++++++++++++++++
src/shadow.c | 13 +
src/smm.c | 37 +++
18 files changed, 1235 insertions(+), 461 deletions(-)
create mode 100644 src/acpi-dsdt-cpu-hotplug.dsl
create mode 100644 src/acpi-dsdt-dbug.dsl
create mode 100644 src/acpi-dsdt-hpet.dsl
create mode 100644 src/acpi-dsdt-isa.dsl
create mode 100644 src/acpi-dsdt-pci-crs.dsl
create mode 100644 src/dev-q35.h
create mode 100644 src/q35-acpi-dsdt.dsl
7 years
[PATCH 20/20] q35: fix default vga address
by Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel(a)redhat.com>
---
src/q35-acpi-dsdt.dsl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/q35-acpi-dsdt.dsl b/src/q35-acpi-dsdt.dsl
index e9a9711..b339e57 100644
--- a/src/q35-acpi-dsdt.dsl
+++ b/src/q35-acpi-dsdt.dsl
@@ -263,7 +263,7 @@ DefinitionBlock (
Scope(\_SB.PCI0) {
Device (VGA) {
- Name (_ADR, 0x00020000)
+ Name (_ADR, 0x00010000)
Method (_S1D, 0, NotSerialized)
{
Return (0x00)
--
1.7.1
7 years
[PATCH 19/20] acpi: move isa devices to separate file [q35]
by Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel(a)redhat.com>
---
src/q35-acpi-dsdt.dsl | 170 ++----------------------------------------------
1 files changed, 8 insertions(+), 162 deletions(-)
diff --git a/src/q35-acpi-dsdt.dsl b/src/q35-acpi-dsdt.dsl
index d1175cf..e9a9711 100644
--- a/src/q35-acpi-dsdt.dsl
+++ b/src/q35-acpi-dsdt.dsl
@@ -259,6 +259,7 @@ DefinitionBlock (
}
#include "acpi-dsdt-hpet.dsl"
+#include "acpi-dsdt-isa.dsl"
Scope(\_SB.PCI0) {
Device (VGA) {
@@ -321,178 +322,23 @@ DefinitionBlock (
}
/* Real-time clock */
- Device (RTC)
- {
- Name (_HID, EisaId ("PNP0B00"))
- Name (_CRS, ResourceTemplate ()
- {
- IO (Decode16, 0x0070, 0x0070, 0x10, 0x02)
- IRQNoFlags () {8}
- IO (Decode16, 0x0072, 0x0072, 0x02, 0x06)
- })
- }
+ ISA_DEVICE_RTC(RTC)
/* Keyboard seems to be important for WinXP install */
- Device (KBD)
- {
- Name (_HID, EisaId ("PNP0303"))
- Method (_STA, 0, NotSerialized)
- {
- Return (0x0f)
- }
-
- Method (_CRS, 0, NotSerialized)
- {
- Name (TMP, ResourceTemplate ()
- {
- IO (Decode16,
- 0x0060, // Address Range Minimum
- 0x0060, // Address Range Maximum
- 0x01, // Address Alignment
- 0x01, // Address Length
- )
- IO (Decode16,
- 0x0064, // Address Range Minimum
- 0x0064, // Address Range Maximum
- 0x01, // Address Alignment
- 0x01, // Address Length
- )
- IRQNoFlags ()
- {1}
- })
- Return (TMP)
- }
- }
+ ISA_DEVICE_PS2_KBD(KBD)
/* PS/2 mouse */
- Device (MOU)
- {
- Name (_HID, EisaId ("PNP0F13"))
- Method (_STA, 0, NotSerialized)
- {
- Return (0x0f)
- }
-
- Method (_CRS, 0, NotSerialized)
- {
- Name (TMP, ResourceTemplate ()
- {
- IRQNoFlags () {12}
- })
- Return (TMP)
- }
- }
+ ISA_DEVICE_PS2_MOUSE(MOU)
/* PS/2 floppy controller */
- Device (FDC0)
- {
- Name (_HID, EisaId ("PNP0700"))
- Method (_STA, 0, NotSerialized)
- {
- Store (\_SB.PCI0.LPC.FDEN, Local0)
- If (LEqual (Local0, 0))
- {
- Return (0x00)
- }
- Else
- {
- Return (0x0F)
- }
- }
- Method (_CRS, 0, NotSerialized)
- {
- Name (BUF0, ResourceTemplate ()
- {
- IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
- IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
- IRQNoFlags () {6}
- DMA (Compatibility, NotBusMaster, Transfer8) {2}
- })
- Return (BUF0)
- }
- }
+ ISA_DEVICE_FLOPPY(FDC0, \_SB.PCI0.LPC.FDEN)
/* Parallel port */
- Device (LPT)
- {
- Name (_HID, EisaId ("PNP0400"))
- Method (_STA, 0, NotSerialized)
- {
- Store (\_SB.PCI0.LPC.LPEN, Local0)
- If (LEqual (Local0, 0))
- {
- Return (0x00)
- }
- Else
- {
- Return (0x0F)
- }
- }
- Method (_CRS, 0, NotSerialized)
- {
- Name (BUF0, ResourceTemplate ()
- {
- IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
- IRQNoFlags () {7}
- })
- Return (BUF0)
- }
- }
+ ISA_DEVICE_PARALLEL(LPT, \_SB.PCI0.LPC.LPEN, 0x0378, 7)
/* Serial Ports */
- Device (COM1)
- {
- Name (_HID, EisaId ("PNP0501"))
- Name (_UID, 0x01)
- Method (_STA, 0, NotSerialized)
- {
- Store (\_SB.PCI0.LPC.CAEN, Local0)
- If (LEqual (Local0, 0))
- {
- Return (0x00)
- }
- Else
- {
- Return (0x0F)
- }
- }
- Method (_CRS, 0, NotSerialized)
- {
- Name (BUF0, ResourceTemplate ()
- {
- IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
- IRQNoFlags () {4}
- })
- Return (BUF0)
- }
- }
-
- Device (COM2)
- {
- Name (_HID, EisaId ("PNP0501"))
- Name (_UID, 0x02)
- Method (_STA, 0, NotSerialized)
- {
- Store (\_SB.PCI0.LPC.CBEN, Local0)
- If (LEqual (Local0, 0))
- {
- Return (0x00)
- }
- Else
- {
- Return (0x0F)
- }
- }
- Method (_CRS, 0, NotSerialized)
- {
- Name (BUF0, ResourceTemplate ()
- {
- IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
- IRQNoFlags () {3}
- })
- Return (BUF0)
- }
- }
+ ISA_DEVICE_SERIAL(COM1, \_SB.PCI0.LPC.CAEN, 0x03F8, 4)
+ ISA_DEVICE_SERIAL(COM2, \_SB.PCI0.LPC.CBEN, 0x02F8, 3)
}
}
--
1.7.1
7 years
[PATCH 18/20] acpi: move isa devices to separate file
by Gerd Hoffmann
Stuff them parameterized into #defines, so we can (a) reuse them for
q35 and (b) don't duplicate the serial line.
Signed-off-by: Gerd Hoffmann <kraxel(a)redhat.com>
---
src/acpi-dsdt-isa.dsl | 113 ++++++++++++++++++++++++++++++++
src/acpi-dsdt.dsl | 171 +++----------------------------------------------
2 files changed, 122 insertions(+), 162 deletions(-)
create mode 100644 src/acpi-dsdt-isa.dsl
diff --git a/src/acpi-dsdt-isa.dsl b/src/acpi-dsdt-isa.dsl
new file mode 100644
index 0000000..ee8194d
--- /dev/null
+++ b/src/acpi-dsdt-isa.dsl
@@ -0,0 +1,113 @@
+#define ISA_DEVICE_RTC(_name) \
+ Device (_name) \
+ { \
+ Name (_HID, EisaId ("PNP0B00")) \
+ Name (_CRS, ResourceTemplate () \
+ { \
+ IO (Decode16, 0x0070, 0x0070, 0x10, 0x02) \
+ IRQNoFlags () {8} \
+ IO (Decode16, 0x0072, 0x0072, 0x02, 0x06) \
+ }) \
+ }
+
+#define ISA_DEVICE_PS2_KBD(_name) \
+ Device (KBD) \
+ { \
+ Name (_HID, EisaId ("PNP0303")) \
+ Method (_STA, 0, NotSerialized) \
+ { \
+ Return (0x0f) \
+ } \
+ Name (_CRS, ResourceTemplate () \
+ { \
+ IO (Decode16, 0x0060, 0x0060, 0x01, 0x01) \
+ IO (Decode16, 0x0064, 0x0064, 0x01, 0x01) \
+ IRQNoFlags () { 1 } \
+ }) \
+ }
+
+#define ISA_DEVICE_PS2_MOUSE(_name) \
+ Device (MOU) \
+ { \
+ Name (_HID, EisaId ("PNP0F13")) \
+ Method (_STA, 0, NotSerialized) \
+ { \
+ Return (0x0f) \
+ } \
+ Name (_CRS, ResourceTemplate () \
+ { \
+ IRQNoFlags () {12} \
+ }) \
+ }
+
+#define ISA_DEVICE_FLOPPY(_name, _enable) \
+ Device (_name) \
+ { \
+ Name (_HID, EisaId ("PNP0700")) \
+ Method (_STA, 0, NotSerialized) \
+ { \
+ Store (_enable, Local0) \
+ If (LEqual (Local0, 0)) \
+ { \
+ Return (0x00) \
+ } \
+ Else \
+ { \
+ Return (0x0F) \
+ } \
+ } \
+ Name (_CRS, ResourceTemplate () \
+ { \
+ IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04) \
+ IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01) \
+ IRQNoFlags () {6} \
+ DMA (Compatibility, NotBusMaster, Transfer8) {2} \
+ }) \
+ }
+
+#define ISA_DEVICE_PARALLEL(_name, _enable, _port, _irq) \
+ Device (_name) \
+ { \
+ Name (_HID, EisaId ("PNP0400")) \
+ Method (_STA, 0, NotSerialized) \
+ { \
+ Store (_enable, Local0) \
+ If (LEqual (Local0, 0)) \
+ { \
+ Return (0x00) \
+ } \
+ Else \
+ { \
+ Return (0x0F) \
+ } \
+ } \
+ Name (_CRS, ResourceTemplate () \
+ { \
+ IO (Decode16, _port, _port, 0x08, 0x08) \
+ IRQNoFlags () { _irq } \
+ }) \
+ }
+
+#define ISA_DEVICE_SERIAL(_name, _enable, _port, _irq) \
+ Device (_name) \
+ { \
+ Name (_HID, EisaId ("PNP0501")) \
+ Name (_UID, 0x01) \
+ Method (_STA, 0, NotSerialized) \
+ { \
+ Store (_enable, Local0) \
+ If (LEqual (Local0, 0)) \
+ { \
+ Return (0x00) \
+ } \
+ Else \
+ { \
+ Return (0x0F) \
+ } \
+ } \
+ Name (_CRS, ResourceTemplate () \
+ { \
+ IO (Decode16, _port, _port, 0x00, 0x08) \
+ IRQNoFlags () { _irq } \
+ }) \
+ }
diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
index abc3d41..7e1f683 100644
--- a/src/acpi-dsdt.dsl
+++ b/src/acpi-dsdt.dsl
@@ -162,180 +162,27 @@ DefinitionBlock (
* SuperIO devices (kbd, mouse, etc.)
****************************************************************/
+#include "acpi-dsdt-isa.dsl"
+
Scope(\_SB.PCI0.ISA) {
/* Real-time clock */
- Device (RTC)
- {
- Name (_HID, EisaId ("PNP0B00"))
- Name (_CRS, ResourceTemplate ()
- {
- IO (Decode16, 0x0070, 0x0070, 0x10, 0x02)
- IRQNoFlags () {8}
- IO (Decode16, 0x0072, 0x0072, 0x02, 0x06)
- })
- }
+ ISA_DEVICE_RTC(RTC)
/* Keyboard seems to be important for WinXP install */
- Device (KBD)
- {
- Name (_HID, EisaId ("PNP0303"))
- Method (_STA, 0, NotSerialized)
- {
- Return (0x0f)
- }
-
- Method (_CRS, 0, NotSerialized)
- {
- Name (TMP, ResourceTemplate ()
- {
- IO (Decode16,
- 0x0060, // Address Range Minimum
- 0x0060, // Address Range Maximum
- 0x01, // Address Alignment
- 0x01, // Address Length
- )
- IO (Decode16,
- 0x0064, // Address Range Minimum
- 0x0064, // Address Range Maximum
- 0x01, // Address Alignment
- 0x01, // Address Length
- )
- IRQNoFlags ()
- {1}
- })
- Return (TMP)
- }
- }
+ ISA_DEVICE_PS2_KBD(KBD)
/* PS/2 mouse */
- Device (MOU)
- {
- Name (_HID, EisaId ("PNP0F13"))
- Method (_STA, 0, NotSerialized)
- {
- Return (0x0f)
- }
-
- Method (_CRS, 0, NotSerialized)
- {
- Name (TMP, ResourceTemplate ()
- {
- IRQNoFlags () {12}
- })
- Return (TMP)
- }
- }
+ ISA_DEVICE_PS2_MOUSE(MOU)
/* PS/2 floppy controller */
- Device (FDC0)
- {
- Name (_HID, EisaId ("PNP0700"))
- Method (_STA, 0, NotSerialized)
- {
- Store (\_SB.PCI0.PX13.FDEN, Local0)
- If (LEqual (Local0, 0))
- {
- Return (0x00)
- }
- Else
- {
- Return (0x0F)
- }
- }
- Method (_CRS, 0, NotSerialized)
- {
- Name (BUF0, ResourceTemplate ()
- {
- IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
- IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
- IRQNoFlags () {6}
- DMA (Compatibility, NotBusMaster, Transfer8) {2}
- })
- Return (BUF0)
- }
- }
+ ISA_DEVICE_FLOPPY(FDC0, \_SB.PCI0.PX13.FDEN)
/* Parallel port */
- Device (LPT)
- {
- Name (_HID, EisaId ("PNP0400"))
- Method (_STA, 0, NotSerialized)
- {
- Store (\_SB.PCI0.PX13.LPEN, Local0)
- If (LEqual (Local0, 0))
- {
- Return (0x00)
- }
- Else
- {
- Return (0x0F)
- }
- }
- Method (_CRS, 0, NotSerialized)
- {
- Name (BUF0, ResourceTemplate ()
- {
- IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
- IRQNoFlags () {7}
- })
- Return (BUF0)
- }
- }
+ ISA_DEVICE_PARALLEL(LPT, \_SB.PCI0.PX13.LPEN, 0x0378, 7)
/* Serial Ports */
- Device (COM1)
- {
- Name (_HID, EisaId ("PNP0501"))
- Name (_UID, 0x01)
- Method (_STA, 0, NotSerialized)
- {
- Store (\_SB.PCI0.PX13.CAEN, Local0)
- If (LEqual (Local0, 0))
- {
- Return (0x00)
- }
- Else
- {
- Return (0x0F)
- }
- }
- Method (_CRS, 0, NotSerialized)
- {
- Name (BUF0, ResourceTemplate ()
- {
- IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
- IRQNoFlags () {4}
- })
- Return (BUF0)
- }
- }
-
- Device (COM2)
- {
- Name (_HID, EisaId ("PNP0501"))
- Name (_UID, 0x02)
- Method (_STA, 0, NotSerialized)
- {
- Store (\_SB.PCI0.LPC.CBEN, Local0)
- If (LEqual (Local0, 0))
- {
- Return (0x00)
- }
- Else
- {
- Return (0x0F)
- }
- }
- Method (_CRS, 0, NotSerialized)
- {
- Name (BUF0, ResourceTemplate ()
- {
- IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
- IRQNoFlags () {3}
- })
- Return (BUF0)
- }
- }
+ ISA_DEVICE_SERIAL(COM1, \_SB.PCI0.PX13.CAEN, 0x03F8, 4)
+ ISA_DEVICE_SERIAL(COM2, \_SB.PCI0.PX13.CBEN, 0x02F8, 3)
}
--
1.7.1
7 years
[PATCH 17/20] acpi: rework enable bits
by Gerd Hoffmann
Model the device enable bits as fields so they can be accessed
directly by name.
Signed-off-by: Gerd Hoffmann <kraxel(a)redhat.com>
---
src/acpi-dsdt.dsl | 41 +++++++++++++++++++++++------------------
1 files changed, 23 insertions(+), 18 deletions(-)
diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
index 6912fac..abc3d41 100644
--- a/src/acpi-dsdt.dsl
+++ b/src/acpi-dsdt.dsl
@@ -232,7 +232,15 @@ DefinitionBlock (
Name (_HID, EisaId ("PNP0700"))
Method (_STA, 0, NotSerialized)
{
- Return (0x0F)
+ Store (\_SB.PCI0.PX13.FDEN, Local0)
+ If (LEqual (Local0, 0))
+ {
+ Return (0x00)
+ }
+ Else
+ {
+ Return (0x0F)
+ }
}
Method (_CRS, 0, NotSerialized)
{
@@ -253,8 +261,7 @@ DefinitionBlock (
Name (_HID, EisaId ("PNP0400"))
Method (_STA, 0, NotSerialized)
{
- Store (\_SB.PCI0.PX13.DRSA, Local0)
- And (Local0, 0x80000000, Local0)
+ Store (\_SB.PCI0.PX13.LPEN, Local0)
If (LEqual (Local0, 0))
{
Return (0x00)
@@ -282,8 +289,7 @@ DefinitionBlock (
Name (_UID, 0x01)
Method (_STA, 0, NotSerialized)
{
- Store (\_SB.PCI0.PX13.DRSC, Local0)
- And (Local0, 0x08000000, Local0)
+ Store (\_SB.PCI0.PX13.CAEN, Local0)
If (LEqual (Local0, 0))
{
Return (0x00)
@@ -310,8 +316,7 @@ DefinitionBlock (
Name (_UID, 0x02)
Method (_STA, 0, NotSerialized)
{
- Store (\_SB.PCI0.PX13.DRSC, Local0)
- And (Local0, 0x80000000, Local0)
+ Store (\_SB.PCI0.LPC.CBEN, Local0)
If (LEqual (Local0, 0))
{
Return (0x00)
@@ -342,19 +347,19 @@ DefinitionBlock (
Device (PX13) {
Name (_ADR, 0x00010003)
- OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
- Field (P13C, DWordAcc, NoLock, Preserve)
+ OperationRegion (P13C, PCI_Config, 0x00, 0xff)
+ Field (P13C, AnyAcc, NoLock, Preserve)
{
- DRSA, 32,
- DRSB, 32,
- DRSC, 32,
- DRSE, 32,
- DRSF, 32,
- DRSG, 32,
- DRSH, 32,
- DRSI, 32,
- DRSJ, 32
+ Offset(0x5f),
+ , 7,
+ LPEN, 1, // LPT
+ Offset(0x67),
+ , 3,
+ CAEN, 1, // COM1
+ , 3,
+ CBEN, 1, // COM2
}
+ Name (FDEN, 1)
}
}
--
1.7.1
7 years
[PATCH 16/20] acpi: move cpu hotplug to separate file [q35]
by Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel(a)redhat.com>
---
src/acpi-dsdt-cpu-hotplug.dsl | 1 +
src/q35-acpi-dsdt.dsl | 72 +----------------------------------------
2 files changed, 2 insertions(+), 71 deletions(-)
diff --git a/src/acpi-dsdt-cpu-hotplug.dsl b/src/acpi-dsdt-cpu-hotplug.dsl
index 7f3ad3b..ac7987b 100644
--- a/src/acpi-dsdt-cpu-hotplug.dsl
+++ b/src/acpi-dsdt-cpu-hotplug.dsl
@@ -71,6 +71,7 @@
}
Increment(Local0)
}
+ Return(One)
}
}
diff --git a/src/q35-acpi-dsdt.dsl b/src/q35-acpi-dsdt.dsl
index 5bc6f34..d1175cf 100644
--- a/src/q35-acpi-dsdt.dsl
+++ b/src/q35-acpi-dsdt.dsl
@@ -658,77 +658,7 @@ DefinitionBlock (
define_gsi_link(GSIH, 0, 0x17)
}
- /* CPU hotplug */
- Scope(\_SB) {
- /* Objects filled in by run-time generated SSDT */
- External(NTFY, MethodObj)
- External(CPON, PkgObj)
-
- /* Methods called by run-time generated SSDT Processor objects */
- Method (CPMA, 1, NotSerialized) {
- // _MAT method - create an madt apic buffer
- // Local0 = CPON flag for this cpu
- Store(DerefOf(Index(CPON, Arg0)), Local0)
- // Local1 = Buffer (in madt apic form) to return
- Store(Buffer(8) {0x00, 0x08, 0x00, 0x00, 0x00, 0, 0, 0}, Local1)
- // Update the processor id, lapic id, and enable/disable status
- Store(Arg0, Index(Local1, 2))
- Store(Arg0, Index(Local1, 3))
- Store(Local0, Index(Local1, 4))
- Return (Local1)
- }
- Method (CPST, 1, NotSerialized) {
- // _STA method - return ON status of cpu
- // Local0 = CPON flag for this cpu
- Store(DerefOf(Index(CPON, Arg0)), Local0)
- If (Local0) { Return(0xF) } Else { Return(0x0) }
- }
- Method (CPEJ, 2, NotSerialized) {
- // _EJ0 method - eject callback
- Sleep(200)
- }
-
- /* CPU hotplug notify method */
- OperationRegion(PRST, SystemIO, 0xaf00, 32)
- Field (PRST, ByteAcc, NoLock, Preserve)
- {
- PRS, 256
- }
- Method(PRSC, 0) {
- // Local5 = active cpu bitmap
- Store (PRS, Local5)
- // Local2 = last read byte from bitmap
- Store (Zero, Local2)
- // Local0 = cpuid iterator
- Store (Zero, Local0)
- While (LLess(Local0, SizeOf(CPON))) {
- // Local1 = CPON flag for this cpu
- Store(DerefOf(Index(CPON, Local0)), Local1)
- If (And(Local0, 0x07)) {
- // Shift down previously read bitmap byte
- ShiftRight(Local2, 1, Local2)
- } Else {
- // Read next byte from cpu bitmap
- Store(DerefOf(Index(Local5, ShiftRight(Local0, 3))), Local2)
- }
- // Local3 = active state for this cpu
- Store(And(Local2, 1), Local3)
-
- If (LNotEqual(Local1, Local3)) {
- // State change - update CPON with new state
- Store(Local3, Index(CPON, Local0))
- // Do CPU notify
- If (LEqual(Local3, 1)) {
- NTFY(Local0, 1)
- } Else {
- NTFY(Local0, 3)
- }
- }
- Increment(Local0)
- }
- Return(One)
- }
- }
+#include "acpi-dsdt-cpu-hotplug.dsl"
Scope (\_GPE)
{
--
1.7.1
7 years
[PATCH 15/20] acpi: move cpu hotplug to separate file
by Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel(a)redhat.com>
---
src/acpi-dsdt-cpu-hotplug.dsl | 77 +++++++++++++++++++++++++++++++++++++++++
src/acpi-dsdt.dsl | 77 +----------------------------------------
2 files changed, 78 insertions(+), 76 deletions(-)
create mode 100644 src/acpi-dsdt-cpu-hotplug.dsl
diff --git a/src/acpi-dsdt-cpu-hotplug.dsl b/src/acpi-dsdt-cpu-hotplug.dsl
new file mode 100644
index 0000000..7f3ad3b
--- /dev/null
+++ b/src/acpi-dsdt-cpu-hotplug.dsl
@@ -0,0 +1,77 @@
+/****************************************************************
+ * CPU hotplug
+ ****************************************************************/
+
+ Scope(\_SB) {
+ /* Objects filled in by run-time generated SSDT */
+ External(NTFY, MethodObj)
+ External(CPON, PkgObj)
+
+ /* Methods called by run-time generated SSDT Processor objects */
+ Method (CPMA, 1, NotSerialized) {
+ // _MAT method - create an madt apic buffer
+ // Arg0 = Processor ID = Local APIC ID
+ // Local0 = CPON flag for this cpu
+ Store(DerefOf(Index(CPON, Arg0)), Local0)
+ // Local1 = Buffer (in madt apic form) to return
+ Store(Buffer(8) {0x00, 0x08, 0x00, 0x00, 0x00, 0, 0, 0}, Local1)
+ // Update the processor id, lapic id, and enable/disable status
+ Store(Arg0, Index(Local1, 2))
+ Store(Arg0, Index(Local1, 3))
+ Store(Local0, Index(Local1, 4))
+ Return (Local1)
+ }
+ Method (CPST, 1, NotSerialized) {
+ // _STA method - return ON status of cpu
+ // Arg0 = Processor ID = Local APIC ID
+ // Local0 = CPON flag for this cpu
+ Store(DerefOf(Index(CPON, Arg0)), Local0)
+ If (Local0) { Return(0xF) } Else { Return(0x0) }
+ }
+ Method (CPEJ, 2, NotSerialized) {
+ // _EJ0 method - eject callback
+ Sleep(200)
+ }
+
+ /* CPU hotplug notify method */
+ OperationRegion(PRST, SystemIO, 0xaf00, 32)
+ Field (PRST, ByteAcc, NoLock, Preserve)
+ {
+ PRS, 256
+ }
+ Method(PRSC, 0) {
+ // Local5 = active cpu bitmap
+ Store (PRS, Local5)
+ // Local2 = last read byte from bitmap
+ Store (Zero, Local2)
+ // Local0 = Processor ID / APIC ID iterator
+ Store (Zero, Local0)
+ While (LLess(Local0, SizeOf(CPON))) {
+ // Local1 = CPON flag for this cpu
+ Store(DerefOf(Index(CPON, Local0)), Local1)
+ If (And(Local0, 0x07)) {
+ // Shift down previously read bitmap byte
+ ShiftRight(Local2, 1, Local2)
+ } Else {
+ // Read next byte from cpu bitmap
+ Store(DerefOf(Index(Local5, ShiftRight(Local0, 3))), Local2)
+ }
+ // Local3 = active state for this cpu
+ Store(And(Local2, 1), Local3)
+
+ If (LNotEqual(Local1, Local3)) {
+ // State change - update CPON with new state
+ Store(Local3, Index(CPON, Local0))
+ // Do CPU notify
+ If (LEqual(Local3, 1)) {
+ NTFY(Local0, 1)
+ } Else {
+ NTFY(Local0, 3)
+ }
+ }
+ Increment(Local0)
+ }
+ }
+ }
+
+
diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
index c104b42..6912fac 100644
--- a/src/acpi-dsdt.dsl
+++ b/src/acpi-dsdt.dsl
@@ -485,82 +485,7 @@ DefinitionBlock (
}
}
-/****************************************************************
- * CPU hotplug
- ****************************************************************/
-
- Scope(\_SB) {
- /* Objects filled in by run-time generated SSDT */
- External(NTFY, MethodObj)
- External(CPON, PkgObj)
-
- /* Methods called by run-time generated SSDT Processor objects */
- Method (CPMA, 1, NotSerialized) {
- // _MAT method - create an madt apic buffer
- // Arg0 = Processor ID = Local APIC ID
- // Local0 = CPON flag for this cpu
- Store(DerefOf(Index(CPON, Arg0)), Local0)
- // Local1 = Buffer (in madt apic form) to return
- Store(Buffer(8) {0x00, 0x08, 0x00, 0x00, 0x00, 0, 0, 0}, Local1)
- // Update the processor id, lapic id, and enable/disable status
- Store(Arg0, Index(Local1, 2))
- Store(Arg0, Index(Local1, 3))
- Store(Local0, Index(Local1, 4))
- Return (Local1)
- }
- Method (CPST, 1, NotSerialized) {
- // _STA method - return ON status of cpu
- // Arg0 = Processor ID = Local APIC ID
- // Local0 = CPON flag for this cpu
- Store(DerefOf(Index(CPON, Arg0)), Local0)
- If (Local0) { Return(0xF) } Else { Return(0x0) }
- }
- Method (CPEJ, 2, NotSerialized) {
- // _EJ0 method - eject callback
- Sleep(200)
- }
-
- /* CPU hotplug notify method */
- OperationRegion(PRST, SystemIO, 0xaf00, 32)
- Field (PRST, ByteAcc, NoLock, Preserve)
- {
- PRS, 256
- }
- Method(PRSC, 0) {
- // Local5 = active cpu bitmap
- Store (PRS, Local5)
- // Local2 = last read byte from bitmap
- Store (Zero, Local2)
- // Local0 = Processor ID / APIC ID iterator
- Store (Zero, Local0)
- While (LLess(Local0, SizeOf(CPON))) {
- // Local1 = CPON flag for this cpu
- Store(DerefOf(Index(CPON, Local0)), Local1)
- If (And(Local0, 0x07)) {
- // Shift down previously read bitmap byte
- ShiftRight(Local2, 1, Local2)
- } Else {
- // Read next byte from cpu bitmap
- Store(DerefOf(Index(Local5, ShiftRight(Local0, 3))), Local2)
- }
- // Local3 = active state for this cpu
- Store(And(Local2, 1), Local3)
-
- If (LNotEqual(Local1, Local3)) {
- // State change - update CPON with new state
- Store(Local3, Index(CPON, Local0))
- // Do CPU notify
- If (LEqual(Local3, 1)) {
- NTFY(Local0, 1)
- } Else {
- NTFY(Local0, 3)
- }
- }
- Increment(Local0)
- }
- }
- }
-
+#include "acpi-dsdt-cpu-hotplug.dsl"
/****************************************************************
* General purpose events
--
1.7.1
7 years