1 /* 2 * drivers/mtd/onenand/onenand_uboot.c 3 * 4 * Copyright (C) 2005-2008 Samsung Electronics 5 * Kyungmin Park <kyungmin.park@samsung.com> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as 9 * published by the Free Software Foundation. 10 */ 11 12 /* 13 * OneNAND initialization at U-Boot 14 */ 15 16 #include <common.h> 17 18 #ifdef CONFIG_CMD_ONENAND 19 20 #include <linux/mtd/compat.h> 21 #include <linux/mtd/mtd.h> 22 #include <linux/mtd/onenand.h> 23 24 struct mtd_info onenand_mtd; 25 struct onenand_chip onenand_chip; 26 27 void onenand_init(void) 28 { 29 memset(&onenand_mtd, 0, sizeof(struct mtd_info)); 30 memset(&onenand_chip, 0, sizeof(struct onenand_chip)); 31 32 onenand_chip.base = (void *) CFG_ONENAND_BASE; 33 onenand_mtd.priv = &onenand_chip; 34 35 onenand_scan(&onenand_mtd, 1); 36 37 puts("OneNAND: "); 38 print_size(onenand_mtd.size, "\n"); 39 } 40 41 #endif /* CONFIG_CMD_ONENAND */ 42