jz4780-nemc.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * JZ4780 NAND/external memory controller (NEMC)
  3. *
  4. * Copyright (c) 2015 Imagination Technologies
  5. * Author: Alex Smith <alex@alex-smith.me.uk>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. */
  12. #ifndef __LINUX_JZ4780_NEMC_H__
  13. #define __LINUX_JZ4780_NEMC_H__
  14. #include <linux/types.h>
  15. struct device;
  16. /*
  17. * Number of NEMC banks. Note that there are actually 6, but they are numbered
  18. * from 1.
  19. */
  20. #define JZ4780_NEMC_NUM_BANKS 7
  21. /**
  22. * enum jz4780_nemc_bank_type - device types which can be connected to a bank
  23. * @JZ4780_NEMC_BANK_SRAM: SRAM
  24. * @JZ4780_NEMC_BANK_NAND: NAND
  25. */
  26. enum jz4780_nemc_bank_type {
  27. JZ4780_NEMC_BANK_SRAM,
  28. JZ4780_NEMC_BANK_NAND,
  29. };
  30. extern unsigned int jz4780_nemc_num_banks(struct device *dev);
  31. extern void jz4780_nemc_set_type(struct device *dev, unsigned int bank,
  32. enum jz4780_nemc_bank_type type);
  33. extern void jz4780_nemc_assert(struct device *dev, unsigned int bank,
  34. bool assert);
  35. #endif /* __LINUX_JZ4780_NEMC_H__ */