blackfin-config-pre.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * blackfin-config-pre.h - common defines for Blackfin boards in config.h
  3. *
  4. * Copyright (c) 2007 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #ifndef __ASM_BLACKFIN_CONFIG_PRE_H__
  9. #define __ASM_BLACKFIN_CONFIG_PRE_H__
  10. /* Misc helper functions */
  11. #define XMK_STR(x) #x
  12. #define MK_STR(x) XMK_STR(x)
  13. #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
  14. /* Configurable Blackfin-specific monitor commands */
  15. #define CONFIG_SYS_BFIN_CMD_BOOTLDR 0x01
  16. #define CONFIG_SYS_BFIN_CMD_CPLBINFO 0x02
  17. #define CONFIG_SYS_BFIN_CMD_OTP 0x04
  18. #define CONFIG_SYS_BFIN_CMD_CACHE_DUMP 0x08
  19. /* Bootmode defines -- your config needs to select this via CONFIG_BFIN_BOOT_MODE.
  20. * Depending on your cpu, some of these may not be valid, check your HRM.
  21. * The actual values here are meaningless as long as they're unique.
  22. */
  23. #define BFIN_BOOT_BYPASS 1 /* bypass bootrom */
  24. #define BFIN_BOOT_PARA 2 /* boot ldr out of parallel flash */
  25. #define BFIN_BOOT_SPI_MASTER 3 /* boot ldr out of serial flash */
  26. #define BFIN_BOOT_SPI_SLAVE 4 /* boot ldr as spi slave */
  27. #define BFIN_BOOT_TWI_MASTER 5 /* boot ldr over twi device */
  28. #define BFIN_BOOT_TWI_SLAVE 6 /* boot ldr over twi slave */
  29. #define BFIN_BOOT_UART 7 /* boot ldr over uart */
  30. #define BFIN_BOOT_IDLE 8 /* do nothing, just idle */
  31. #define BFIN_BOOT_FIFO 9 /* boot ldr out of FIFO */
  32. #define BFIN_BOOT_MEM 10 /* boot ldr out of memory (warmboot) */
  33. #define BFIN_BOOT_16HOST_DMA 11 /* boot ldr from 16-bit host dma */
  34. #define BFIN_BOOT_8HOST_DMA 12 /* boot ldr from 8-bit host dma */
  35. #define BFIN_BOOT_NAND 13 /* boot ldr from nand flash */
  36. #ifndef __ASSEMBLY__
  37. static inline const char *get_bfin_boot_mode(int bfin_boot)
  38. {
  39. switch (bfin_boot) {
  40. case BFIN_BOOT_BYPASS: return "bypass";
  41. case BFIN_BOOT_PARA: return "parallel flash";
  42. case BFIN_BOOT_SPI_MASTER: return "spi flash";
  43. case BFIN_BOOT_SPI_SLAVE: return "spi slave";
  44. case BFIN_BOOT_TWI_MASTER: return "i2c flash";
  45. case BFIN_BOOT_TWI_SLAVE: return "i2c slave";
  46. case BFIN_BOOT_UART: return "uart";
  47. case BFIN_BOOT_IDLE: return "idle";
  48. case BFIN_BOOT_FIFO: return "fifo";
  49. case BFIN_BOOT_MEM: return "memory";
  50. case BFIN_BOOT_16HOST_DMA: return "16bit dma";
  51. case BFIN_BOOT_8HOST_DMA: return "8bit dma";
  52. case BFIN_BOOT_NAND: return "nand flash";
  53. default: return "INVALID";
  54. }
  55. }
  56. #endif
  57. #endif