Skip to content

Commit 2ae347e

Browse files
committed
Progress with trying to solve the startup assembly issue on cold power on.
1 parent 8521f6b commit 2ae347e

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

hal/nxp_ppc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188

189189
/* Early C UART checkpoint helper — uses UART0 already initialized by ASM.
190190
* Safe to call as soon as TLB for CCSR is live (i.e. anywhere in C boot). */
191+
#ifndef __ASSEMBLER__
191192
#if defined(DEBUG_UART) && defined(TARGET_nxp_t2080)
192193
static inline void uart_putc_early(char c)
193194
{
@@ -199,6 +200,7 @@ static inline void uart_putc_early(char c)
199200
#else
200201
static inline void uart_putc_early(char c) { (void)c; }
201202
#endif
203+
#endif /* !__ASSEMBLER__ */
202204

203205
/* DDR */
204206
#ifndef DDR_ADDRESS

src/boot_ppc_start.S

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -956,10 +956,11 @@ setup_stack:
956956
#endif
957957

958958
#ifdef USE_LONG_JUMP
959-
/* load absolute address into "LR" and branch return to it */
960-
/* Enables long jump in 32-bit */
961-
lis r3, boot_entry_C@h
962-
ori r3, r3, boot_entry_C@l
959+
/* Load boot_entry_C into LR for indirect branch.
960+
* Use LOAD_ADDR32, not lis, because e6500 has 64-bit GPRs and lis
961+
* sign-extends for addresses >= 0x80000000 (e.g. 0xEFFExxxx becomes
962+
* 0xFFFFFFFF_EFFExxxx), causing an instruction TLB miss on blr. */
963+
LOAD_ADDR32(r3, boot_entry_C)
963964
mtlr r3
964965
blr
965966
#else

0 commit comments

Comments
 (0)