blob: 4541b221772b35d140eae003fd821077b6116807 [file] [log] [blame]
Kyungmin Park79fe6832008-01-15 08:59:44 +09001/*
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>
Kyungmin Park79fe6832008-01-15 08:59:44 +090017#include <linux/mtd/compat.h>
18#include <linux/mtd/mtd.h>
19#include <linux/mtd/onenand.h>
20
21struct mtd_info onenand_mtd;
22struct onenand_chip onenand_chip;
23
24void onenand_init(void)
25{
26 memset(&onenand_mtd, 0, sizeof(struct mtd_info));
27 memset(&onenand_chip, 0, sizeof(struct onenand_chip));
28
Kyungmin Park79fe6832008-01-15 08:59:44 +090029 onenand_mtd.priv = &onenand_chip;
30
Kyungmin Parkdc7a79c2008-11-04 09:24:07 +090031#ifdef CONFIG_USE_ONENAND_BOARD_INIT
32 /*
33 * It's used for some board init required
34 */
35 onenand_board_init(&onenand_mtd);
36#else
37 onenand_chip.base = (void *) CONFIG_SYS_ONENAND_BASE;
38#endif
39
Kyungmin Park79fe6832008-01-15 08:59:44 +090040 onenand_scan(&onenand_mtd, 1);
41
42 puts("OneNAND: ");
43 print_size(onenand_mtd.size, "\n");
44}