|
@@ -24,6 +24,7 @@
|
|
|
|
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/module.h>
|
|
#include <linux/module.h>
|
|
|
|
+#include <linux/moduleparam.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/mtd/mtd.h>
|
|
#include <linux/mtd/mtd.h>
|
|
#include <linux/mtd/nand.h>
|
|
#include <linux/mtd/nand.h>
|
|
@@ -47,6 +48,9 @@
|
|
#define no_ecc 0
|
|
#define no_ecc 0
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+static int on_flash_bbt = 0;
|
|
|
|
+module_param(on_flash_bbt, int, 0);
|
|
|
|
+
|
|
/* Register access macros */
|
|
/* Register access macros */
|
|
#define ecc_readl(add, reg) \
|
|
#define ecc_readl(add, reg) \
|
|
__raw_readl(add + ATMEL_ECC_##reg)
|
|
__raw_readl(add + ATMEL_ECC_##reg)
|
|
@@ -459,12 +463,17 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
|
|
|
|
|
|
if (host->board->det_pin) {
|
|
if (host->board->det_pin) {
|
|
if (gpio_get_value(host->board->det_pin)) {
|
|
if (gpio_get_value(host->board->det_pin)) {
|
|
- printk("No SmartMedia card inserted.\n");
|
|
|
|
|
|
+ printk(KERN_INFO "No SmartMedia card inserted.\n");
|
|
res = ENXIO;
|
|
res = ENXIO;
|
|
goto err_no_card;
|
|
goto err_no_card;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (on_flash_bbt) {
|
|
|
|
+ printk(KERN_INFO "atmel_nand: Use On Flash BBT\n");
|
|
|
|
+ nand_chip->options |= NAND_USE_FLASH_BBT;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* first scan to find the device and get the page size */
|
|
/* first scan to find the device and get the page size */
|
|
if (nand_scan_ident(mtd, 1)) {
|
|
if (nand_scan_ident(mtd, 1)) {
|
|
res = -ENXIO;
|
|
res = -ENXIO;
|