onenand_uboot.c 862 B

123456789101112131415161718192021222324252627282930313233343536
  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. * OneNAND initialization at U-Boot
  13. */
  14. #include <common.h>
  15. #include <linux/mtd/compat.h>
  16. #include <linux/mtd/mtd.h>
  17. #include <linux/mtd/onenand.h>
  18. struct mtd_info onenand_mtd;
  19. struct onenand_chip onenand_chip;
  20. void onenand_init(void)
  21. {
  22. memset(&onenand_mtd, 0, sizeof(struct mtd_info));
  23. memset(&onenand_chip, 0, sizeof(struct onenand_chip));
  24. onenand_chip.base = (void *) CFG_ONENAND_BASE;
  25. onenand_mtd.priv = &onenand_chip;
  26. onenand_scan(&onenand_mtd, 1);
  27. puts("OneNAND: ");
  28. print_size(onenand_mtd.size, "\n");
  29. }