mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-28 09:39:00 +00:00
a296055b82
Similar to the lzma-loader on our MIPS targets, the spi-loader acts as a second-stage loader that will then load and start the actual kernel. As the TL-WDR4900 uses SPI-NOR and the P1010 family does not have support for memory mapping of this type of flash, this loader needs to contain a basic driver for the FSL ESPI controller. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
37 lines
684 B
ArmAsm
37 lines
684 B
ArmAsm
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright (C) 2022 Matthias Schiffer <mschiffer@universe-factory.net>
|
|
*
|
|
* Based on Linux arch/powerpc/boot/crt0.S, which is:
|
|
*
|
|
* Copyright (C) Paul Mackerras 1997.
|
|
*/
|
|
|
|
#include <ppc_asm.h>
|
|
|
|
.text
|
|
.global _start
|
|
_start:
|
|
/* Do a cache flush for our text, in case the loader didn't */
|
|
lis r3,_text_start@ha
|
|
addi r3,r3,_text_start@l
|
|
li r4,_text_len
|
|
bl flush_cache
|
|
|
|
/* Clear the BSS */
|
|
lis r3,_bss_start@ha
|
|
addi r3,r3,_bss_start@l
|
|
li r4,0
|
|
li r5,_bss_len
|
|
bl memset
|
|
|
|
/* Set up stack */
|
|
lis r1,_stack_top@ha
|
|
addi r1,r1,_stack_top@l
|
|
/* Establish a stack frame */
|
|
li r0,0
|
|
stwu r0,-16(r1)
|
|
|
|
/* Call start */
|
|
b start
|