u-boot/arch/arm/mach-at91
Tudor Ambarus f206af80f8 ARM: at91: sama7g5: Reset external devices at software reset
sama7g5 and other SoCs (sama5d3, sam9x60) define in the Reset Controller
a RSTC_CR.EXTRST bit that asserts the nrst_out pin which resets external
devices.

This is particular useful for external devices that are configured in
stateful modes which can not be undone without reconfiguring the device
or without resetting the device. An example is an SPI NOR flash that is
configured in octal mode. The do_reset u-boot cmd does not call any
driver's remove method, but merely resets the CPU. As the code was, this
left the flash in octal mode, being impossible for the first stage boot
loaders to recover/identify the flash after a "software reset".
RSTC_CR.EXTRST comes in handy here, as it can be set at "software reset"
to assert low the nrst_out pin during a time defined by the RSTC_MR.ERSTL
field and reset the external devices (including the SPI NOR flash in the
example).
nrst_out is always asserted at "user reset" and it resets the external
devices correctly. Asserting nrst_out at "software reset" should behave
in a similar way. The only difference that I could find between the two
types of resets in regards to the nrst_out signal, is that at "user reset"
timing diagram the "Processor and Peripherals Reset Line" rises after six
MD_SLCK cycles after the nrst_out line rose, while at the "software reset"
timing diagram the "Processor and Peripherals Reset Line" is active for
3 MD_SLCK cycles + 2 MCK cycles. In other words, in the "software reset"
case the nrst_out signal can be active for a longer period of time than the
"Processor and Peripherals Reset Line" active time, depending on the
RSTC_MR.ERSTL value.
Using the default value (zero) for RSTC_MR.ERSTL, worked just fine for the
sama7g5 case. Tested QSPI0 and GMAC0/GMAC1 on sama7g5ek rev 4 after a
software reset with RSTC_CR.EXTRST=1 and RSTC_MR.ERSTL=0.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2022-04-01 15:42:46 +03:00
..
arm920t Convert CONFIG_SKIP_LOWLEVEL_INIT et al to Kconfig 2021-08-31 17:47:49 -04:00
arm926ejs ARM: mach-at91: Add compile time option to choose proper timer 2021-12-16 11:41:45 +02:00
armv7 WS cleanup: remove trailing empty lines 2021-09-30 08:08:56 -04:00
include/mach ARM: at91: sama5d2: Enable the use of Galois Tables from ROM 2022-04-01 15:42:46 +03:00
atmel_sfr.c WS cleanup: remove trailing empty lines 2021-09-30 08:08:56 -04:00
bootparams_atmel.S SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
clock.c watchdog: at91sam9_wdt: Remove now superfluous wdt start and reset 2019-04-26 09:16:32 +02:00
config.mk Makefile: Rename ALL-y to INPUTS-y 2020-07-28 19:30:39 -06:00
Kconfig ARM: at91: sama7g5: Reset external devices at software reset 2022-04-01 15:42:46 +03:00
Makefile ARM: at91: sfr: convert to Kconfig 2019-10-08 09:16:11 +03:00
matrix.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mpddrc.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
phy.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
sdram.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
spl.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
spl_at91.c serial: Rename SERIAL_SUPPORT to SERIAL 2021-09-04 12:26:01 -04:00
spl_atmel.c ARM: at91: spl: add spl_early_init for sama5d2 platforms 2021-01-22 15:09:59 +02:00