diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-05-08 03:19:02 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-05-08 19:41:44 -0400 |
commit | 28113a9941c8cb6ca90ab4a66876db84342a084b (patch) | |
tree | 369373800657dd415143731ca8070ef72525d8b2 /arch/sparc64/kernel/pci_sabre.c | |
parent | 6c108f1299754877bb5f73ccac5621eb603b97eb (diff) |
[SPARC64]: Removal of trivial pci_controller_info uses.
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 | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c index 422485bc67f0..733ab366a3d4 100644 --- a/arch/sparc64/kernel/pci_sabre.c +++ b/arch/sparc64/kernel/pci_sabre.c | |||
@@ -942,30 +942,30 @@ static void sabre_scan_bus(struct pci_pbm_info *pbm) | |||
942 | sabre_register_error_handlers(pbm); | 942 | sabre_register_error_handlers(pbm); |
943 | } | 943 | } |
944 | 944 | ||
945 | static void sabre_iommu_init(struct pci_controller_info *p, | 945 | static void sabre_iommu_init(struct pci_pbm_info *pbm, |
946 | int tsbsize, unsigned long dvma_offset, | 946 | int tsbsize, unsigned long dvma_offset, |
947 | u32 dma_mask) | 947 | u32 dma_mask) |
948 | { | 948 | { |
949 | struct iommu *iommu = p->pbm_A.iommu; | 949 | struct iommu *iommu = pbm->iommu; |
950 | unsigned long i; | 950 | unsigned long i; |
951 | u64 control; | 951 | u64 control; |
952 | 952 | ||
953 | /* Register addresses. */ | 953 | /* Register addresses. */ |
954 | iommu->iommu_control = p->pbm_A.controller_regs + SABRE_IOMMU_CONTROL; | 954 | iommu->iommu_control = pbm->controller_regs + SABRE_IOMMU_CONTROL; |
955 | iommu->iommu_tsbbase = p->pbm_A.controller_regs + SABRE_IOMMU_TSBBASE; | 955 | iommu->iommu_tsbbase = pbm->controller_regs + SABRE_IOMMU_TSBBASE; |
956 | iommu->iommu_flush = p->pbm_A.controller_regs + SABRE_IOMMU_FLUSH; | 956 | iommu->iommu_flush = pbm->controller_regs + SABRE_IOMMU_FLUSH; |
957 | iommu->write_complete_reg = p->pbm_A.controller_regs + SABRE_WRSYNC; | 957 | iommu->write_complete_reg = pbm->controller_regs + SABRE_WRSYNC; |
958 | /* Sabre's IOMMU lacks ctx flushing. */ | 958 | /* Sabre's IOMMU lacks ctx flushing. */ |
959 | iommu->iommu_ctxflush = 0; | 959 | iommu->iommu_ctxflush = 0; |
960 | 960 | ||
961 | /* Invalidate TLB Entries. */ | 961 | /* Invalidate TLB Entries. */ |
962 | control = sabre_read(p->pbm_A.controller_regs + SABRE_IOMMU_CONTROL); | 962 | control = sabre_read(pbm->controller_regs + SABRE_IOMMU_CONTROL); |
963 | control |= SABRE_IOMMUCTRL_DENAB; | 963 | control |= SABRE_IOMMUCTRL_DENAB; |
964 | sabre_write(p->pbm_A.controller_regs + SABRE_IOMMU_CONTROL, control); | 964 | sabre_write(pbm->controller_regs + SABRE_IOMMU_CONTROL, control); |
965 | 965 | ||
966 | for(i = 0; i < 16; i++) { | 966 | for(i = 0; i < 16; i++) { |
967 | sabre_write(p->pbm_A.controller_regs + SABRE_IOMMU_TAG + (i * 8UL), 0); | 967 | sabre_write(pbm->controller_regs + SABRE_IOMMU_TAG + (i * 8UL), 0); |
968 | sabre_write(p->pbm_A.controller_regs + SABRE_IOMMU_DATA + (i * 8UL), 0); | 968 | sabre_write(pbm->controller_regs + SABRE_IOMMU_DATA + (i * 8UL), 0); |
969 | } | 969 | } |
970 | 970 | ||
971 | /* Leave diag mode enabled for full-flushing done | 971 | /* Leave diag mode enabled for full-flushing done |
@@ -973,10 +973,10 @@ static void sabre_iommu_init(struct pci_controller_info *p, | |||
973 | */ | 973 | */ |
974 | pci_iommu_table_init(iommu, tsbsize * 1024 * 8, dvma_offset, dma_mask); | 974 | pci_iommu_table_init(iommu, tsbsize * 1024 * 8, dvma_offset, dma_mask); |
975 | 975 | ||
976 | sabre_write(p->pbm_A.controller_regs + SABRE_IOMMU_TSBBASE, | 976 | sabre_write(pbm->controller_regs + SABRE_IOMMU_TSBBASE, |
977 | __pa(iommu->page_table)); | 977 | __pa(iommu->page_table)); |
978 | 978 | ||
979 | control = sabre_read(p->pbm_A.controller_regs + SABRE_IOMMU_CONTROL); | 979 | control = sabre_read(pbm->controller_regs + SABRE_IOMMU_CONTROL); |
980 | control &= ~(SABRE_IOMMUCTRL_TSBSZ | SABRE_IOMMUCTRL_TBWSZ); | 980 | control &= ~(SABRE_IOMMUCTRL_TSBSZ | SABRE_IOMMUCTRL_TBWSZ); |
981 | control |= SABRE_IOMMUCTRL_ENAB; | 981 | control |= SABRE_IOMMUCTRL_ENAB; |
982 | switch(tsbsize) { | 982 | switch(tsbsize) { |
@@ -991,14 +991,11 @@ static void sabre_iommu_init(struct pci_controller_info *p, | |||
991 | prom_halt(); | 991 | prom_halt(); |
992 | break; | 992 | break; |
993 | } | 993 | } |
994 | sabre_write(p->pbm_A.controller_regs + SABRE_IOMMU_CONTROL, control); | 994 | sabre_write(pbm->controller_regs + SABRE_IOMMU_CONTROL, control); |
995 | } | 995 | } |
996 | 996 | ||
997 | static void sabre_pbm_init(struct pci_controller_info *p, struct device_node *dp) | 997 | static void sabre_pbm_init(struct pci_controller_info *p, struct pci_pbm_info *pbm, struct device_node *dp) |
998 | { | 998 | { |
999 | struct pci_pbm_info *pbm; | ||
1000 | |||
1001 | pbm = &p->pbm_A; | ||
1002 | pbm->name = dp->full_name; | 999 | pbm->name = dp->full_name; |
1003 | printk("%s: SABRE PCI Bus Module\n", pbm->name); | 1000 | printk("%s: SABRE PCI Bus Module\n", pbm->name); |
1004 | 1001 | ||
@@ -1019,6 +1016,7 @@ void sabre_init(struct device_node *dp, char *model_name) | |||
1019 | { | 1016 | { |
1020 | const struct linux_prom64_registers *pr_regs; | 1017 | const struct linux_prom64_registers *pr_regs; |
1021 | struct pci_controller_info *p; | 1018 | struct pci_controller_info *p; |
1019 | struct pci_pbm_info *pbm; | ||
1022 | struct iommu *iommu; | 1020 | struct iommu *iommu; |
1023 | int tsbsize; | 1021 | int tsbsize; |
1024 | const u32 *vdma; | 1022 | const u32 *vdma; |
@@ -1055,14 +1053,15 @@ void sabre_init(struct device_node *dp, char *model_name) | |||
1055 | prom_printf("SABRE: Error, kmalloc(pci_iommu) failed.\n"); | 1053 | prom_printf("SABRE: Error, kmalloc(pci_iommu) failed.\n"); |
1056 | prom_halt(); | 1054 | prom_halt(); |
1057 | } | 1055 | } |
1058 | p->pbm_A.iommu = iommu; | 1056 | pbm = &p->pbm_A; |
1057 | pbm->iommu = iommu; | ||
1059 | 1058 | ||
1060 | upa_portid = of_getintprop_default(dp, "upa-portid", 0xff); | 1059 | upa_portid = of_getintprop_default(dp, "upa-portid", 0xff); |
1061 | 1060 | ||
1062 | p->pbm_A.next = pci_pbm_root; | 1061 | pbm->next = pci_pbm_root; |
1063 | pci_pbm_root = &p->pbm_A; | 1062 | pci_pbm_root = pbm; |
1064 | 1063 | ||
1065 | p->pbm_A.portid = upa_portid; | 1064 | pbm->portid = upa_portid; |
1066 | 1065 | ||
1067 | /* | 1066 | /* |
1068 | * Map in SABRE register set and report the presence of this SABRE. | 1067 | * Map in SABRE register set and report the presence of this SABRE. |
@@ -1073,26 +1072,26 @@ void sabre_init(struct device_node *dp, char *model_name) | |||
1073 | /* | 1072 | /* |
1074 | * First REG in property is base of entire SABRE register space. | 1073 | * First REG in property is base of entire SABRE register space. |
1075 | */ | 1074 | */ |
1076 | p->pbm_A.controller_regs = pr_regs[0].phys_addr; | 1075 | pbm->controller_regs = pr_regs[0].phys_addr; |
1077 | 1076 | ||
1078 | /* Clear interrupts */ | 1077 | /* Clear interrupts */ |
1079 | 1078 | ||
1080 | /* PCI first */ | 1079 | /* PCI first */ |
1081 | for (clear_irq = SABRE_ICLR_A_SLOT0; clear_irq < SABRE_ICLR_B_SLOT0 + 0x80; clear_irq += 8) | 1080 | for (clear_irq = SABRE_ICLR_A_SLOT0; clear_irq < SABRE_ICLR_B_SLOT0 + 0x80; clear_irq += 8) |
1082 | sabre_write(p->pbm_A.controller_regs + clear_irq, 0x0UL); | 1081 | sabre_write(pbm->controller_regs + clear_irq, 0x0UL); |
1083 | 1082 | ||
1084 | /* Then OBIO */ | 1083 | /* Then OBIO */ |
1085 | for (clear_irq = SABRE_ICLR_SCSI; clear_irq < SABRE_ICLR_SCSI + 0x80; clear_irq += 8) | 1084 | for (clear_irq = SABRE_ICLR_SCSI; clear_irq < SABRE_ICLR_SCSI + 0x80; clear_irq += 8) |
1086 | sabre_write(p->pbm_A.controller_regs + clear_irq, 0x0UL); | 1085 | sabre_write(pbm->controller_regs + clear_irq, 0x0UL); |
1087 | 1086 | ||
1088 | /* Error interrupts are enabled later after the bus scan. */ | 1087 | /* Error interrupts are enabled later after the bus scan. */ |
1089 | sabre_write(p->pbm_A.controller_regs + SABRE_PCICTRL, | 1088 | sabre_write(pbm->controller_regs + SABRE_PCICTRL, |
1090 | (SABRE_PCICTRL_MRLEN | SABRE_PCICTRL_SERR | | 1089 | (SABRE_PCICTRL_MRLEN | SABRE_PCICTRL_SERR | |
1091 | SABRE_PCICTRL_ARBPARK | SABRE_PCICTRL_AEN)); | 1090 | SABRE_PCICTRL_ARBPARK | SABRE_PCICTRL_AEN)); |
1092 | 1091 | ||
1093 | /* Now map in PCI config space for entire SABRE. */ | 1092 | /* Now map in PCI config space for entire SABRE. */ |
1094 | p->pbm_A.config_space = | 1093 | pbm->config_space = |
1095 | (p->pbm_A.controller_regs + SABRE_CONFIGSPACE); | 1094 | (pbm->controller_regs + SABRE_CONFIGSPACE); |
1096 | 1095 | ||
1097 | vdma = of_get_property(dp, "virtual-dma", NULL); | 1096 | vdma = of_get_property(dp, "virtual-dma", NULL); |
1098 | 1097 | ||
@@ -1116,10 +1115,10 @@ void sabre_init(struct device_node *dp, char *model_name) | |||
1116 | prom_halt(); | 1115 | prom_halt(); |
1117 | } | 1116 | } |
1118 | 1117 | ||
1119 | sabre_iommu_init(p, tsbsize, vdma[0], dma_mask); | 1118 | sabre_iommu_init(pbm, tsbsize, vdma[0], dma_mask); |
1120 | 1119 | ||
1121 | /* | 1120 | /* |
1122 | * Look for APB underneath. | 1121 | * Look for APB underneath. |
1123 | */ | 1122 | */ |
1124 | sabre_pbm_init(p, dp); | 1123 | sabre_pbm_init(p, pbm, dp); |
1125 | } | 1124 | } |