u-boot/arch
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
..
arc dts: automatically build necessary .dtb files 2022-02-09 12:26:12 -07:00
arm ARM: at91: sama7g5: Reset external devices at software reset 2022-04-01 15:42:46 +03:00
m68k dts: automatically build necessary .dtb files 2022-02-09 12:26:12 -07:00
microblaze microblaze: Do not place u-boot to reserved memory location 2022-03-07 16:33:47 +01:00
mips event: Convert arch_cpu_init_dm() to use events 2022-03-10 08:28:36 -05:00
nds32 dts: automatically build necessary .dtb files 2022-02-09 12:26:12 -07:00
nios2 event: Convert arch_cpu_init_dm() to use events 2022-03-10 08:28:36 -05:00
powerpc Convert CONFIG_BACKSIDE_L2_CACHE to Kconfig 2022-03-25 12:01:15 +00:00
riscv Prepare v2022.04-rc5 2022-03-28 12:36:49 -04:00
sandbox sandbox: video: Replace PCI_CLASS_* macros by one from pci_ids.h 2022-03-25 13:35:50 -04:00
sh Split CONFIG_CC_OPTIMIZE_FOR_SIZE into two configs 2022-03-25 13:35:50 -04:00
x86 Prepare v2022.04-rc4 2022-03-14 17:40:36 -04:00
xtensa Convert CONFIG_BOARD_POSTCLK_INIT to Kconfig 2022-03-03 16:51:19 -05:00
.gitignore
Kconfig event: Convert arch_cpu_init_dm() to use events 2022-03-10 08:28:36 -05:00
u-boot-elf.lds arch: Add explicit linker script for u-boot-elf 2020-04-03 11:52:55 -04:00