diff --git a/src/add-ons/kernel/bus_managers/pci/arch/ppc/Jamfile b/src/add-ons/kernel/bus_managers/pci/arch/ppc/Jamfile index 3e012e3845..99e04130f6 100644 --- a/src/add-ons/kernel/bus_managers/pci/arch/ppc/Jamfile +++ b/src/add-ons/kernel/bus_managers/pci/arch/ppc/Jamfile @@ -13,4 +13,5 @@ KernelStaticLibrary pci_arch_bus_manager : # openfirmware pci_openfirmware.cpp uninorth.cpp + grackle.cpp ; diff --git a/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/grackle.cpp b/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/grackle.cpp new file mode 100644 index 0000000000..b1795b671e --- /dev/null +++ b/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/grackle.cpp @@ -0,0 +1,78 @@ +/* + * Copyright 2010 Andreas Färber + * All rights reserved. Distributed under the terms of the MIT License. + */ + + +#include + +#include +#include +#include + +#include "pci_controller.h" +#include "pci_io.h" +#include "pci_openfirmware_priv.h" + + +static status_t +grackle_read_pci_config(void *cookie, uint8 bus, uint8 device, uint8 function, + uint8 offset, uint8 size, uint32 *value) +{ + return B_ERROR; +} + + +static status_t +grackle_write_pci_config(void *cookie, uint8 bus, uint8 device, uint8 function, + uint8 offset, uint8 size, uint32 value) +{ + return B_ERROR; +} + + +static status_t +grackle_get_max_bus_devices(void *cookie, int32 *count) +{ + *count = 0; + return B_OK; +} + + +static status_t +grackle_read_pci_irq(void *cookie, uint8 bus, uint8 device, uint8 function, + uint8 pin, uint8 *irq) +{ + return B_ERROR; +} + + +static status_t +grackle_write_pci_irq(void *cookie, uint8 bus, uint8 device, uint8 function, + uint8 pin, uint8 irq) +{ + return B_ERROR; +} + + +static pci_controller sGracklePCIController = { + grackle_read_pci_config, + grackle_write_pci_config, + grackle_get_max_bus_devices, + grackle_read_pci_irq, + grackle_write_pci_irq, +}; + + +status_t +ppc_openfirmware_probe_grackle(int deviceNode, + const StringArrayPropertyValue &compatibleValue) +{ + if (!compatibleValue.ContainsElement("grackle")) + return B_ERROR; + + panic("ppc_openfirmware_probe_grackle(): not implemented yet\n"); + + status_t error = pci_controller_add(&sGracklePCIController, NULL); + return error; +} diff --git a/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware.cpp b/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware.cpp index 1e624a703a..4c361f68db 100644 --- a/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware.cpp +++ b/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware.cpp @@ -21,6 +21,7 @@ typedef status_t (*probeFunction)(int, const StringArrayPropertyValue&); static const probeFunction sProbeFunctions[] = { ppc_openfirmware_probe_uninorth, + ppc_openfirmware_probe_grackle, NULL, }; diff --git a/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware_priv.h b/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware_priv.h index a32a959f82..10392a70d8 100644 --- a/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware_priv.h +++ b/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware_priv.h @@ -19,6 +19,8 @@ struct StringArrayPropertyValue; status_t ppc_openfirmware_probe_uninorth(int deviceNode, const StringArrayPropertyValue &compatibleValue); +status_t ppc_openfirmware_probe_grackle(int deviceNode, + const StringArrayPropertyValue &compatibleValue); // property support