diff options
author | Rajiv Andrade <srajiv@linux.vnet.ibm.com> | 2010-05-04 17:49:20 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-05-04 19:59:57 -0400 |
commit | b89e66e1e396f7b5436af154e58209320cc08aed (patch) | |
tree | c966432f8e7bcc40f977546306b63beb0f8599fb | |
parent | fcaaade1db63bb2d6f7611d7824eb50d2f07a546 (diff) |
TPM: ACPI/PNP dependency removal
This patch pushes the ACPI dependency into the device driver code
itself. Now, even without ACPI/PNP enabled, the device can be registered
using the TIS specified memory space. This will however result in the
lack of access to the bios event log, being the only implication of such
ACPI removal.
Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
-rw-r--r-- | drivers/char/tpm/Kconfig | 14 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_tis.c | 40 |
2 files changed, 32 insertions, 22 deletions
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig index f5fc64f89c5c..bfc2c26780fb 100644 --- a/drivers/char/tpm/Kconfig +++ b/drivers/char/tpm/Kconfig | |||
@@ -17,20 +17,28 @@ menuconfig TCG_TPM | |||
17 | obtained at: <http://sourceforge.net/projects/trousers>. To | 17 | obtained at: <http://sourceforge.net/projects/trousers>. To |
18 | compile this driver as a module, choose M here; the module | 18 | compile this driver as a module, choose M here; the module |
19 | will be called tpm. If unsure, say N. | 19 | will be called tpm. If unsure, say N. |
20 | Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI | 20 | Note: For more TPM drivers and BIOS LOG access enable |
21 | and CONFIG_PNPACPI. | 21 | CONFIG_PNP, CONFIG_ACPI and CONFIG_PNPACPI. |
22 | 22 | ||
23 | if TCG_TPM | 23 | if TCG_TPM |
24 | 24 | ||
25 | config TCG_TIS | 25 | config TCG_TIS |
26 | tristate "TPM Interface Specification 1.2 Interface" | 26 | tristate "TPM Interface Specification 1.2 Interface" |
27 | depends on PNP | ||
28 | ---help--- | 27 | ---help--- |
29 | If you have a TPM security chip that is compliant with the | 28 | If you have a TPM security chip that is compliant with the |
30 | TCG TIS 1.2 TPM specification say Yes and it will be accessible | 29 | TCG TIS 1.2 TPM specification say Yes and it will be accessible |
31 | from within Linux. To compile this driver as a module, choose | 30 | from within Linux. To compile this driver as a module, choose |
32 | M here; the module will be called tpm_tis. | 31 | M here; the module will be called tpm_tis. |
33 | 32 | ||
33 | config TCG_BIOS_LOG | ||
34 | bool "TPM bios mesurement log" | ||
35 | depends on X86 | ||
36 | select ACPI | ||
37 | ---help--- | ||
38 | ACPI is required for access to bios measurements lists and therefore | ||
39 | to validate the PCR[0] value. So say Yes in case you want this | ||
40 | feature and, consequently, ACPI will be enabled. | ||
41 | |||
34 | config TCG_NSC | 42 | config TCG_NSC |
35 | tristate "National Semiconductor TPM Interface" | 43 | tristate "National Semiconductor TPM Interface" |
36 | ---help--- | 44 | ---help--- |
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 2405f17b29dd..04a18bffb730 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -597,7 +597,7 @@ out_err: | |||
597 | tpm_remove_hardware(chip->dev); | 597 | tpm_remove_hardware(chip->dev); |
598 | return rc; | 598 | return rc; |
599 | } | 599 | } |
600 | 600 | #ifdef CONFIG_PNP | |
601 | static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, | 601 | static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, |
602 | const struct pnp_device_id *pnp_id) | 602 | const struct pnp_device_id *pnp_id) |
603 | { | 603 | { |
@@ -662,7 +662,7 @@ static struct pnp_driver tis_pnp_driver = { | |||
662 | module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id, | 662 | module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id, |
663 | sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444); | 663 | sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444); |
664 | MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe"); | 664 | MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe"); |
665 | 665 | #endif | |
666 | static int tpm_tis_suspend(struct platform_device *dev, pm_message_t msg) | 666 | static int tpm_tis_suspend(struct platform_device *dev, pm_message_t msg) |
667 | { | 667 | { |
668 | return tpm_pm_suspend(&dev->dev, msg); | 668 | return tpm_pm_suspend(&dev->dev, msg); |
@@ -689,21 +689,21 @@ MODULE_PARM_DESC(force, "Force device probe rather than using ACPI entry"); | |||
689 | static int __init init_tis(void) | 689 | static int __init init_tis(void) |
690 | { | 690 | { |
691 | int rc; | 691 | int rc; |
692 | #ifdef CONFIG_PNP | ||
693 | if (!force) | ||
694 | return pnp_register_driver(&tis_pnp_driver); | ||
695 | #endif | ||
692 | 696 | ||
693 | if (force) { | 697 | rc = platform_driver_register(&tis_drv); |
694 | rc = platform_driver_register(&tis_drv); | 698 | if (rc < 0) |
695 | if (rc < 0) | ||
696 | return rc; | ||
697 | if (IS_ERR(pdev=platform_device_register_simple("tpm_tis", -1, NULL, 0))) | ||
698 | return PTR_ERR(pdev); | ||
699 | if((rc=tpm_tis_init(&pdev->dev, TIS_MEM_BASE, TIS_MEM_LEN, 0)) != 0) { | ||
700 | platform_device_unregister(pdev); | ||
701 | platform_driver_unregister(&tis_drv); | ||
702 | } | ||
703 | return rc; | 699 | return rc; |
700 | if (IS_ERR(pdev=platform_device_register_simple("tpm_tis", -1, NULL, 0))) | ||
701 | return PTR_ERR(pdev); | ||
702 | if((rc=tpm_tis_init(&pdev->dev, TIS_MEM_BASE, TIS_MEM_LEN, 0)) != 0) { | ||
703 | platform_device_unregister(pdev); | ||
704 | platform_driver_unregister(&tis_drv); | ||
704 | } | 705 | } |
705 | 706 | return rc; | |
706 | return pnp_register_driver(&tis_pnp_driver); | ||
707 | } | 707 | } |
708 | 708 | ||
709 | static void __exit cleanup_tis(void) | 709 | static void __exit cleanup_tis(void) |
@@ -727,12 +727,14 @@ static void __exit cleanup_tis(void) | |||
727 | list_del(&i->list); | 727 | list_del(&i->list); |
728 | } | 728 | } |
729 | spin_unlock(&tis_lock); | 729 | spin_unlock(&tis_lock); |
730 | 730 | #ifdef CONFIG_PNP | |
731 | if (force) { | 731 | if (!force) { |
732 | platform_device_unregister(pdev); | ||
733 | platform_driver_unregister(&tis_drv); | ||
734 | } else | ||
735 | pnp_unregister_driver(&tis_pnp_driver); | 732 | pnp_unregister_driver(&tis_pnp_driver); |
733 | return; | ||
734 | } | ||
735 | #endif | ||
736 | platform_device_unregister(pdev); | ||
737 | platform_driver_unregister(&tis_drv); | ||
736 | } | 738 | } |
737 | 739 | ||
738 | module_init(init_tis); | 740 | module_init(init_tis); |