Skip to content
Snippets Groups Projects
Commit 52f114a1 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

SAMA5 NOR boot: Use a static memory variable to determine if/when we boot to NOR FLASH

parent 5fef7703
No related branches found
No related tags found
No related merge requests found
......@@ -88,10 +88,19 @@ int nor_main(int argc, char *argv)
{
uint32_t regval;
/* Here we have a in memory value we can change in the debugger
* to begin booting in NOR Flash
*/
static volatile uint32_t wait = 1;
#ifdef CONFIG_SAMA5D3xEK_NOR_START
printf("Configuring and booting from NOR FLASH on CS0\n");
wait = 0;
#else
printf("Configuring NOR FLASH on CS0 and halting\n");
printf("Configuring NOR FLASH on CS0 and waiting\n");
wait = 1;
#endif
/* Make sure that the SMC peripheral is enabled (But of course it is... we
......@@ -180,16 +189,14 @@ int nor_main(int argc, char *argv)
cp15_invalidate_dcache_all();
cp15_invalidate_tlbs();
#ifdef CONFIG_SAMA5D3xEK_NOR_START
/* Then jump into NOR flash */
NOR_ENTRY();
while (!wait)
{
}
#else
/* Or just wait patiently for the user to break in with GDB. */
NOR_ENTRY();
for (;;);
#endif
return 0; /* We should not get here in either case */
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment