sdram.h 909 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (C) 2006 Atmel Corporation
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __ASM_AVR32_SDRAM_H
  7. #define __ASM_AVR32_SDRAM_H
  8. struct sdram_config {
  9. /* Number of data bits. */
  10. enum {
  11. SDRAM_DATA_16BIT = 16,
  12. SDRAM_DATA_32BIT = 32,
  13. } data_bits;
  14. /* Number of address bits */
  15. uint8_t row_bits, col_bits, bank_bits;
  16. /* SDRAM timings in cycles */
  17. uint8_t cas, twr, trc, trp, trcd, tras, txsr;
  18. /* SDRAM refresh period in cycles */
  19. unsigned long refresh_period;
  20. };
  21. /*
  22. * Attempt to initialize the SDRAM controller using the specified
  23. * parameters. Return the expected size of the memory area based on
  24. * the number of address and data bits.
  25. *
  26. * The caller should verify that the configuration is correct by
  27. * running a memory test, e.g. get_ram_size().
  28. */
  29. extern unsigned long sdram_init(void *sdram_base,
  30. const struct sdram_config *config);
  31. #endif /* __ASM_AVR32_SDRAM_H */