forked from Imagelibrary/rtems
gensh4: Improve ROM vs RAM startup configuration
This commit is contained in:
@@ -23,13 +23,14 @@ AC_DEFINE_UNQUOTED(
|
|||||||
# START_HW_INIT
|
# START_HW_INIT
|
||||||
# This switch selects whether 'early_hw_init()' is called from
|
# This switch selects whether 'early_hw_init()' is called from
|
||||||
# 'start.S'; 'bsp_hw_init()' is always called from 'bspstart.c'
|
# 'start.S'; 'bsp_hw_init()' is always called from 'bspstart.c'
|
||||||
#
|
RTEMS_BSPOPTS_SET([START_HW_INIT],[*],[0])
|
||||||
START_HW_INIT=${START_HW_INIT-1}
|
RTEMS_BSPOPTS_HELP([START_HW_INIT],
|
||||||
AC_DEFINE_UNQUOTED(
|
|
||||||
[START_HW_INIT],
|
|
||||||
[$START_HW_INIT],
|
|
||||||
[Whether to call early_hw_init from start.S])
|
[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)
|
RTEMS_BSP_CLEANUP_OPTIONS(0, 0)
|
||||||
|
|
||||||
# Explicitly list all Makefiles here
|
# Explicitly list all Makefiles here
|
||||||
|
|||||||
@@ -80,10 +80,10 @@ fake_func:
|
|||||||
bt hw_init_end
|
bt hw_init_end
|
||||||
nop
|
nop
|
||||||
|
|
||||||
#if defined(START_HW_INIT) /* from $RTEMS_BSP.cfg */
|
#if START_HW_INIT /* from $RTEMS_BSP.cfg */
|
||||||
! Initialize minimal hardware
|
! Initialize minimal hardware
|
||||||
! to run hw_init we need to calculate its address
|
! 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 hw_init_k, r0
|
||||||
mov.l copy_start_k, r1
|
mov.l copy_start_k, r1
|
||||||
mov.l copy_end_k, r2
|
mov.l copy_end_k, r2
|
||||||
@@ -102,6 +102,7 @@ fake_func:
|
|||||||
#endif /* START_HW_INIT */
|
#endif /* START_HW_INIT */
|
||||||
hw_init_end:
|
hw_init_end:
|
||||||
|
|
||||||
|
#if COPY_DATA_FROM_ROM
|
||||||
! copy data from rom to ram
|
! copy data from rom to ram
|
||||||
mov.l copy_start_k, r0
|
mov.l copy_start_k, r0
|
||||||
mov.l copy_end_k, r1
|
mov.l copy_end_k, r1
|
||||||
@@ -123,6 +124,7 @@ copy_data_cycle:
|
|||||||
nop
|
nop
|
||||||
|
|
||||||
end_of_copy_data_cycle:
|
end_of_copy_data_cycle:
|
||||||
|
#endif
|
||||||
! go to 0x8....... adresses
|
! go to 0x8....... adresses
|
||||||
mov.l real_address_k, r0
|
mov.l real_address_k, r0
|
||||||
lds r0, pr
|
lds r0, pr
|
||||||
@@ -193,12 +195,16 @@ __stop:
|
|||||||
END_CODE
|
END_CODE
|
||||||
|
|
||||||
.align 2
|
.align 2
|
||||||
|
#if START_HW_INIT
|
||||||
copy_start_k:
|
copy_start_k:
|
||||||
.long copy_start
|
.long copy_start
|
||||||
copy_end_k:
|
copy_end_k:
|
||||||
.long copy_end
|
.long copy_end
|
||||||
|
#endif
|
||||||
|
#if COPY_DATA_FROM_ROM
|
||||||
copy_start_in_rom_k:
|
copy_start_in_rom_k:
|
||||||
.long copy_start_in_rom
|
.long copy_start_in_rom
|
||||||
|
#endif
|
||||||
|
|
||||||
real_address_k:
|
real_address_k:
|
||||||
.long real_address
|
.long real_address
|
||||||
@@ -219,7 +225,7 @@ main_k:
|
|||||||
exit_k:
|
exit_k:
|
||||||
.long SYM(_exit)
|
.long SYM(_exit)
|
||||||
|
|
||||||
#ifdef START_HW_INIT /* from $RTEMS_BSP.cfg */
|
#if START_HW_INIT /* from $RTEMS_BSP.cfg */
|
||||||
hw_init_k:
|
hw_init_k:
|
||||||
.long SYM(early_hw_init)
|
.long SYM(early_hw_init)
|
||||||
#endif /* START_HW_INIT */
|
#endif /* START_HW_INIT */
|
||||||
|
|||||||
Reference in New Issue
Block a user