diff options
Diffstat (limited to 'arch/mips/rb532/devices.c')
-rw-r--r-- | arch/mips/rb532/devices.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c index 3c74561b4ee5..1a0209eca789 100644 --- a/arch/mips/rb532/devices.c +++ b/arch/mips/rb532/devices.c | |||
@@ -42,6 +42,34 @@ | |||
42 | 42 | ||
43 | extern unsigned int idt_cpu_freq; | 43 | extern unsigned int idt_cpu_freq; |
44 | 44 | ||
45 | static struct mpmc_device dev3; | ||
46 | |||
47 | void set_latch_u5(unsigned char or_mask, unsigned char nand_mask) | ||
48 | { | ||
49 | unsigned long flags; | ||
50 | |||
51 | spin_lock_irqsave(&dev3.lock, flags); | ||
52 | |||
53 | dev3.state = (dev3.state | or_mask) & ~nand_mask; | ||
54 | writeb(dev3.state, dev3.base); | ||
55 | |||
56 | spin_unlock_irqrestore(&dev3.lock, flags); | ||
57 | } | ||
58 | EXPORT_SYMBOL(set_latch_u5); | ||
59 | |||
60 | unsigned char get_latch_u5(void) | ||
61 | { | ||
62 | return dev3.state; | ||
63 | } | ||
64 | EXPORT_SYMBOL(get_latch_u5); | ||
65 | |||
66 | static struct resource rb532_dev3_ctl_res[] = { | ||
67 | { | ||
68 | .name = "dev3_ctl", | ||
69 | .flags = IORESOURCE_MEM, | ||
70 | } | ||
71 | }; | ||
72 | |||
45 | static struct resource korina_dev0_res[] = { | 73 | static struct resource korina_dev0_res[] = { |
46 | { | 74 | { |
47 | .name = "korina_regs", | 75 | .name = "korina_regs", |
@@ -314,6 +342,17 @@ static int __init plat_setup_devices(void) | |||
314 | nand_slot0_res[0].start = readl(IDT434_REG_BASE + DEV2BASE); | 342 | nand_slot0_res[0].start = readl(IDT434_REG_BASE + DEV2BASE); |
315 | nand_slot0_res[0].end = nand_slot0_res[0].start + 0x1000; | 343 | nand_slot0_res[0].end = nand_slot0_res[0].start + 0x1000; |
316 | 344 | ||
345 | /* Read the third (multi purpose) resources from the DC */ | ||
346 | rb532_dev3_ctl_res[0].start = readl(IDT434_REG_BASE + DEV3BASE); | ||
347 | rb532_dev3_ctl_res[0].end = rb532_dev3_ctl_res[0].start + 0x1000; | ||
348 | |||
349 | dev3.base = ioremap_nocache(rb532_dev3_ctl_res[0].start, 0x1000); | ||
350 | |||
351 | if (!dev3.base) { | ||
352 | printk(KERN_ERR "rb532: cannot remap device controller 3\n"); | ||
353 | return -ENXIO; | ||
354 | } | ||
355 | |||
317 | /* Initialise the NAND device */ | 356 | /* Initialise the NAND device */ |
318 | rb532_nand_setup(); | 357 | rb532_nand_setup(); |
319 | 358 | ||