aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/pci/pci-sh7780.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/drivers/pci/pci-sh7780.c')
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c
index 7f4f59037544..63b5151e9aaa 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -34,33 +34,39 @@
34int __init sh7780_pci_init(struct pci_channel *chan) 34int __init sh7780_pci_init(struct pci_channel *chan)
35{ 35{
36 unsigned int id; 36 unsigned int id;
37 int ret, match = 0; 37 const char *type = NULL;
38 int ret;
38 39
39 pr_debug("PCI: Starting intialization.\n"); 40 printk(KERN_NOTICE "PCI: Starting intialization.\n");
40 41
41 chan->reg_base = 0xfe040000; 42 chan->reg_base = 0xfe040000;
42 chan->io_base = 0xfe200000; 43 chan->io_base = 0xfe200000;
43 44
44 ctrl_outl(0x00000001, SH7780_PCI_VCR2); /* Enable PCIC */ 45 /* Enable CPU access to the PCIC registers. */
45 46 __raw_writel(PCIECR_ENBL, PCIECR);
46 /* check for SH7780/SH7780R hardware */
47 id = pci_read_reg(chan, SH7780_PCIVID);
48 if ((id & 0xffff) == SH7780_VENDOR_ID) {
49 switch ((id >> 16) & 0xffff) {
50 case SH7763_DEVICE_ID:
51 case SH7780_DEVICE_ID:
52 case SH7781_DEVICE_ID:
53 case SH7785_DEVICE_ID:
54 match = 1;
55 break;
56 }
57 }
58 47
59 if (unlikely(!match)) { 48 id = __raw_readw(chan->reg_base + SH7780_PCIVID);
60 printk(KERN_ERR "PCI: This is not an SH7780 (%x)\n", id); 49 if (id != SH7780_VENDOR_ID) {
50 printk(KERN_ERR "PCI: Unknown vendor ID 0x%04x.\n", id);
61 return -ENODEV; 51 return -ENODEV;
62 } 52 }
63 53
54 id = __raw_readw(chan->reg_base + SH7780_PCIDID);
55 type = (id == SH7763_DEVICE_ID) ? "SH7763" :
56 (id == SH7780_DEVICE_ID) ? "SH7780" :
57 (id == SH7781_DEVICE_ID) ? "SH7781" :
58 (id == SH7785_DEVICE_ID) ? "SH7785" :
59 NULL;
60 if (unlikely(!type)) {
61 printk(KERN_ERR "PCI: Found an unsupported Renesas host "
62 "controller, device id 0x%04x.\n", id);
63 return -EINVAL;
64 }
65
66 printk(KERN_NOTICE "PCI: Found a Renesas %s host "
67 "controller, revision %d.\n", type,
68 __raw_readb(chan->reg_base + SH7780_PCIRID));
69
64 if ((ret = sh4_pci_check_direct(chan)) != 0) 70 if ((ret = sh4_pci_check_direct(chan)) != 0)
65 return ret; 71 return ret;
66 72