Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22fecbae authored by David S. Miller's avatar David S. Miller
Browse files

sparc64: Record OF device instead of device node pointer in pci_pbm_info.

parent d3ae4b5b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -676,7 +676,7 @@ static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus)
struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm,
					    struct device *parent)
{
	struct device_node *node = pbm->prom_node;
	struct device_node *node = pbm->op->node;
	struct pci_bus *bus;

	printk("PCI: Scanning PBM %s\n", node->full_name);
+4 −4
Original line number Diff line number Diff line
@@ -314,12 +314,12 @@ struct pci_ops sun4v_pci_ops = {

void pci_get_pbm_props(struct pci_pbm_info *pbm)
{
	const u32 *val = of_get_property(pbm->prom_node, "bus-range", NULL);
	const u32 *val = of_get_property(pbm->op->node, "bus-range", NULL);

	pbm->pci_first_busno = val[0];
	pbm->pci_last_busno = val[1];

	val = of_get_property(pbm->prom_node, "ino-bitmap", NULL);
	val = of_get_property(pbm->op->node, "ino-bitmap", NULL);
	if (val) {
		pbm->ino_bitmap = (((u64)val[1] << 32UL) |
				   ((u64)val[0] <<  0UL));
@@ -365,7 +365,7 @@ static void pci_register_legacy_regions(struct resource *io_res,

static void pci_register_iommu_region(struct pci_pbm_info *pbm)
{
	const u32 *vdma = of_get_property(pbm->prom_node, "virtual-dma", NULL);
	const u32 *vdma = of_get_property(pbm->op->node, "virtual-dma", NULL);

	if (vdma) {
		struct resource *rp = kmalloc(sizeof(*rp), GFP_KERNEL);
@@ -389,7 +389,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm)
	int num_pbm_ranges;

	saw_mem = saw_io = 0;
	pbm_ranges = of_get_property(pbm->prom_node, "ranges", &i);
	pbm_ranges = of_get_property(pbm->op->node, "ranges", &i);
	if (!pbm_ranges) {
		prom_printf("PCI: Fatal error, missing PBM ranges property "
			    " for %s\n",
+1 −1
Original line number Diff line number Diff line
@@ -446,7 +446,7 @@ static int __init pci_fire_pbm_init(struct pci_pbm_info *pbm,
	pbm->index = pci_num_pbms++;

	pbm->portid = portid;
	pbm->prom_node = dp;
	pbm->op = op;
	pbm->name = dp->full_name;

	regs = of_get_property(dp, "reg", NULL);
+2 −1
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include <linux/spinlock.h>
#include <linux/pci.h>
#include <linux/msi.h>
#include <linux/of_device.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/iommu.h>
@@ -90,7 +91,7 @@ struct pci_pbm_info {
	char				*name;

	/* OBP specific information. */
	struct device_node		*prom_node;
	struct of_device		*op;
	u64				ino_bitmap;

	/* PBM I/O and Memory space resources. */
+9 −9
Original line number Diff line number Diff line
@@ -323,7 +323,7 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm,
	const u32 *val;
	int len;

	val = of_get_property(pbm->prom_node, "#msi-eqs", &len);
	val = of_get_property(pbm->op->node, "#msi-eqs", &len);
	if (!val || len != 4)
		goto no_msi;
	pbm->msiq_num = *val;
@@ -346,16 +346,16 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm,
			u32 msi64_len;
		} *arng;

		val = of_get_property(pbm->prom_node, "msi-eq-size", &len);
		val = of_get_property(pbm->op->node, "msi-eq-size", &len);
		if (!val || len != 4)
			goto no_msi;

		pbm->msiq_ent_count = *val;

		mqp = of_get_property(pbm->prom_node,
		mqp = of_get_property(pbm->op->node,
				      "msi-eq-to-devino", &len);
		if (!mqp)
			mqp = of_get_property(pbm->prom_node,
			mqp = of_get_property(pbm->op->node,
					      "msi-eq-devino", &len);
		if (!mqp || len != sizeof(struct msiq_prop))
			goto no_msi;
@@ -363,27 +363,27 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm,
		pbm->msiq_first = mqp->first_msiq;
		pbm->msiq_first_devino = mqp->first_devino;

		val = of_get_property(pbm->prom_node, "#msi", &len);
		val = of_get_property(pbm->op->node, "#msi", &len);
		if (!val || len != 4)
			goto no_msi;
		pbm->msi_num = *val;

		mrng = of_get_property(pbm->prom_node, "msi-ranges", &len);
		mrng = of_get_property(pbm->op->node, "msi-ranges", &len);
		if (!mrng || len != sizeof(struct msi_range_prop))
			goto no_msi;
		pbm->msi_first = mrng->first_msi;

		val = of_get_property(pbm->prom_node, "msi-data-mask", &len);
		val = of_get_property(pbm->op->node, "msi-data-mask", &len);
		if (!val || len != 4)
			goto no_msi;
		pbm->msi_data_mask = *val;

		val = of_get_property(pbm->prom_node, "msix-data-width", &len);
		val = of_get_property(pbm->op->node, "msix-data-width", &len);
		if (!val || len != 4)
			goto no_msi;
		pbm->msix_data_width = *val;

		arng = of_get_property(pbm->prom_node, "msi-address-ranges",
		arng = of_get_property(pbm->op->node, "msi-address-ranges",
				       &len);
		if (!arng || len != sizeof(struct addr_range_prop))
			goto no_msi;
Loading