Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Sami Nurmenniemi
u-boot-stm32
Commits
dc4dd6d1
Commit
dc4dd6d1
authored
Nov 14, 2018
by
Sami Nurmenniemi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable booting directly to QSPI with "go" command
- Supports booting image without u-boot headers on stm32
parent
50f9aed4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
18 deletions
+55
-18
board/emcraft/stm32f7-som/board.c
board/emcraft/stm32f7-som/board.c
+29
-0
drivers/net/stm32_eth.c
drivers/net/stm32_eth.c
+0
-18
include/asm-arm/arch-stm32/stm32.h
include/asm-arm/arch-stm32/stm32.h
+18
-0
include/configs/stm32f769i-discovery.h
include/configs/stm32f769i-discovery.h
+8
-0
No files found.
board/emcraft/stm32f7-som/board.c
View file @
dc4dd6d1
...
...
@@ -847,3 +847,32 @@ int board_late_init(void)
return
rv
;
}
#endif
/* BOARD_LATE_INIT */
#ifdef CONFIG_CMD_GO_DIRECT_JUMP
/* Code for overriding default "go" functionality for directly
jumping to a memory location without return. This is needed
since:
- We are executing from QSPI
- RTEMS image for stm32f769i places executable code in
in the beginning of QSPI address range
- Command bootm requires u-boot header before the executable code
*/
typedef
void
(
*
jump_t
)(
void
);
static
inline
void
__set_MSP
(
uint32_t
topOfMainStack
)
{
asm
volatile
(
"MSR msp, %0
\n
"
:
:
"r"
(
topOfMainStack
)
:
"sp"
);
}
unsigned
long
do_go_exec
(
ulong
(
*
entry
)(
int
,
char
*
[]),
int
argc
,
char
*
argv
[])
{
jump_t
jump
;
jump
=
(
jump_t
)
(
*
(
uint32_t
*
)(
entry
+
4
));
__set_MSP
(
*
(
uint32_t
*
)
entry
);
STM32_SYSCFG
->
memrmp
|=
SYSCFG_MEMRMP_SWP_FMC_0
;
CM3_SCB_REGS
->
vtor
=
(
uint32_t
)
entry
;
jump
();
return
0
;
}
#endif // CONFIG_CMD_GO_DIRECT_JUMP
drivers/net/stm32_eth.c
View file @
dc4dd6d1
...
...
@@ -138,11 +138,6 @@
#define STM32_DMA_RBD_RCH (1 << 14)
/* 2nd address chained*/
/*
* STM32 SYSCFG definitions
*/
#define STM32_SYSCFG_BASE (STM32_APB2PERIPH_BASE + 0x3800)
/*
* PMC reg fields
*/
...
...
@@ -250,19 +245,6 @@ struct stm32_mac_regs {
#define STM32_MAC ((volatile struct stm32_mac_regs *) \
STM32_MAC_BASE)
/*
* SYSCFG register map
*/
struct
stm32_syscfg_regs
{
u32
memrmp
;
/* Memory remap */
u32
pmc
;
/* Peripheral mode configuration */
u32
exticr
[
4
];
/* External interrupt configuration */
u32
rsv0
[
2
];
u32
cmpcr
;
/* Compensation cell control */
};
#define STM32_SYSCFG ((volatile struct stm32_syscfg_regs *) \
STM32_SYSCFG_BASE)
/*
* STM32 ETH Normal DMA buffer descriptors
*/
...
...
include/asm-arm/arch-stm32/stm32.h
View file @
dc4dd6d1
...
...
@@ -121,6 +121,24 @@ struct stm32_pwr_regs {
*/
#define STM32F4_LTDC_BASE (STM32_APB2PERIPH_BASE + 0x6800)
/*
* STM32 SYSCFG definitions
*/
#define STM32_SYSCFG_BASE (STM32_APB2PERIPH_BASE + 0x3800)
/*
* SYSCFG register map
*/
struct
stm32_syscfg_regs
{
u32
memrmp
;
/* Memory remap */
u32
pmc
;
/* Peripheral mode configuration */
u32
exticr
[
4
];
/* External interrupt configuration */
u32
rsv0
[
2
];
u32
cmpcr
;
/* Compensation cell control */
};
#define STM32_SYSCFG ((volatile struct stm32_syscfg_regs *) \
STM32_SYSCFG_BASE)
#define SYSCFG_MEMRMP_SWP_FMC_0 (1U << 10U);
/******************************************************************************
* FIXME: get rid of this
...
...
include/configs/stm32f769i-discovery.h
View file @
dc4dd6d1
...
...
@@ -311,6 +311,9 @@
/* Enable DHCP */
#define CONFIG_CMD_DHCP
/* Directly jump with "go" */
#define CONFIG_CMD_GO_DIRECT_JUMP
/*
* To save memory disable long help
*/
...
...
@@ -326,7 +329,12 @@
*/
#define CONFIG_BOOTDELAY 1
#define CONFIG_ZERO_BOOTDELAY_CHECK
#ifdef CONFIG_CMD_GO_DIRECT_JUMP
#define CONFIG_BOOTCOMMAND "go " stringify(STM32_QSPI_BANK)
#else
#define CONFIG_BOOTCOMMAND "run qspiboot || echo 'Boot from QSPI failed, run the update command'"
#endif
/* boot args and env */
#define CONFIG_HOSTNAME stm32f769i-disco
...
...
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