powerpc/cell: Move controller ops from ppc_md to controller_ops
This moves the Cell platform to use the pci_controller_ops structure rather than ppc_md for PCI controller operations. Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
97884e00e2
commit
9c1368fc50
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
* Cell Platform common data structures
|
||||||
|
*
|
||||||
|
* Copyright 2015, Daniel Axtens, IBM Corporation
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CELL_H
|
||||||
|
#define CELL_H
|
||||||
|
|
||||||
|
#include <asm/pci-bridge.h>
|
||||||
|
|
||||||
|
extern struct pci_controller_ops cell_pci_controller_ops;
|
||||||
|
|
||||||
|
#endif
|
|
@ -39,6 +39,7 @@
|
||||||
#include <asm/firmware.h>
|
#include <asm/firmware.h>
|
||||||
#include <asm/cell-regs.h>
|
#include <asm/cell-regs.h>
|
||||||
|
|
||||||
|
#include "cell.h"
|
||||||
#include "interrupt.h"
|
#include "interrupt.h"
|
||||||
|
|
||||||
/* Define CELL_IOMMU_REAL_UNMAP to actually unmap non-used pages
|
/* Define CELL_IOMMU_REAL_UNMAP to actually unmap non-used pages
|
||||||
|
@ -857,7 +858,7 @@ static int __init cell_iommu_init_disabled(void)
|
||||||
cell_dma_direct_offset += base;
|
cell_dma_direct_offset += base;
|
||||||
|
|
||||||
if (cell_dma_direct_offset != 0)
|
if (cell_dma_direct_offset != 0)
|
||||||
ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup;
|
cell_pci_controller_ops.dma_dev_setup = cell_pci_dma_dev_setup;
|
||||||
|
|
||||||
printk("iommu: disabled, direct DMA offset is 0x%lx\n",
|
printk("iommu: disabled, direct DMA offset is 0x%lx\n",
|
||||||
cell_dma_direct_offset);
|
cell_dma_direct_offset);
|
||||||
|
@ -1197,8 +1198,8 @@ static int __init cell_iommu_init(void)
|
||||||
if (cell_iommu_init_disabled() == 0)
|
if (cell_iommu_init_disabled() == 0)
|
||||||
goto bail;
|
goto bail;
|
||||||
|
|
||||||
/* Setup various ppc_md. callbacks */
|
/* Setup various callbacks */
|
||||||
ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup;
|
cell_pci_controller_ops.dma_dev_setup = cell_pci_dma_dev_setup;
|
||||||
ppc_md.dma_get_required_mask = cell_dma_get_required_mask;
|
ppc_md.dma_get_required_mask = cell_dma_get_required_mask;
|
||||||
ppc_md.tce_build = tce_build_cell;
|
ppc_md.tce_build = tce_build_cell;
|
||||||
ppc_md.tce_free = tce_free_cell;
|
ppc_md.tce_free = tce_free_cell;
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
#include <asm/cell-regs.h>
|
#include <asm/cell-regs.h>
|
||||||
#include <asm/io-workarounds.h>
|
#include <asm/io-workarounds.h>
|
||||||
|
|
||||||
|
#include "cell.h"
|
||||||
#include "interrupt.h"
|
#include "interrupt.h"
|
||||||
#include "pervasive.h"
|
#include "pervasive.h"
|
||||||
#include "ras.h"
|
#include "ras.h"
|
||||||
|
@ -131,6 +132,8 @@ static int cell_setup_phb(struct pci_controller *phb)
|
||||||
if (model == NULL || strcmp(np->name, "pci"))
|
if (model == NULL || strcmp(np->name, "pci"))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
phb->controller_ops = cell_pci_controller_ops;
|
||||||
|
|
||||||
/* Setup workarounds for spider */
|
/* Setup workarounds for spider */
|
||||||
if (strcmp(model, "Spider"))
|
if (strcmp(model, "Spider"))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -279,3 +282,5 @@ define_machine(cell) {
|
||||||
.init_IRQ = cell_init_irq,
|
.init_IRQ = cell_init_irq,
|
||||||
.pci_setup_phb = cell_setup_phb,
|
.pci_setup_phb = cell_setup_phb,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct pci_controller_ops cell_pci_controller_ops;
|
||||||
|
|
Loading…
Reference in New Issue