This patch series introduce ACPI support for AHCI platform driver.
Existing ACPI support for AHCI assumes the device controller is a PCI device.
Since there is no ACPI _CID for generic AHCI controller, the driver
could not use it for matching devices. Therefore, this patch introduces
a mechanism for drivers to match devices using ACPI _CLS method.
_CLS contains PCI-defined class-code.
This patch series also modifies ACPI modalias to add class-code to the
exisiting format, which currently only uses _HID and _CIDs. This is required
to support loadable modules w/ _CLS.
This is rebased from and tested with:
http://git.linaro.org/leg/acpi/acpi.git acpi-5.1-v11
This topic was discussed earlier here (as part of introducing support for
AMD Seattle SATA controller):
http://marc.info/?l=linux-arm-kernel&m=141083492521584&w=2
Changes from V5 (https://lkml.org/lkml/2015/3/6/24)
* Rebased and tested with acpi-5.1-v11
* Splitting up the ACPICA changes into a separate patch [1/3].
(per Mika suggestion)
* Adding class-code mask support (per Mika suggestion)
* Use macro to define struct acpi_device_id entry (per Mika suggestion)
* Note: Mika also recommend reordering the member of struct acpi_device_id
and define a macro to be used for declaring each table entry. This is a
large amount of changes, and will be done separtely from this patch series.
Changes from V4 (https://lkml.org/lkml/2015/3/2/56)
* [1/2] Bug fixed: Reorder the declaration of
struct acpi_pnp_device_id cls in the struct acpi_device_info
(include/acpi/actypes.h) since compatible_id_list must be last one.
* [2/2] Added Acked-by: Tejun Heo <tj(a)kernel.org>
Changes from V3 (https://lkml.org/lkml/2015/2/8/106)
* Instead of introducing new structure acpi_device_cls, add cls into
the acpi_device_id, and modify the __acpi_match_device
to also match for cls. (per Mika suggestion.)
* Add loadable module support, which requires changes in ACPI
modalias. (per Mika suggestion.)
* Rebased and tested with acpi-5.1-v9
Changes from V2 (https://lkml.org/lkml/2015/1/5/662)
* Update with review comment from Rafael in patch 1/2
* Rebased and tested with acpi-5.1-v8
Changes from V1 (https://lkml.org/lkml/2014/12/19/345)
* Rebased to 3.19.0-rc2
* Change from acpi_cls in device_driver to acpi_match_cls (Hanjun comment)
* Change the matching logic in acpi_driver_match_device() due to the new
special PRP0001 _HID.
* Simplify the return type of acpi_match_device_cls() to boolean.
Changes from RFC (https://lkml.org/lkml/2014/12/17/446)
* Remove #ifdef and make non-ACPI version of the acpi_match_device_cls
as inline. (per Arnd)
* Simplify logic to retrieve and evaluate _CLS handle. (per Hanjun)
Suravee Suthikulpanit (3):
ACPICA: Add ACPI _CLS processing
ACPI / scan: Add support for ACPI _CLS device matching
ata: ahci_platform: Add ACPI _CLS matching
drivers/acpi/acpica/acutils.h | 3 ++
drivers/acpi/acpica/nsxfname.c | 21 ++++++++++--
drivers/acpi/acpica/utids.c | 71 +++++++++++++++++++++++++++++++++++++++
drivers/acpi/scan.c | 39 ++++++++++++++++++---
drivers/ata/Kconfig | 2 +-
drivers/ata/ahci_platform.c | 9 +++++
include/acpi/acnames.h | 1 +
include/acpi/actypes.h | 4 ++-
include/linux/mod_devicetable.h | 4 +++
scripts/mod/devicetable-offsets.c | 2 ++
scripts/mod/file2alias.c | 32 ++++++++++++++++--
11 files changed, 178 insertions(+), 10 deletions(-)
--
2.1.0
This patch series introduce ACPI support for AHCI platform driver.
Existing ACPI support for AHCI assumes the device controller is a PCI device.
Since there is no ACPI _CID for generic AHCI controller, the driver
could not use it for matching devices. Therefore, this patch introduces
a mechanism for drivers to match devices using ACPI _CLS method.
_CLS contains PCI-defined class-code.
This patch series also modifies ACPI modalias to add class-code to the
exisiting format, which currently only uses _HID and _CIDs. This is required
to support loadable modules w/ _CLS.
This patch series is rebased from and tested with:
http://git.linaro.org/leg/acpi/acpi.git acpi-5.1-v9
This topic was discussed earlier here (as part of introducing support for
AMD Seattle SATA controller):
http://marc.info/?l=linux-arm-kernel&m=141083492521584&w=2
Changes from V4 (https://lkml.org/lkml/2015/3/2/56)
* [1/2] Bug fixed: Reorder the declaration of
struct acpi_pnp_device_id cls in the struct acpi_device_info
(include/acpi/actypes.h) since compatible_id_list must be last one.
* [2/2] Added Acked-by: Tejun Heo <tj(a)kernel.org>
Changes from V3 (https://lkml.org/lkml/2015/2/8/106)
* Instead of introducing new structure acpi_device_cls, add cls into
the acpi_device_id, and modify the __acpi_match_device
to also match for cls. (per Mika suggestion.)
* Add loadable module support, which requires changes in ACPI
modalias. (per Mika suggestion.)
* Rebased and tested with acpi-5.1-v9
Changes from V2 (https://lkml.org/lkml/2015/1/5/662)
* Update with review comment from Rafael in patch 1/2
* Rebased and tested with acpi-5.1-v8
Changes from V1 (https://lkml.org/lkml/2014/12/19/345)
* Rebased to 3.19.0-rc2
* Change from acpi_cls in device_driver to acpi_match_cls (Hanjun comment)
* Change the matching logic in acpi_driver_match_device() due to the new
special PRP0001 _HID.
* Simplify the return type of acpi_match_device_cls() to boolean.
Changes from RFC (https://lkml.org/lkml/2014/12/17/446)
* Remove #ifdef and make non-ACPI version of the acpi_match_device_cls
as inline. (per Arnd)
* Simplify logic to retrieve and evaluate _CLS handle. (per Hanjun)
Suravee Suthikulpanit (2):
ACPI / scan: Add support for ACPI _CLS device matching
ata: ahci_platform: Add ACPI _CLS matching
drivers/acpi/acpica/acutils.h | 3 ++
drivers/acpi/acpica/nsxfname.c | 21 ++++++++++--
drivers/acpi/acpica/utids.c | 71 +++++++++++++++++++++++++++++++++++++++
drivers/acpi/scan.c | 17 ++++++++--
drivers/ata/Kconfig | 2 +-
drivers/ata/ahci_platform.c | 9 +++++
include/acpi/acnames.h | 1 +
include/acpi/actypes.h | 4 ++-
include/linux/mod_devicetable.h | 1 +
scripts/mod/devicetable-offsets.c | 1 +
scripts/mod/file2alias.c | 13 +++++--
11 files changed, 134 insertions(+), 9 deletions(-)
--
2.1.0
Hi Al,
I have been using the firmware, version 1.1.0-rh-0.14-linaro-5 built at
08:49:30 on Feb 12 2015.
With acpi=force the boot hangs. Do I need to upgrade the firmware?
Itaru
>The default on Fedora is notACPI; useacpi=force and it should work.
>You will also need to make sure you have the latest version of the Mustang
>firmware.
>
>You can find kernel source here:
>
> hhttp://git.fedorahosted.org/git/kernel-arm64.git
<http://git.fedorahosted.org/git/kernel-arm64.git>
>
>This is the kernel I use on my Fedora-based Mustang.
From: Graeme Gregory <graeme.gregory(a)linaro.org>
ACPI 5.1 does not currently support S states for ARM64 hardware but
ACPI code will call acpi_target_system_state() and acpi_sleep_init()
for device power management, so introduce
CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT and select it for x86 and
ia64 only to make sleep functions available, and also introduce stub
function to allow other drivers to function until S states are defined
for ARM64.
It will be no functional change for x86 and IA64.
Suggested-by: Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
Signed-off-by: Graeme Gregory <graeme.gregory(a)linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki(a)linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
---
Hi Lorenzo,
Since this patch only updated the config name with no fucntion
change, I assume your ACK still apply, if not, please let me
know.
Thanks
Hanjun
---
arch/ia64/Kconfig | 1 +
arch/x86/Kconfig | 1 +
drivers/acpi/Kconfig | 4 ++++
drivers/acpi/Makefile | 2 +-
drivers/acpi/internal.h | 4 ++++
5 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 074e52b..cc3414f 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -10,6 +10,7 @@ config IA64
select ARCH_MIGHT_HAVE_PC_SERIO
select PCI if (!IA64_HP_SIM)
select ACPI if (!IA64_HP_SIM)
+ select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
select HAVE_UNSTABLE_SCHED_CLOCK
select HAVE_IDE
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b7d31ca..c3ea9f9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -22,6 +22,7 @@ config X86_64
### Arch settings
config X86
def_bool y
+ select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
select ARCH_HAS_FAST_MULTIPLIER
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index e6c3ddd..a726381 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -48,9 +48,13 @@ config ACPI_LEGACY_TABLES_LOOKUP
config ARCH_MIGHT_HAVE_ACPI_PDC
bool
+config ACPI_SYSTEM_POWER_STATES_SUPPORT
+ bool
+
config ACPI_SLEEP
bool
depends on SUSPEND || HIBERNATION
+ depends on ACPI_SYSTEM_POWER_STATES_SUPPORT
default y
config ACPI_PROCFS_POWER
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 623b117..db153c6 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -23,7 +23,7 @@ acpi-y += nvs.o
# Power management related files
acpi-y += wakeup.o
-acpi-y += sleep.o
+acpi-$(CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT) += sleep.o
acpi-y += device_pm.o
acpi-$(CONFIG_ACPI_SLEEP) += proc.o
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 56b321a..ba4a61e 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -161,7 +161,11 @@ void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit);
/*--------------------------------------------------------------------------
Suspend/Resume
-------------------------------------------------------------------------- */
+#ifdef CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT
extern int acpi_sleep_init(void);
+#else
+static inline int acpi_sleep_init(void) { return -ENXIO; }
+#endif
#ifdef CONFIG_ACPI_SLEEP
int acpi_sleep_proc_init(void);
--
1.9.1
The leg-kernel release has been made and tagged as leg-20150318.0
This is based on mainline kernel v4.0-rc4
Repository : http://git.linaro.org/leg/acpi/leg-kernel.git
Direct Link:
https://git.linaro.org/leg/acpi/leg-kernel.git/commit/9c397babcfc590123c904…
Notes :-
1) This release restores support for AMD Seattle.
2) This release incorporates the SBSA UART support for pl011 driver from
Andre Przywara. This means that your console will become ttyAMA0
(console=ttyAMA0) on Juno/FVP. It also means to run FVP model you need
these options :-
-C bp.pl011_uart0.untimed_fifos=0
-C bp.pl011_uart0.revision="r1p5"
From: Graeme Gregory <graeme.gregory(a)linaro.org>
ACPI 5.1 does not currently support S states for ARM64 hardware but
ACPI code will call acpi_target_system_state() and acpi_sleep_init()
for device power management, so introduce CONFIG_ACPI_GENERIC_SLEEP
and select it for x86 and ia64 only to make sleep functions available,
and also introduce stub function to allow other drivers to function
until S states are defined for ARM64.
It will be no functional change for x86 and IA64.
CC: Rafael J. Wysocki <rjw(a)rjwysocki.net>
Suggested-by: Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
Acked-by: Robert Richter <rrichter(a)cavium.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
Signed-off-by: Graeme Gregory <graeme.gregory(a)linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki(a)linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
---
arch/ia64/Kconfig | 1 +
arch/x86/Kconfig | 1 +
drivers/acpi/Kconfig | 4 ++++
drivers/acpi/Makefile | 2 +-
drivers/acpi/internal.h | 4 ++++
5 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 074e52b..e8728d7 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -10,6 +10,7 @@ config IA64
select ARCH_MIGHT_HAVE_PC_SERIO
select PCI if (!IA64_HP_SIM)
select ACPI if (!IA64_HP_SIM)
+ select ACPI_GENERIC_SLEEP if ACPI
select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
select HAVE_UNSTABLE_SCHED_CLOCK
select HAVE_IDE
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b7d31ca..9804431 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -22,6 +22,7 @@ config X86_64
### Arch settings
config X86
def_bool y
+ select ACPI_GENERIC_SLEEP if ACPI
select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
select ARCH_HAS_FAST_MULTIPLIER
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index e6c3ddd..a7b9120 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -48,9 +48,13 @@ config ACPI_LEGACY_TABLES_LOOKUP
config ARCH_MIGHT_HAVE_ACPI_PDC
bool
+config ACPI_GENERIC_SLEEP
+ bool
+
config ACPI_SLEEP
bool
depends on SUSPEND || HIBERNATION
+ depends on ACPI_GENERIC_SLEEP
default y
config ACPI_PROCFS_POWER
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 623b117..2397822 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -23,7 +23,7 @@ acpi-y += nvs.o
# Power management related files
acpi-y += wakeup.o
-acpi-y += sleep.o
+acpi-$(CONFIG_ACPI_GENERIC_SLEEP) += sleep.o
acpi-y += device_pm.o
acpi-$(CONFIG_ACPI_SLEEP) += proc.o
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 56b321a..6f08c85 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -161,7 +161,11 @@ void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit);
/*--------------------------------------------------------------------------
Suspend/Resume
-------------------------------------------------------------------------- */
+#ifdef CONFIG_ACPI_GENERIC_SLEEP
extern int acpi_sleep_init(void);
+#else
+static inline int acpi_sleep_init(void) { return -ENXIO; }
+#endif
#ifdef CONFIG_ACPI_SLEEP
int acpi_sleep_proc_init(void);
--
1.9.1
MCFG ACPI table and PCI ECAM standard have no arch dependencies so it can be
used across all architectures. Currently MMCONFIG related code resides in
arch/x86 directories. This patch set is going to isolate non-architecture
specific code and make it accessible for all architectures.
v2 -> v3 changes:
- rebase patch set v2 to v4.0-rc1
v1 -> v2 changes:
- use generic readb/readw etc. accessors instead of AMD Fam10h workaround
- separate ACPI and ECAM code
- improve ECAM code naming
Tomasz Nowicki (9):
x86, pci: Clean up comment about buggy MMIO config space access for
AMD Fam10h CPUs.
x86, pci: Abstract PCI config accessors and use AMD Fam10h workaround
exclusively.
x86, pci: Reorder logic of pci_mmconfig_insert() function
x86, pci, acpi: Move arch-agnostic MMCONFIG (aka ECAM) and ACPI code
out of arch/x86/ directory
pci, acpi, mcfg: Provide generic implementation of MCFG code
initialization.
x86, pci: mmconfig_{32,64}.c code refactoring - remove code
duplication.
x86, pci, ecam: mmconfig_64.c becomes default implementation for ECAM
driver.
pci, acpi, mcfg: Share ACPI PCI config space accessors.
pci, ecam: Improve naming for ecam.c content and areas where it is
used.
arch/x86/Kconfig | 3 +
arch/x86/include/asm/pci_x86.h | 34 +---
arch/x86/pci/Makefile | 5 +-
arch/x86/pci/acpi.c | 3 +-
arch/x86/pci/mmconfig-shared.c | 340 +++++++++++----------------------------
arch/x86/pci/mmconfig_32.c | 47 ++----
arch/x86/pci/mmconfig_64.c | 153 ------------------
arch/x86/pci/numachip.c | 27 +---
drivers/acpi/Makefile | 1 +
drivers/acpi/mcfg.c | 121 ++++++++++++++
drivers/pci/Kconfig | 7 +
drivers/pci/Makefile | 5 +
drivers/pci/ecam.c | 356 +++++++++++++++++++++++++++++++++++++++++
drivers/xen/pci.c | 6 +-
include/linux/ecam.h | 56 +++++++
15 files changed, 668 insertions(+), 496 deletions(-)
delete mode 100644 arch/x86/pci/mmconfig_64.c
create mode 100644 drivers/acpi/mcfg.c
create mode 100644 drivers/pci/ecam.c
create mode 100644 include/linux/ecam.h
--
1.9.1
Hi,
I am wondering if someone on this list have a Fedora kernel that has
ACPI enabled.
I have access to Mustang, on which ACPI is verified to work, currently
using Fedora 21,
no ACPI support is enabled.
Itaru