From b5bc8fc8ab0227f3b78156f49bf6989ae995a83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 23 Aug 2010 19:11:46 +0000 Subject: [PATCH] pci: Add stub support for grackle (ppc) A grackle-compatible Motorola MPC106 PCI controller can be found in the PowerMac G3 (ticket #6247). For now just let the user know. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38323 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/bus_managers/pci/arch/ppc/Jamfile | 1 + .../pci/arch/ppc/openfirmware/grackle.cpp | 78 +++++++++++++++++++ .../ppc/openfirmware/pci_openfirmware.cpp | 1 + .../ppc/openfirmware/pci_openfirmware_priv.h | 2 + 4 files changed, 82 insertions(+) create mode 100644 src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/grackle.cpp 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