diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2008-08-19 09:55:11 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-10-11 11:18:42 -0400 |
commit | 51f607c76e1e7bd089dcad97b6b0a58649be06a3 (patch) | |
tree | bcf9389a1e3bcd347d7c560163d2c014d804a162 /arch/mips/txx9/generic/setup_tx3927.c | |
parent | c7b95bcb38ea492fd025008ef99501a2b90aa237 (diff) |
MIPS: TXx9: Add mtd support
Add helper routines to register physmap-flash platform devices for NOR
flashes.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/txx9/generic/setup_tx3927.c')
-rw-r--r-- | arch/mips/txx9/generic/setup_tx3927.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/mips/txx9/generic/setup_tx3927.c b/arch/mips/txx9/generic/setup_tx3927.c index 06c492576078..9505d58454c8 100644 --- a/arch/mips/txx9/generic/setup_tx3927.c +++ b/arch/mips/txx9/generic/setup_tx3927.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/param.h> | 16 | #include <linux/param.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/mtd/physmap.h> | ||
18 | #include <asm/mipsregs.h> | 19 | #include <asm/mipsregs.h> |
19 | #include <asm/txx9irq.h> | 20 | #include <asm/txx9irq.h> |
20 | #include <asm/txx9tmr.h> | 21 | #include <asm/txx9tmr.h> |
@@ -121,3 +122,16 @@ void __init tx3927_sio_init(unsigned int sclk, unsigned int cts_mask) | |||
121 | TXX9_IRQ_BASE + TX3927_IR_SIO(i), | 122 | TXX9_IRQ_BASE + TX3927_IR_SIO(i), |
122 | i, sclk, (1 << i) & cts_mask); | 123 | i, sclk, (1 << i) & cts_mask); |
123 | } | 124 | } |
125 | |||
126 | void __init tx3927_mtd_init(int ch) | ||
127 | { | ||
128 | struct physmap_flash_data pdata = { | ||
129 | .width = TX3927_ROMC_WIDTH(ch) / 8, | ||
130 | }; | ||
131 | unsigned long start = txx9_ce_res[ch].start; | ||
132 | unsigned long size = txx9_ce_res[ch].end - start + 1; | ||
133 | |||
134 | if (!(tx3927_romcptr->cr[ch] & 0x8)) | ||
135 | return; /* disabled */ | ||
136 | txx9_physmap_flash_init(ch, start, size, &pdata); | ||
137 | } | ||