~ubuntu-branches/ubuntu/saucy/linux-ti-omap4/saucy-proposed

« back to all changes in this revision

Viewing changes to arch/arm/mach-versatile/pci.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Stefan Bader, Upstream Kernel Changes
  • Date: 2012-08-15 17:17:43 UTC
  • Revision ID: package-import@ubuntu.com-20120815171743-h5wnuf51xe7pvdid
Tags: 3.5.0-207.13
[ Paolo Pisati ]

* Start new release

[ Stefan Bader ]

* (config) Enable getabis to use local package copies

[ Upstream Kernel Changes ]

* fixup: gargabe collect iva_seq[0|1] init
* [Config] enable all SND_OMAP_SOC_*s
* fixup: cm2xxx_3xxx.o is needed for omap2_cm_read|write_reg
* fixup: add some snd_soc_dai* helper functions
* fixup: s/snd_soc_dpcm_params/snd_soc_dpcm/g
* fixup: typo, no_host_mode and useless SDP4430 init
* fixup: enable again aess hwmod

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
        .write  = versatile_write_config,
170
170
};
171
171
 
 
172
static struct resource io_port = {
 
173
        .name   = "PCI",
 
174
        .start  = 0,
 
175
        .end    = IO_SPACE_LIMIT,
 
176
        .flags  = IORESOURCE_IO,
 
177
};
 
178
 
172
179
static struct resource io_mem = {
173
180
        .name   = "PCI I/O space",
174
181
        .start  = VERSATILE_PCI_MEM_BASE0,
175
182
        .end    = VERSATILE_PCI_MEM_BASE0+VERSATILE_PCI_MEM_BASE0_SIZE-1,
176
 
        .flags  = IORESOURCE_IO,
 
183
        .flags  = IORESOURCE_MEM,
177
184
};
178
185
 
179
186
static struct resource non_mem = {
200
207
                       "memory region (%d)\n", ret);
201
208
                goto out;
202
209
        }
 
210
        ret = request_resource(&ioport_resource, &io_port);
 
211
        if (ret) {
 
212
                printk(KERN_ERR "PCI: unable to allocate I/O "
 
213
                       "port region (%d)\n", ret);
 
214
                goto out;
 
215
        }
203
216
        ret = request_resource(&iomem_resource, &non_mem);
204
217
        if (ret) {
205
218
                printk(KERN_ERR "PCI: unable to allocate non-prefetchable "
218
231
         * the mem resource for this bus
219
232
         * the prefetch mem resource for this bus
220
233
         */
221
 
        pci_add_resource_offset(&sys->resources, &io_mem, sys->io_offset);
 
234
        pci_add_resource_offset(&sys->resources, &io_port, sys->io_offset);
222
235
        pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset);
223
236
        pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset);
224
237
 
249
262
 
250
263
        if (nr == 0) {
251
264
                sys->mem_offset = 0;
 
265
                sys->io_offset = 0;
252
266
                ret = pci_versatile_setup_resources(sys);
253
267
                if (ret < 0) {
254
268
                        printk("pci_versatile_setup: resources... oops?\n");
303
317
}
304
318
 
305
319
 
306
 
struct pci_bus * __init pci_versatile_scan_bus(int nr, struct pci_sys_data *sys)
307
 
{
308
 
        return pci_scan_root_bus(NULL, sys->busnr, &pci_versatile_ops, sys,
309
 
                                 &sys->resources);
310
 
}
311
 
 
312
320
void __init pci_versatile_preinit(void)
313
321
{
314
322
        pcibios_min_io = 0x44000000;
331
339
static int __init versatile_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
332
340
{
333
341
        int irq;
334
 
        int devslot = PCI_SLOT(dev->devfn);
335
342
 
336
343
        /* slot,  pin,  irq
337
344
         *  24     1     27
339
346
         *  26     1     29
340
347
         *  27     1     30
341
348
         */
342
 
        irq = 27 + ((slot + pin - 1) & 3);
343
 
 
344
 
        printk("PCI map irq: slot %d, pin %d, devslot %d, irq: %d\n",slot,pin,devslot,irq);
 
349
        irq = 27 + ((slot - 24 + pin - 1) & 3);
345
350
 
346
351
        return irq;
347
352
}
348
353
 
349
354
static struct hw_pci versatile_pci __initdata = {
350
 
        .swizzle                = NULL,
351
355
        .map_irq                = versatile_map_irq,
352
356
        .nr_controllers         = 1,
 
357
        .ops                    = &pci_versatile_ops,
353
358
        .setup                  = pci_versatile_setup,
354
 
        .scan                   = pci_versatile_scan_bus,
355
359
        .preinit                = pci_versatile_preinit,
356
360
};
357
361