diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-03-09 00:55:49 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 04:55:11 -0400 |
commit | 9fd8b64761d3fe7e4ef567161be57e4234af5c1c (patch) | |
tree | 39eb4744d6f36c003bb4e9fea77c7c9921bbef2b /arch/sparc64/kernel/pci_psycho.c | |
parent | 01f94c4a6ced476ce69b895426fc29bfc48c69bd (diff) |
[SPARC64]: Consolidate PCI mem/io resource determination.
It can be done for every PCI configuration using OF properties.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci_psycho.c')
-rw-r--r-- | arch/sparc64/kernel/pci_psycho.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c index 12ea30d30b2f..c08681b7a44e 100644 --- a/arch/sparc64/kernel/pci_psycho.c +++ b/arch/sparc64/kernel/pci_psycho.c | |||
@@ -1,7 +1,6 @@ | |||
1 | /* $Id: pci_psycho.c,v 1.33 2002/02/01 00:58:33 davem Exp $ | 1 | /* pci_psycho.c: PSYCHO/U2P specific PCI controller support. |
2 | * pci_psycho.c: PSYCHO/U2P specific PCI controller support. | ||
3 | * | 2 | * |
4 | * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@caipfs.rutgers.edu) | 3 | * Copyright (C) 1997, 1998, 1999, 2007 David S. Miller (davem@davemloft.net) |
5 | * Copyright (C) 1998, 1999 Eddie C. Dost (ecd@skynet.be) | 4 | * Copyright (C) 1998, 1999 Eddie C. Dost (ecd@skynet.be) |
6 | * Copyright (C) 1999 Jakub Jelinek (jakub@redhat.com) | 5 | * Copyright (C) 1999 Jakub Jelinek (jakub@redhat.com) |
7 | */ | 6 | */ |
@@ -1072,19 +1071,6 @@ static void psycho_controller_hwinit(struct pci_controller_info *p) | |||
1072 | psycho_write(p->pbm_A.controller_regs + PSYCHO_PCIB_DIAG, tmp); | 1071 | psycho_write(p->pbm_A.controller_regs + PSYCHO_PCIB_DIAG, tmp); |
1073 | } | 1072 | } |
1074 | 1073 | ||
1075 | static void pbm_register_toplevel_resources(struct pci_controller_info *p, | ||
1076 | struct pci_pbm_info *pbm) | ||
1077 | { | ||
1078 | char *name = pbm->name; | ||
1079 | |||
1080 | pbm->io_space.name = pbm->mem_space.name = name; | ||
1081 | |||
1082 | request_resource(&ioport_resource, &pbm->io_space); | ||
1083 | request_resource(&iomem_resource, &pbm->mem_space); | ||
1084 | pci_register_legacy_regions(&pbm->io_space, | ||
1085 | &pbm->mem_space); | ||
1086 | } | ||
1087 | |||
1088 | static void psycho_pbm_strbuf_init(struct pci_controller_info *p, | 1074 | static void psycho_pbm_strbuf_init(struct pci_controller_info *p, |
1089 | struct pci_pbm_info *pbm, | 1075 | struct pci_pbm_info *pbm, |
1090 | int is_pbm_a) | 1076 | int is_pbm_a) |
@@ -1155,13 +1141,9 @@ static void psycho_pbm_init(struct pci_controller_info *p, | |||
1155 | if (is_pbm_a) { | 1141 | if (is_pbm_a) { |
1156 | pbm = &p->pbm_A; | 1142 | pbm = &p->pbm_A; |
1157 | pbm->pci_first_slot = 1; | 1143 | pbm->pci_first_slot = 1; |
1158 | pbm->io_space.start = pbm->controller_regs + PSYCHO_IOSPACE_A; | ||
1159 | pbm->mem_space.start = pbm->controller_regs + PSYCHO_MEMSPACE_A; | ||
1160 | } else { | 1144 | } else { |
1161 | pbm = &p->pbm_B; | 1145 | pbm = &p->pbm_B; |
1162 | pbm->pci_first_slot = 2; | 1146 | pbm->pci_first_slot = 2; |
1163 | pbm->io_space.start = pbm->controller_regs + PSYCHO_IOSPACE_B; | ||
1164 | pbm->mem_space.start = pbm->controller_regs + PSYCHO_MEMSPACE_B; | ||
1165 | } | 1147 | } |
1166 | 1148 | ||
1167 | pbm->chip_type = PBM_CHIP_TYPE_PSYCHO; | 1149 | pbm->chip_type = PBM_CHIP_TYPE_PSYCHO; |
@@ -1174,17 +1156,12 @@ static void psycho_pbm_init(struct pci_controller_info *p, | |||
1174 | if (prop) | 1156 | if (prop) |
1175 | pbm->chip_revision = *(int *) prop->value; | 1157 | pbm->chip_revision = *(int *) prop->value; |
1176 | 1158 | ||
1177 | pbm->io_space.end = pbm->io_space.start + PSYCHO_IOSPACE_SIZE; | 1159 | pci_determine_mem_io_space(pbm); |
1178 | pbm->io_space.flags = IORESOURCE_IO; | ||
1179 | pbm->mem_space.end = pbm->mem_space.start + PSYCHO_MEMSPACE_SIZE; | ||
1180 | pbm->mem_space.flags = IORESOURCE_MEM; | ||
1181 | 1160 | ||
1182 | pbm->parent = p; | 1161 | pbm->parent = p; |
1183 | pbm->prom_node = dp; | 1162 | pbm->prom_node = dp; |
1184 | pbm->name = dp->full_name; | 1163 | pbm->name = dp->full_name; |
1185 | 1164 | ||
1186 | pbm_register_toplevel_resources(p, pbm); | ||
1187 | |||
1188 | printk("%s: PSYCHO PCI Bus Module ver[%x:%x]\n", | 1165 | printk("%s: PSYCHO PCI Bus Module ver[%x:%x]\n", |
1189 | pbm->name, | 1166 | pbm->name, |
1190 | pbm->chip_version, pbm->chip_revision); | 1167 | pbm->chip_version, pbm->chip_revision); |