diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-04-03 15:40:51 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-04-03 15:40:51 -0600 |
commit | ab7ab64d02f46d5a60415b019bcf396492810f82 (patch) | |
tree | e953eed0b1538d6d1d202b0fa8897e10070578a5 | |
parent | b515dab3c55920c11ae7bcece66f239bf69ae516 (diff) | |
download | px4-nuttx-ab7ab64d02f46d5a60415b019bcf396492810f82.tar.gz px4-nuttx-ab7ab64d02f46d5a60415b019bcf396492810f82.tar.bz2 px4-nuttx-ab7ab64d02f46d5a60415b019bcf396492810f82.zip |
Updated NOR boot logic from David Sidrane
-rw-r--r-- | nuttx/configs/sama5d3x-ek/src/nor_main.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/nuttx/configs/sama5d3x-ek/src/nor_main.c b/nuttx/configs/sama5d3x-ek/src/nor_main.c index f84091852..063ba1d1f 100644 --- a/nuttx/configs/sama5d3x-ek/src/nor_main.c +++ b/nuttx/configs/sama5d3x-ek/src/nor_main.c @@ -1,7 +1,7 @@ /***************************************************************************** * configs/sama5d3x-ek/src/nor_main.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -61,6 +61,15 @@ #define NOR_ENTRY ((nor_entry_t)SAM_EBICS0_VSECTION) +#define NOR_WAIT 1 +#define NOR_NO_WAIT 0 + +#ifdef CONFIG_SAMA5D3xEK_NOR_START +# define NOR_BOOT_MODE NOR_NO_WAIT +#else +# define NOR_BOOT_MODE NOR_WAIT +#endif + /**************************************************************************** * Private Types ****************************************************************************/ @@ -92,16 +101,9 @@ int nor_main(int argc, char *argv) * to begin booting in NOR Flash */ - static volatile uint32_t wait = 1; + static volatile uint32_t wait = NOR_BOOT_MODE; -#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 waiting\n"); - wait = 1; -#endif + printf("Configuring NOR FLASH on CS0 and %s\n", wait ? "waiting" : "booting"); /* Make sure that the SMC peripheral is enabled (But of course it is... we * are executing from NOR FLASH now). @@ -191,12 +193,11 @@ int nor_main(int argc, char *argv) /* Then jump into NOR flash */ - while (!wait) + while (wait) { } NOR_ENTRY(); - return 0; /* We should not get here in either case */ } |