Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
magic-lantern
magic-lantern
Commits
f9ec9ef0f974
Commit
405bd131
authored
Aug 01, 2010
by
hudson@andromeda.local
Browse files
Flag autoboot versus a firmware update
--HG-- branch : 550d
parent
cc1c1fd4d878
Changes
3
Hide whitespace changes
Inline
Side-by-side
5d-hack.c
View file @
f9ec9ef0
...
@@ -51,6 +51,9 @@ static uint8_t _reloc[ RELOCSIZE ];
...
@@ -51,6 +51,9 @@ static uint8_t _reloc[ RELOCSIZE ];
#define FIXUP_BRANCH( rom_addr, dest_addr ) \
#define FIXUP_BRANCH( rom_addr, dest_addr ) \
INSTR( rom_addr ) = BL_INSTR( &INSTR( rom_addr ), (dest_addr) )
INSTR( rom_addr ) = BL_INSTR( &INSTR( rom_addr ), (dest_addr) )
/** Was this an autoboot or firmware file load? */
int
autoboot_loaded
;
/** Specified by the linker */
/** Specified by the linker */
extern
uint32_t
_bss_start
[],
_bss_end
[];
extern
uint32_t
_bss_start
[],
_bss_end
[];
...
@@ -66,10 +69,13 @@ zero_bss( void )
...
@@ -66,10 +69,13 @@ zero_bss( void )
void
void
__attribute__
((
noreturn
,
noinline
,
naked
))
__attribute__
((
noreturn
,
noinline
,
naked
))
copy_and_restart
(
void
)
copy_and_restart
(
int
offset
)
{
{
zero_bss
();
zero_bss
();
// Set the flag if this was an autoboot load
autoboot_loaded
=
(
offset
==
0
);
// Copy the firmware to somewhere safe in memory
// Copy the firmware to somewhere safe in memory
const
uint8_t
*
const
firmware_start
=
(
void
*
)
ROMBASEADDR
;
const
uint8_t
*
const
firmware_start
=
(
void
*
)
ROMBASEADDR
;
const
uint32_t
firmware_len
=
RELOCSIZE
;
const
uint32_t
firmware_len
=
RELOCSIZE
;
...
...
dryos.h
View file @
f9ec9ef0
...
@@ -677,4 +677,8 @@ free_dma_memory(
...
@@ -677,4 +677,8 @@ free_dma_memory(
);
);
/** Set if the firmware was loaded via AUTOEXEC.BIN */
extern
int
autoboot_loaded
;
#endif
#endif
reboot.c
View file @
f9ec9ef0
...
@@ -121,14 +121,14 @@ cstart( void )
...
@@ -121,14 +121,14 @@ cstart( void )
flush_caches
();
flush_caches
();
// Jump into the newly relocated code
// Jump into the newly relocated code
void
__attribute__
((
noreturn
))(
*
copy_and_restart
)(
void
)
void
__attribute__
((
noreturn
))(
*
copy_and_restart
)(
int
)
=
(
void
*
)
RESTARTSTART
;
=
(
void
*
)
RESTARTSTART
;
void
__attribute__
((
noreturn
))(
*
firmware_start
)(
void
)
void
__attribute__
((
noreturn
))(
*
firmware_start
)(
void
)
=
(
void
*
)
ROMBASEADDR
;
=
(
void
*
)
ROMBASEADDR
;
if
(
1
)
if
(
1
)
copy_and_restart
();
copy_and_restart
(
offset
);
else
else
firmware_start
();
firmware_start
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment