diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2008-08-19 17:55:11 +0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-10-11 19:18:42 +0400 |
commit | 51f607c76e1e7bd089dcad97b6b0a58649be06a3 (patch) | |
tree | bcf9389a1e3bcd347d7c560163d2c014d804a162 /arch/mips/txx9/generic/setup_tx4938.c | |
parent | c7b95bcb38ea492fd025008ef99501a2b90aa237 (diff) | |
download | linux-51f607c76e1e7bd089dcad97b6b0a58649be06a3.tar.xz |
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_tx4938.c')
-rw-r--r-- | arch/mips/txx9/generic/setup_tx4938.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/mips/txx9/generic/setup_tx4938.c b/arch/mips/txx9/generic/setup_tx4938.c index 95c058f0a96c..630a7aac61f6 100644 --- a/arch/mips/txx9/generic/setup_tx4938.c +++ b/arch/mips/txx9/generic/setup_tx4938.c @@ -14,6 +14,7 @@ #include <linux/ioport.h> #include <linux/delay.h> #include <linux/param.h> +#include <linux/mtd/physmap.h> #include <asm/txx9irq.h> #include <asm/txx9tmr.h> #include <asm/txx9pio.h> @@ -269,3 +270,16 @@ void __init tx4938_ethaddr_init(unsigned char *addr0, unsigned char *addr1) if (addr1 && (pcfg & TX4938_PCFG_ETH1_SEL)) txx9_ethaddr_init(TXX9_IRQ_BASE + TX4938_IR_ETH1, addr1); } + +void __init tx4938_mtd_init(int ch) +{ + struct physmap_flash_data pdata = { + .width = TX4938_EBUSC_WIDTH(ch) / 8, + }; + unsigned long start = txx9_ce_res[ch].start; + unsigned long size = txx9_ce_res[ch].end - start + 1; + + if (!(TX4938_EBUSC_CR(ch) & 0x8)) + return; /* disabled */ + txx9_physmap_flash_init(ch, start, size, &pdata); +} |