README.at91-soc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. New C structure AT91 SoC access
  2. =================================
  3. The goal
  4. --------
  5. Currently the at91 arch uses hundreds of address defines and special
  6. at91_xxxx_write/read functions to access the SOC.
  7. The u-boot project perferred method is to access memory mapped hw
  8. regisister via a c structure.
  9. e.g. old
  10. *AT91C_PIOA_IDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
  11. *AT91C_PIOC_PUDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
  12. *AT91C_PIOC_PER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
  13. *AT91C_PIOC_OER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
  14. *AT91C_PIOC_PIO = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
  15. at91_sys_write(AT91_RSTC_CR,
  16. AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
  17. e.g new
  18. pin = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
  19. writel(pin, &pio->pioa.idr);
  20. writel(pin, &pio->pioa.pudr);
  21. writel(pin, &pio->pioa.per);
  22. writel(pin, &pio->pioa.oer);
  23. writel(pin, &pio->pioa.sodr);
  24. writel(AT91_RSTC_KEY | AT91_RSTC_CR_PROCRST |
  25. AT91_RSTC_CR_PERRST, &rstc->cr);
  26. The method for updating
  27. ------------------------
  28. 1. add's the temporary CONFIG_AT91_LEGACY to all at91 board configs
  29. 2. Display a compile time warning, if the board has not been converted
  30. 3. add new structures for SoC access
  31. 4. Convert arch, driver and boards file to new SoC
  32. 5. remove legacy code, if all boards and drives are ready
  33. Join AT91 and AT91RM9200 SoC
  34. ==============================
  35. Approximately 95 percent of AT91 and AT91RM9200 SoC parts are the same.
  36. So, we should use the chance, to join both archs togetter.
  37. To do this follow step needed:
  38. 1. change Makefile
  39. @$(MKCONFIG) $(@:_config=) arm arm920t board vendor at91rm9200
  40. to
  41. @$(MKCONFIG) $(@:_config=) arm arm920t board vendor at91
  42. 2. remove CONFIG_AT91_LEGACY in board config
  43. 3. convert boards file to new SoC access
  44. 4. convert or change drivers
  45. To support the joining process, a new SoC dir (at91) has been adding to
  46. arm920t arch directory. This directory contains files like at91rm9200 dir, but
  47. uses the new c structure Soc access. The advantage of this is, we don't merge
  48. old Soc access code and new code while the board are not converted.
  49. Finally we can delete the whole at91rm9200 dir, if all board support the
  50. new AT91-SoC access.