initcode.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Code for early processor initialization
  3. *
  4. * Copyright (c) 2004-2011 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #ifndef __BFIN_INITCODE_H__
  9. #define __BFIN_INITCODE_H__
  10. #include <asm/mach-common/bits/bootrom.h>
  11. #ifndef BFIN_IN_INITCODE
  12. # define serial_putc(c)
  13. #endif
  14. #ifndef CONFIG_EBIU_RSTCTL_VAL
  15. # define CONFIG_EBIU_RSTCTL_VAL 0 /* only MDDRENABLE is useful */
  16. #endif
  17. #if ((CONFIG_EBIU_RSTCTL_VAL & 0xFFFFFFC4) != 0)
  18. # error invalid EBIU_RSTCTL value: must not set reserved bits
  19. #endif
  20. #ifndef CONFIG_EBIU_MBSCTL_VAL
  21. # define CONFIG_EBIU_MBSCTL_VAL 0
  22. #endif
  23. #if defined(CONFIG_EBIU_DDRQUE_VAL) && ((CONFIG_EBIU_DDRQUE_VAL & 0xFFFF8000) != 0)
  24. # error invalid EBIU_DDRQUE value: must not set reserved bits
  25. #endif
  26. __attribute__((always_inline)) static inline void
  27. program_async_controller(ADI_BOOT_DATA *bs)
  28. {
  29. #ifdef BFIN_IN_INITCODE
  30. /*
  31. * We really only need to setup the async banks early if we're
  32. * booting out of it. Otherwise, do it later on in cpu_init.
  33. */
  34. if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_BYPASS &&
  35. CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_PARA)
  36. return;
  37. #endif
  38. serial_putc('a');
  39. /* Program the async banks controller. */
  40. bfin_write_EBIU_AMBCTL0(CONFIG_EBIU_AMBCTL0_VAL);
  41. bfin_write_EBIU_AMBCTL1(CONFIG_EBIU_AMBCTL1_VAL);
  42. bfin_write_EBIU_AMGCTL(CONFIG_EBIU_AMGCTL_VAL);
  43. serial_putc('b');
  44. /* Not all parts have these additional MMRs. */
  45. #ifdef EBIU_MBSCTL
  46. bfin_write_EBIU_MBSCTL(CONFIG_EBIU_MBSCTL_VAL);
  47. #endif
  48. #ifdef EBIU_MODE
  49. # ifdef CONFIG_EBIU_MODE_VAL
  50. bfin_write_EBIU_MODE(CONFIG_EBIU_MODE_VAL);
  51. # endif
  52. # ifdef CONFIG_EBIU_FCTL_VAL
  53. bfin_write_EBIU_FCTL(CONFIG_EBIU_FCTL_VAL);
  54. # endif
  55. #endif
  56. serial_putc('c');
  57. }
  58. #endif