sram.h 813 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * mach/sram.h - DaVinci simple SRAM allocator
  4. *
  5. * Copyright (C) 2009 David Brownell
  6. */
  7. #ifndef __MACH_SRAM_H
  8. #define __MACH_SRAM_H
  9. /* ARBITRARY: SRAM allocations are multiples of this 2^N size */
  10. #define SRAM_GRANULARITY 512
  11. /*
  12. * SRAM allocations return a CPU virtual address, or NULL on error.
  13. * If a DMA address is requested and the SRAM supports DMA, its
  14. * mapped address is also returned.
  15. *
  16. * Errors include SRAM memory not being available, and requesting
  17. * DMA mapped SRAM on systems which don't allow that.
  18. */
  19. extern void *sram_alloc(size_t len, dma_addr_t *dma);
  20. extern void sram_free(void *addr, size_t len);
  21. /* Get the struct gen_pool * for use in platform data */
  22. extern struct gen_pool *sram_get_gen_pool(void);
  23. #endif /* __MACH_SRAM_H */