s5j: introduce s5j_board_initialize()
authorHeesub Shin <heesub.shin@samsung.com>
Thu, 16 Mar 2017 10:11:13 +0000 (19:11 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Mon, 17 Apr 2017 10:52:03 +0000 (19:52 +0900)
This commit introduces a new interface for performing board-specific
initialization at the very early stage of boot. Every board which
derives S5J processor should implement it and initialize resources or
devices.

Change-Id: I693388bacc99ebee899e12f8251deed6c7c579e7

os/arch/arm/src/s5j/s5j_boot.c
os/arch/arm/src/sidk_s5jt200/src/s5jt200_boot.c

index f84af62..9d8a21d 100644 (file)
@@ -200,6 +200,18 @@ void arm_boot(void)
 #ifdef USE_EARLYSERIALINIT
        up_earlyserialinit();
 #endif
-       os_start();
 
+       /*
+        * Perform board-specific initialization. This must include:
+        *
+        * - Initialization of board-specific memory resources (e.g., SDRAM)
+        * - Configuration of board specific resources (GPIOs, LEDs, etc).
+        *
+        * NOTE: we must use caution prior to this point to make sure that
+        * the logic does not access any global variables that might lie
+        * in SDRAM.
+        */
+       s5j_board_initialize();
+
+       os_start();
 }
index bfb427b..67ea943 100644 (file)
@@ -380,6 +380,35 @@ void wlan_initup(struct netif *dev)
 #endif
 
 /****************************************************************************
+ * Name: s5j_board_initialize
+ *
+ * Description:
+ *   All S5J architectures must provide the following entry point. This entry
+ *   point is called early in the initialization -- after all memory has been
+ *   configured and mapped but before any devices have been initialized.
+ *
+ *   This function must perform low level initialization including:
+ *
+ *   - Initialization of board-specific memory resources (e.g., SDRAM)
+ *   - Configuration of board-specific resources (GPIOs, LEDs, etc).
+ *   - Setup of the console UART. This UART done early so that the serial
+ *     console is available for debugging very early in the boot sequence.
+ *
+ *   Special precautions must be taken if .data/.bss lie in SRAM. In that
+ *   case, the boot logic cannot initialize .data or .bss. The function
+ *   must then:
+ *
+ *   - Take precautions to assume that logic does not access any global
+ *     data that might lie in SDRAM.
+ *   - Call the function arm_data_initialize() as soon as SDRAM has been
+ *     properly configured for use.
+ *
+ ****************************************************************************/
+void s5j_board_initialize(void)
+{
+}
+
+/****************************************************************************
  * Name: board_initialize
  *
  * Description: