diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-10 02:54:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-11 02:07:41 -0400 |
commit | d3ae4b5bc7186a53731d35187ad4ba3bca147cf6 (patch) | |
tree | 53fbab0e70a170a3f6576e44e0b65fdbffe33258 /arch/sparc64/kernel/pci_sabre.c | |
parent | ab138c031f72f6d030afa1a06a3a537e85ae843e (diff) |
sparc64: Get rid of pci_controller_info.
It is just used as a parent to encapsulate two PBM objects.
But that layout is only really relevant and necessary for
psycho PCI controllers, which unlike all the others share
a single IOMMU instance between sibling PCI busses.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci_sabre.c')
-rw-r--r-- | arch/sparc64/kernel/pci_sabre.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c index 707d6d6130f7..8f779b58d65a 100644 --- a/arch/sparc64/kernel/pci_sabre.c +++ b/arch/sparc64/kernel/pci_sabre.c | |||
@@ -734,8 +734,8 @@ static int sabre_iommu_init(struct pci_pbm_info *pbm, | |||
734 | return 0; | 734 | return 0; |
735 | } | 735 | } |
736 | 736 | ||
737 | static void __init sabre_pbm_init(struct pci_controller_info *p, | 737 | static void __init sabre_pbm_init(struct pci_pbm_info *pbm, |
738 | struct pci_pbm_info *pbm, struct of_device *op) | 738 | struct of_device *op) |
739 | { | 739 | { |
740 | struct device_node *dp = op->node; | 740 | struct device_node *dp = op->node; |
741 | 741 | ||
@@ -750,7 +750,6 @@ static void __init sabre_pbm_init(struct pci_controller_info *p, | |||
750 | pbm->index = pci_num_pbms++; | 750 | pbm->index = pci_num_pbms++; |
751 | 751 | ||
752 | pbm->chip_type = PBM_CHIP_TYPE_SABRE; | 752 | pbm->chip_type = PBM_CHIP_TYPE_SABRE; |
753 | pbm->parent = p; | ||
754 | pbm->prom_node = dp; | 753 | pbm->prom_node = dp; |
755 | pci_get_pbm_props(pbm); | 754 | pci_get_pbm_props(pbm); |
756 | 755 | ||
@@ -764,7 +763,6 @@ static int __devinit sabre_probe(struct of_device *op, | |||
764 | { | 763 | { |
765 | const struct linux_prom64_registers *pr_regs; | 764 | const struct linux_prom64_registers *pr_regs; |
766 | struct device_node *dp = op->node; | 765 | struct device_node *dp = op->node; |
767 | struct pci_controller_info *p; | ||
768 | struct pci_pbm_info *pbm; | 766 | struct pci_pbm_info *pbm; |
769 | u32 upa_portid, dma_mask; | 767 | u32 upa_portid, dma_mask; |
770 | struct iommu *iommu; | 768 | struct iommu *iommu; |
@@ -786,26 +784,22 @@ static int __devinit sabre_probe(struct of_device *op, | |||
786 | } | 784 | } |
787 | 785 | ||
788 | err = -ENOMEM; | 786 | err = -ENOMEM; |
789 | p = kzalloc(sizeof(*p), GFP_ATOMIC); | 787 | pbm = kzalloc(sizeof(*pbm), GFP_KERNEL); |
790 | if (!p) { | 788 | if (!pbm) { |
791 | printk(KERN_ERR PFX "Cannot allocate controller info.\n"); | 789 | printk(KERN_ERR PFX "Cannot allocate pci_pbm_info.\n"); |
792 | goto out_err; | 790 | goto out_err; |
793 | } | 791 | } |
794 | 792 | ||
795 | iommu = kzalloc(sizeof(*iommu), GFP_ATOMIC); | 793 | iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); |
796 | if (!iommu) { | 794 | if (!iommu) { |
797 | printk(KERN_ERR PFX "Cannot allocate PBM iommu.\n"); | 795 | printk(KERN_ERR PFX "Cannot allocate PBM iommu.\n"); |
798 | goto out_free_controller; | 796 | goto out_free_controller; |
799 | } | 797 | } |
800 | 798 | ||
801 | pbm = &p->pbm_A; | ||
802 | pbm->iommu = iommu; | 799 | pbm->iommu = iommu; |
803 | 800 | ||
804 | upa_portid = of_getintprop_default(dp, "upa-portid", 0xff); | 801 | upa_portid = of_getintprop_default(dp, "upa-portid", 0xff); |
805 | 802 | ||
806 | pbm->next = pci_pbm_root; | ||
807 | pci_pbm_root = pbm; | ||
808 | |||
809 | pbm->portid = upa_portid; | 803 | pbm->portid = upa_portid; |
810 | 804 | ||
811 | /* | 805 | /* |
@@ -840,8 +834,7 @@ static int __devinit sabre_probe(struct of_device *op, | |||
840 | SABRE_PCICTRL_ARBPARK | SABRE_PCICTRL_AEN)); | 834 | SABRE_PCICTRL_ARBPARK | SABRE_PCICTRL_AEN)); |
841 | 835 | ||
842 | /* Now map in PCI config space for entire SABRE. */ | 836 | /* Now map in PCI config space for entire SABRE. */ |
843 | pbm->config_space = | 837 | pbm->config_space = pbm->controller_regs + SABRE_CONFIGSPACE; |
844 | (pbm->controller_regs + SABRE_CONFIGSPACE); | ||
845 | 838 | ||
846 | vdma = of_get_property(dp, "virtual-dma", NULL); | 839 | vdma = of_get_property(dp, "virtual-dma", NULL); |
847 | if (!vdma) { | 840 | if (!vdma) { |
@@ -876,14 +869,20 @@ static int __devinit sabre_probe(struct of_device *op, | |||
876 | /* | 869 | /* |
877 | * Look for APB underneath. | 870 | * Look for APB underneath. |
878 | */ | 871 | */ |
879 | sabre_pbm_init(p, pbm, op); | 872 | sabre_pbm_init(pbm, op); |
873 | |||
874 | pbm->next = pci_pbm_root; | ||
875 | pci_pbm_root = pbm; | ||
876 | |||
877 | dev_set_drvdata(&op->dev, pbm); | ||
878 | |||
880 | return 0; | 879 | return 0; |
881 | 880 | ||
882 | out_free_iommu: | 881 | out_free_iommu: |
883 | kfree(p->pbm_A.iommu); | 882 | kfree(pbm->iommu); |
884 | 883 | ||
885 | out_free_controller: | 884 | out_free_controller: |
886 | kfree(p); | 885 | kfree(pbm); |
887 | 886 | ||
888 | out_err: | 887 | out_err: |
889 | return err; | 888 | return err; |