summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-08-25 16:53:13 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-08-25 17:00:49 -0500
commit3d99c17deb0e61db71e332a6890bce0651500de7 (patch)
tree611bb0bc77d433edba4b9e43dfa1240fb7dd16af
parentbf1f8764831eb20cccecc9a45f5ec8e30bbcebc2 (diff)
downloadrtems-3d99c17deb0e61db71e332a6890bce0651500de7.tar.bz2
gensh4: Improve ROM vs RAM startup configuration
-rw-r--r--c/src/lib/libbsp/sh/gensh4/configure.ac13
-rw-r--r--c/src/lib/libbsp/sh/gensh4/start/start.S12
2 files changed, 16 insertions, 9 deletions
diff --git a/c/src/lib/libbsp/sh/gensh4/configure.ac b/c/src/lib/libbsp/sh/gensh4/configure.ac
index eeaf6d8a2d..372d65a5f1 100644
--- a/c/src/lib/libbsp/sh/gensh4/configure.ac
+++ b/c/src/lib/libbsp/sh/gensh4/configure.ac
@@ -23,12 +23,13 @@ AC_DEFINE_UNQUOTED(
# START_HW_INIT
# This switch selects whether 'early_hw_init()' is called from
# 'start.S'; 'bsp_hw_init()' is always called from 'bspstart.c'
-#
-START_HW_INIT=${START_HW_INIT-1}
-AC_DEFINE_UNQUOTED(
- [START_HW_INIT],
- [$START_HW_INIT],
- [Whether to call early_hw_init from start.S])
+RTEMS_BSPOPTS_SET([START_HW_INIT],[*],[0])
+RTEMS_BSPOPTS_HELP([START_HW_INIT],
+ [Whether to call early_hw_init from start.S])
+
+RTEMS_BSPOPTS_SET([COPY_DATA_FROM_ROM],[*],[0])
+RTEMS_BSPOPTS_HELP([COPY_DATA_FROM_ROM],
+ [Whether to copy data from ROM to RAM in start.S])
RTEMS_BSP_CLEANUP_OPTIONS(0, 0)
diff --git a/c/src/lib/libbsp/sh/gensh4/start/start.S b/c/src/lib/libbsp/sh/gensh4/start/start.S
index 7dce1a7d16..a695daaf8a 100644
--- a/c/src/lib/libbsp/sh/gensh4/start/start.S
+++ b/c/src/lib/libbsp/sh/gensh4/start/start.S
@@ -80,10 +80,10 @@ fake_func:
bt hw_init_end
nop
-#if defined(START_HW_INIT) /* from $RTEMS_BSP.cfg */
+#if START_HW_INIT /* from $RTEMS_BSP.cfg */
! Initialize minimal hardware
! to run hw_init we need to calculate its address
- ! as it is before data coping
+ ! as it is before data copying
mov.l hw_init_k, r0
mov.l copy_start_k, r1
mov.l copy_end_k, r2
@@ -102,6 +102,7 @@ fake_func:
#endif /* START_HW_INIT */
hw_init_end:
+#if COPY_DATA_FROM_ROM
! copy data from rom to ram
mov.l copy_start_k, r0
mov.l copy_end_k, r1
@@ -123,6 +124,7 @@ copy_data_cycle:
nop
end_of_copy_data_cycle:
+#endif
! go to 0x8....... adresses
mov.l real_address_k, r0
lds r0, pr
@@ -193,12 +195,16 @@ __stop:
END_CODE
.align 2
+#if START_HW_INIT
copy_start_k:
.long copy_start
copy_end_k:
.long copy_end
+#endif
+#if COPY_DATA_FROM_ROM
copy_start_in_rom_k:
.long copy_start_in_rom
+#endif
real_address_k:
.long real_address
@@ -219,7 +225,7 @@ main_k:
exit_k:
.long SYM(_exit)
-#ifdef START_HW_INIT /* from $RTEMS_BSP.cfg */
+#if START_HW_INIT /* from $RTEMS_BSP.cfg */
hw_init_k:
.long SYM(early_hw_init)
#endif /* START_HW_INIT */