Jens Scharsig | 425de62 | 2010-02-03 22:45:42 +0100 | [diff] [blame] | 1 | New C structure AT91 SoC access |
| 2 | ================================= |
| 3 | |
| 4 | The goal |
| 5 | -------- |
| 6 | |
| 7 | Currently the at91 arch uses hundreds of address defines and special |
| 8 | at91_xxxx_write/read functions to access the SOC. |
| 9 | The u-boot project perferred method is to access memory mapped hw |
| 10 | regisister via a c structure. |
| 11 | |
| 12 | e.g. old |
| 13 | |
| 14 | *AT91C_PIOA_IDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; |
| 15 | *AT91C_PIOC_PUDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; |
| 16 | *AT91C_PIOC_PER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; |
| 17 | *AT91C_PIOC_OER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; |
| 18 | *AT91C_PIOC_PIO = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; |
| 19 | |
| 20 | at91_sys_write(AT91_RSTC_CR, |
| 21 | AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); |
| 22 | |
| 23 | e.g new |
| 24 | pin = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK; |
| 25 | writel(pin, &pio->pioa.idr); |
| 26 | writel(pin, &pio->pioa.pudr); |
| 27 | writel(pin, &pio->pioa.per); |
| 28 | writel(pin, &pio->pioa.oer); |
| 29 | writel(pin, &pio->pioa.sodr); |
| 30 | |
| 31 | writel(AT91_RSTC_KEY | AT91_RSTC_CR_PROCRST | |
| 32 | AT91_RSTC_CR_PERRST, &rstc->cr); |
| 33 | |
| 34 | The method for updating |
| 35 | ------------------------ |
| 36 | |
| 37 | 1. add's the temporary CONFIG_AT91_LEGACY to all at91 board configs |
| 38 | 2. Display a compile time warning, if the board has not been converted |
| 39 | 3. add new structures for SoC access |
| 40 | 4. Convert arch, driver and boards file to new SoC |
| 41 | 5. remove legacy code, if all boards and drives are ready |
Andreas Bießmann | 58fd563 | 2013-10-30 15:18:22 +0100 | [diff] [blame^] | 42 | |
| 43 | 2013-10-30 Andreas Bießmann <andreas.devel@googlemail.com>: |
| 44 | |
| 45 | The goal is almost reached, we could remove the CONFIG_AT91_LEGACY switch but |
| 46 | remain the CONFIG_ATMEL_LEGACY switch until the GPIO disaster is fixed. The |
| 47 | AT91 spi driver has also some CONFIG_ATMEL_LEGACY stuff left, so another point |
| 48 | to fix until this README can be removed. |