onenand_uboot.c 923 B

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