PCI Express Port Bus Driver
Subsystems (2)
Hi Greg,
Thanks for your inputs. To reflect your inputs, the update patch below includes the following changes:
@@ -3,7 +3,7 @@
#
config PCIEPORTBUS
bool "PCI Express support"
- depends on PCI_GOMMCONFIG
+ depends on PCI_GOMMCONFIG || PCI_GOANY
default n
@@ -21,7 +21,7 @@ static int pcie_port_bus_suspend(struct
static int pcie_port_bus_resume(struct device *dev);
struct bus_type pcie_port_bus_type = {
- .name = "PCIE port bus",
+ .name = "pci_express",
.match = pcie_port_bus_match,
.suspend = pcie_port_bus_suspend,
.resume = pcie_port_bus_resume,
Please send us any suggestions or comments.
--------------------------------------------------------------------
arch/i386/Kconfig +2 -0
@@ -1117,6 +1117,8 @@ config PCI_MMCONFIG select ACPI_BOOT default y +source "drivers/pcieport/Kconfig" + source "drivers/pci/Kconfig" config ISA
Documentation/PCIEBUS-HOWTO.txt +217 -0
217 lines not on this page · raw message
drivers/Makefile +1 -0
@@ -54,6 +54,7 @@ obj-$(CONFIG_W1) += w1/ obj-$(CONFIG_PHONE) += telephony/ obj-$(CONFIG_MD) += md/ obj-$(CONFIG_BT) += bluetooth/ +obj-$(CONFIG_PCIEPORTBUS) += pcieport/ obj-$(CONFIG_ISDN) += isdn/ obj-$(CONFIG_MCA) += mca/ obj-$(CONFIG_EISA) += eisa/
drivers/pci/hotplug/Kconfig +0 -21
@@ -134,27 +134,6 @@ config HOTPLUG_PCI_CPCI_GENERIC When in doubt, say N. -config HOTPLUG_PCI_PCIE - tristate "PCI Express Hotplug driver" - depends on HOTPLUG_PCI - help - Say Y here if you have a motherboard that supports PCI Express Native - Hotplug - - To compile this driver as a module, choose M here: the - module will be called pciehp. - - When in doubt, say N. - -config HOTPLUG_PCI_PCIE_POLL_EVENT_MODE - bool "Use polling mechanism for hot-plug events (for testing purpose)" - depends on HOTPLUG_PCI_PCIE - help - Say Y here if you want to use the polling mechanism for hot-plug - events for early platform testing. - - When in doubt, say N. - config HOTPLUG_PCI_SHPC tristate "SHPC PCI Hotplug driver" depends on HOTPLUG_PCI
drivers/pci/hotplug/pciehp_core.c +55 -28
132 lines not on this page · raw message
drivers/pci/hotplug/pciehp.h +2 -1
@@ -34,6 +34,7 @@#include <linux/delay.h> #include <asm/semaphore.h> #include <asm/io.h> +#include <linux/pcieport_if.h> #include "pci_hotplug.h" #define MY_NAME "pciehp"
@@ -311,7 +312,7 @@ enum php_ctlr_type {typedef u8 (*php_intr_callback_t ) (unsigned int change_id,void *instance_id); -int pcie_init(struct controller *ctrl, struct pci_dev *pdev, +int pcie_init(struct controller *ctrl, struct pcie_device *dev, php_intr_callback_t attention_button_callback, php_intr_callback_t switch_change_callback, php_intr_callback_t presence_change_callback,
drivers/pci/hotplug/pciehp_hpc.c +6 -15
@@ -1249,7 +1249,7 @@ static struct hpc_ops pciehp_hpc_ops = { }; int pcie_init(struct controller * ctrl, - struct pci_dev *pdev, + struct pcie_device *dev, php_intr_callback_t attention_button_callback, php_intr_callback_t switch_change_callback, php_intr_callback_t presence_change_callback,
@@ -1265,6 +1265,7 @@ int pcie_init(struct controller * ctrl,u32 slot_cap;int cap_base, saved_cap_base;u16 slot_status, slot_ctrl; +struct pci_dev *pdev;DBG_ENTER_ROUTINE
@@ -1277,7 +1278,8 @@ int pcie_init(struct controller * ctrl, }memset (php_ctlr,0 ,sizeof (struct php_ctlr_state_s )); - + + pdev = dev->port; php_ctlr->pci_dev = pdev;/* save pci_dev in context */ dbg("%s: pdev->vendor %x pdev->device %x\n", __FUNCTION__,
@@ -1338,7 +1340,7 @@ int pcie_init(struct controller * ctrl, }dbg ("pdev = %p: b:d:f:irq=0x%x:%x:%x:%x\n" , pdev, pdev->bus->number, -PCI_SLOT (pdev->devfn),PCI_FUNC (pdev->devfn), pdev->irq); +PCI_SLOT (pdev->devfn),PCI_FUNC (pdev->devfn), dev->irq);for ( rc =0 ; rc <DEVICE_COUNT_RESOURCE ; rc++)if (pci_resource_len (pdev, rc) >0 ) dbg("pci resource[%d] start=0x%lx(len=0x%lx)\n", rc,
@@ -1355,7 +1357,7 @@ int pcie_init(struct controller * ctrl,init_waitqueue_head (&ctrl->queue);/* find the IRQ */ - php_ctlr->irq = pdev->irq; + php_ctlr->irq = dev->irq;dbg ("HPC interrupt = %d\n" , php_ctlr->irq);/* Save interrupt callback info */
@@ -1407,17 +1409,6 @@ int pcie_init(struct controller * ctrl,start_int_poll_timer ( php_ctlr,10 );/* start with 10 second delay */ }else {/* Installs the interrupt handler */ -dbg ("%s: pcie_mch_quirk = %x\n" , __FUNCTION__, pcie_mch_quirk); -if (!pcie_mch_quirk) { - rc =pci_enable_msi (pdev); -if (rc) { -info ("Can't get msi for the hotplug controller\n" ); -info ("Use INTx for the hotplug controller\n" ); -dbg ("%s: rc = %x\n" , __FUNCTION__, rc); - }else - php_ctlr->irq = pdev->irq; - } - rc =request_irq (php_ctlr->irq, pcie_isr,SA_SHIRQ ,MY_NAME , (void *) ctrl);dbg ("%s: request_irq %d for hpc%d (returns %d)\n" , __FUNCTION__, php_ctlr->irq, ctlr_seq_num, rc);if (rc) {
drivers/pcieport/Kconfig +38 -0
@@ -0,0 +1,38 @@ +# +# PCI Express Port Bus Configuration +# +config PCIEPORTBUS + bool "PCI Express support" + depends on PCI_GOMMCONFIG || PCI_GOANY + default n + + ---help--- + This automatically enables PCI Express Port Bus support. Users can + choose Native Hot-Plug support, Advanced Error Reporting support, + Power Management Event support and Virtual Channel support to run + on PCI Express Ports (Root or Switch). + +# +# Include service Kconfig here +# +config HOTPLUG_PCI_PCIE + tristate "PCI Express Hotplug driver" + depends on HOTPLUG_PCI && PCIEPORTBUS + help + Say Y here if you have a motherboard that supports PCI Express Native + Hotplug + + To compile this driver as a module, choose M here: the + module will be called pciehp. + + When in doubt, say N. + +config HOTPLUG_PCI_PCIE_POLL_EVENT_MODE + bool "Use polling mechanism for hot-plug events (for testing purpose)" + depends on HOTPLUG_PCI_PCIE + help + Say Y here if you want to use the polling mechanism for hot-plug + events for early platform testing. + + When in doubt, say N. +
drivers/pcieport/Makefile +7 -0
@@ -0,0 +1,7 @@ +# +# Makefile for PCI-Express PORT Driver +# + +pcieportdrv-y := portdrv_core.o portdrv_pci.o portdrv_bus.o + +obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o
drivers/pcieport/portdrv_bus.c +88 -0
88 lines not on this page · raw message
drivers/pcieport/portdrv_core.c +453 -0
453 lines not on this page · raw message
drivers/pcieport/portdrv.h +42 -0
42 lines not on this page · raw message
drivers/pcieport/portdrv_pci.c +138 -0
138 lines not on this page · raw message
include/linux/pcieport_if.h +74 -0
74 lines not on this page · raw message
Any reason the new files aren't just under drivers/pci/ ?