diff options
-rw-r--r-- | arch/v850/kernel/setup.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/v850/kernel/setup.c b/arch/v850/kernel/setup.c index c41d72b01b88..4a222dc5ab82 100644 --- a/arch/v850/kernel/setup.c +++ b/arch/v850/kernel/setup.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * arch/v850/kernel/setup.c -- Arch-dependent initialization functions | 2 | * arch/v850/kernel/setup.c -- Arch-dependent initialization functions |
3 | * | 3 | * |
4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | 4 | * Copyright (C) 2001,02,03,05 NEC Electronics Corporation |
5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | 5 | * Copyright (C) 2001,02,03,05 Miles Bader <miles@gnu.org> |
6 | * | 6 | * |
7 | * This file is subject to the terms and conditions of the GNU General | 7 | * This file is subject to the terms and conditions of the GNU General |
8 | * Public License. See the file COPYING in the main directory of this | 8 | * Public License. See the file COPYING in the main directory of this |
@@ -98,10 +98,20 @@ void __init trap_init (void) | |||
98 | } | 98 | } |
99 | 99 | ||
100 | #ifdef CONFIG_MTD | 100 | #ifdef CONFIG_MTD |
101 | |||
102 | /* From drivers/mtd/devices/slram.c */ | ||
103 | #define SLRAM_BLK_SZ 0x4000 | ||
104 | |||
101 | /* Set the root filesystem to be the given memory region. | 105 | /* Set the root filesystem to be the given memory region. |
102 | Some parameter may be appended to CMD_LINE. */ | 106 | Some parameter may be appended to CMD_LINE. */ |
103 | void set_mem_root (void *addr, size_t len, char *cmd_line) | 107 | void set_mem_root (void *addr, size_t len, char *cmd_line) |
104 | { | 108 | { |
109 | /* Some sort of idiocy in MTD means we must supply a length that's | ||
110 | a multiple of SLRAM_BLK_SZ. We just round up the real length, | ||
111 | as the file system shouldn't attempt to access anything beyond | ||
112 | the end of the image anyway. */ | ||
113 | len = (((len - 1) + SLRAM_BLK_SZ) / SLRAM_BLK_SZ) * SLRAM_BLK_SZ; | ||
114 | |||
105 | /* The only way to pass info to the MTD slram driver is via | 115 | /* The only way to pass info to the MTD slram driver is via |
106 | the command line. */ | 116 | the command line. */ |
107 | if (*cmd_line) { | 117 | if (*cmd_line) { |