aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-07-10 04:08:26 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-07-10 04:08:26 -0400
commit16adce7b6f4dab015d0b93274b41f8aae6fe07a5 (patch)
treeaefe926d027e48aed5b6adc2e401dc0fbdb04be0 /drivers/mtd/onenand
parentc9856e39e0c3b4d260e4614b66b0a7e0e79ec0ac (diff)
[MTD] [ONENAND] Make onenand_sim compile on non-ARM platforms.
The whole point of a sim is that it should run almost anywhere. Gratuitously depending on '#define SZ_128K 131072' from an ARM-specific header isn't really a good idea. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/onenand')
-rw-r--r--drivers/mtd/onenand/onenand_sim.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/mtd/onenand/onenand_sim.c b/drivers/mtd/onenand/onenand_sim.c
index dfa39dfcc1b2..b80667309b3f 100644
--- a/drivers/mtd/onenand/onenand_sim.c
+++ b/drivers/mtd/onenand/onenand_sim.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * The OneNAND simulator 4 * The OneNAND simulator
5 * 5 *
6 * Copyright(C) 2005-2007 Samsung Electronics 6 * Copyright © 2005-2007 Samsung Electronics
7 * Kyungmin Park <kyungmin.park@samsung.com> 7 * Kyungmin Park <kyungmin.park@samsung.com>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -19,8 +19,7 @@
19#include <linux/mtd/partitions.h> 19#include <linux/mtd/partitions.h>
20#include <linux/mtd/onenand.h> 20#include <linux/mtd/onenand.h>
21 21
22#include <asm/io.h> 22#include <linux/io.h>
23#include <asm/sizes.h>
24 23
25#ifndef CONFIG_ONENAND_SIM_MANUFACTURER 24#ifndef CONFIG_ONENAND_SIM_MANUFACTURER
26#define CONFIG_ONENAND_SIM_MANUFACTURER 0xec 25#define CONFIG_ONENAND_SIM_MANUFACTURER 0xec
@@ -83,7 +82,8 @@ struct onenand_info *info;
83 82
84#define DPRINTK(format, args...) \ 83#define DPRINTK(format, args...) \
85do { \ 84do { \
86 printk("%s[%d]: " format "\n", __func__, __LINE__, ##args); \ 85 printk(KERN_DEBUG "%s[%d]: " format "\n", __func__, \
86 __LINE__, ##args); \
87} while (0) 87} while (0)
88 88
89/** 89/**
@@ -382,9 +382,9 @@ static int __init flash_init(struct onenand_flash *flash)
382 int density, size; 382 int density, size;
383 int buffer_size; 383 int buffer_size;
384 384
385 flash->base = kzalloc(SZ_128K, GFP_KERNEL); 385 flash->base = kzalloc(131072, GFP_KERNEL);
386 if (!flash->base) { 386 if (!flash->base) {
387 printk(KERN_ERR "Unalbe to allocate base address.\n"); 387 printk(KERN_ERR "Unable to allocate base address.\n");
388 return -ENOMEM; 388 return -ENOMEM;
389 } 389 }
390 390
@@ -393,7 +393,7 @@ static int __init flash_init(struct onenand_flash *flash)
393 393
394 ONENAND_CORE(flash) = vmalloc(size + (size >> 5)); 394 ONENAND_CORE(flash) = vmalloc(size + (size >> 5));
395 if (!ONENAND_CORE(flash)) { 395 if (!ONENAND_CORE(flash)) {
396 printk(KERN_ERR "Unalbe to allocate nand core address.\n"); 396 printk(KERN_ERR "Unable to allocate nand core address.\n");
397 kfree(flash->base); 397 kfree(flash->base);
398 return -ENOMEM; 398 return -ENOMEM;
399 } 399 }
@@ -406,9 +406,9 @@ static int __init flash_init(struct onenand_flash *flash)
406 writew(version_id, flash->base + ONENAND_REG_VERSION_ID); 406 writew(version_id, flash->base + ONENAND_REG_VERSION_ID);
407 407
408 if (density < 2) 408 if (density < 2)
409 buffer_size = 0x0400; /* 1KB page */ 409 buffer_size = 0x0400; /* 1KiB page */
410 else 410 else
411 buffer_size = 0x0800; /* 2KB page */ 411 buffer_size = 0x0800; /* 2KiB page */
412 writew(buffer_size, flash->base + ONENAND_REG_DATA_BUFFER_SIZE); 412 writew(buffer_size, flash->base + ONENAND_REG_DATA_BUFFER_SIZE);
413 413
414 return 0; 414 return 0;