[haiku-commits] r38323 - in haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc: . openfirmware

  • From: andreas.faerber@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 23 Aug 2010 21:11:46 +0200 (CEST)

Author: andreasf
Date: 2010-08-23 21:11:46 +0200 (Mon, 23 Aug 2010)
New Revision: 38323
Changeset: http://dev.haiku-os.org/changeset/38323
Ticket: http://dev.haiku-os.org/ticket/6247

Added:
   
haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/grackle.cpp
Modified:
   haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/Jamfile
   
haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware.cpp
   
haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware_priv.h
Log:
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.


Modified: haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/Jamfile    
2010-08-23 15:17:49 UTC (rev 38322)
+++ haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/Jamfile    
2010-08-23 19:11:46 UTC (rev 38323)
@@ -13,4 +13,5 @@
        # openfirmware
        pci_openfirmware.cpp
        uninorth.cpp
+       grackle.cpp
 ;

Added: 
haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/grackle.cpp
===================================================================
--- 
haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/grackle.cpp
                           (rev 0)
+++ 
haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/grackle.cpp
   2010-08-23 19:11:46 UTC (rev 38323)
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2010 Andreas Färber <andreas.faerber@xxxxxx>
+ * All rights reserved. Distributed under the terms of the MIT License.
+ */
+
+
+#include <KernelExport.h>
+
+#include <platform/openfirmware/devices.h>
+#include <platform/openfirmware/openfirmware.h>
+#include <platform/openfirmware/pci.h>
+
+#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;
+}

Modified: 
haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware.cpp
===================================================================
--- 
haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware.cpp
  2010-08-23 15:17:49 UTC (rev 38322)
+++ 
haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware.cpp
  2010-08-23 19:11:46 UTC (rev 38323)
@@ -21,6 +21,7 @@
 
 static const probeFunction sProbeFunctions[] = {
        ppc_openfirmware_probe_uninorth,
+       ppc_openfirmware_probe_grackle,
        NULL,
 };
 

Modified: 
haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware_priv.h
===================================================================
--- 
haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware_priv.h
       2010-08-23 15:17:49 UTC (rev 38322)
+++ 
haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc/openfirmware/pci_openfirmware_priv.h
       2010-08-23 19:11:46 UTC (rev 38323)
@@ -19,6 +19,8 @@
 
 status_t       ppc_openfirmware_probe_uninorth(int deviceNode,
                                const StringArrayPropertyValue 
&compatibleValue);
+status_t       ppc_openfirmware_probe_grackle(int deviceNode,
+                               const StringArrayPropertyValue 
&compatibleValue);
 
 
 // property support


Other related posts:

  • » [haiku-commits] r38323 - in haiku/trunk/src/add-ons/kernel/bus_managers/pci/arch/ppc: . openfirmware - andreas . faerber