physmap.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * For boards with physically mapped flash and using
  3. * drivers/mtd/maps/physmap.c mapping driver.
  4. *
  5. * $Id: physmap.h,v 1.3 2004/07/21 00:16:15 jwboyer Exp $
  6. *
  7. * Copyright (C) 2003 MontaVista Software Inc.
  8. * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. *
  15. */
  16. #ifndef __LINUX_MTD_PHYSMAP__
  17. #include <linux/config.h>
  18. #if defined(CONFIG_MTD_PHYSMAP)
  19. #include <linux/mtd/mtd.h>
  20. #include <linux/mtd/map.h>
  21. #include <linux/mtd/partitions.h>
  22. /*
  23. * The map_info for physmap. Board can override size, buswidth, phys,
  24. * (*set_vpp)(), etc in their initial setup routine.
  25. */
  26. extern struct map_info physmap_map;
  27. /*
  28. * Board needs to specify the exact mapping during their setup time.
  29. */
  30. static inline void physmap_configure(unsigned long addr, unsigned long size, int bankwidth, void (*set_vpp)(struct map_info *, int) )
  31. {
  32. physmap_map.phys = addr;
  33. physmap_map.size = size;
  34. physmap_map.bankwidth = bankwidth;
  35. physmap_map.set_vpp = set_vpp;
  36. }
  37. #if defined(CONFIG_MTD_PARTITIONS)
  38. /*
  39. * Machines that wish to do flash partition may want to call this function in
  40. * their setup routine.
  41. *
  42. * physmap_set_partitions(mypartitions, num_parts);
  43. *
  44. * Note that one can always override this hard-coded partition with
  45. * command line partition (you need to enable CONFIG_MTD_CMDLINE_PARTS).
  46. */
  47. void physmap_set_partitions(struct mtd_partition *parts, int num_parts);
  48. #endif /* defined(CONFIG_MTD_PARTITIONS) */
  49. #endif /* defined(CONFIG_MTD) */
  50. #endif /* __LINUX_MTD_PHYSMAP__ */