^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *  linux/arch/arm/kernel/head-common.S
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  Copyright (C) 1994-2002 Russell King
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *  Copyright (c) 2003 ARM Limited
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *  All Rights Reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <asm/assembler.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #define ATAG_CORE 0x54410001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #define ATAG_CORE_SIZE ((2*4 + 3*4) >> 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #define ATAG_CORE_SIZE_EMPTY ((2*4) >> 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #ifdef CONFIG_CPU_BIG_ENDIAN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #define OF_DT_MAGIC 0xd00dfeed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #define OF_DT_MAGIC 0xedfe0dd0 /* 0xd00dfeed in big-endian */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  * Exception handling.  Something went wrong and we can't proceed.  We
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  * ought to tell the user, but since we don't have any guarantee that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  * we're even running on the right architecture, we do virtually nothing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * If CONFIG_DEBUG_LL is set we try to print out something about the error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  * and hope for the best (useful if bootloader fails to pass a proper
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  * machine ID for example).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	__HEAD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) /* Determine validity of the r2 atags pointer.  The heuristic requires
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  * that the pointer be aligned, in the first 16k of physical RAM and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  * that the ATAG_CORE marker is first and present.  If CONFIG_OF_FLATTREE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  * is selected, then it will also accept a dtb pointer.  Future revisions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)  * of this function may be more lenient with the physical address and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)  * may also be able to move the ATAGS block if necessary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)  * Returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)  *  r2 either valid atags pointer, valid dtb pointer, or zero
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  *  r5, r6 corrupted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) __vet_atags:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	tst	r2, #0x3			@ aligned?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	bne	1f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	ldr	r5, [r2, #0]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #ifdef CONFIG_OF_FLATTREE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	ldr	r6, =OF_DT_MAGIC		@ is it a DTB?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	cmp	r5, r6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	beq	2f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	cmp	r5, #ATAG_CORE_SIZE		@ is first tag ATAG_CORE?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	cmpne	r5, #ATAG_CORE_SIZE_EMPTY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	bne	1f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	ldr	r5, [r2, #4]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	ldr	r6, =ATAG_CORE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	cmp	r5, r6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	bne	1f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 2:	ret	lr				@ atag/dtb pointer is ok
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 1:	mov	r2, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	ret	lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) ENDPROC(__vet_atags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)  * The following fragment of code is executed with the MMU on in MMU mode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)  * and uses absolute addresses; this is not position independent.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71)  *  r0  = cp#15 control register (exc_ret for M-class)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72)  *  r1  = machine ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)  *  r2  = atags/dtb pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74)  *  r9  = processor ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	__INIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) __mmap_switched:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	mov	r7, r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	mov	r8, r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	mov	r10, r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	adr	r4, __mmap_switched_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	mov	fp, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) #if defined(CONFIG_XIP_DEFLATED_DATA)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)    ARM(	ldr	sp, [r4], #4 )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)  THUMB(	ldr	sp, [r4] )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)  THUMB(	add	r4, #4 )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	bl	__inflate_kernel_data		@ decompress .data to RAM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	teq	r0, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	bne	__error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) #elif defined(CONFIG_XIP_KERNEL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)    ARM(	ldmia	r4!, {r0, r1, r2, sp} )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)  THUMB(	ldmia	r4!, {r0, r1, r2, r3} )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)  THUMB(	mov	sp, r3 )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	sub	r2, r2, r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	bl	memcpy				@ copy .data to RAM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)    ARM(	ldmia	r4!, {r0, r1, sp} )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)  THUMB(	ldmia	r4!, {r0, r1, r3} )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)  THUMB(	mov	sp, r3 )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	sub	r2, r1, r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	mov	r1, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	bl	memset				@ clear .bss
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	ldmia	r4, {r0, r1, r2, r3}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	str	r9, [r0]			@ Save processor ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	str	r7, [r1]			@ Save machine type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	str	r8, [r2]			@ Save atags pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	cmp	r3, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	strne	r10, [r3]			@ Save control register values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	mov	lr, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	b	start_kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) ENDPROC(__mmap_switched)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	.align	2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	.type	__mmap_switched_data, %object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) __mmap_switched_data:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) #ifdef CONFIG_XIP_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) #ifndef CONFIG_XIP_DEFLATED_DATA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	.long	_sdata				@ r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	.long	__data_loc			@ r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	.long	_edata_loc			@ r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	.long	__bss_stop			@ sp (temporary stack in .bss)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	.long	__bss_start			@ r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	.long	__bss_stop			@ r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	.long	init_thread_union + THREAD_START_SP @ sp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	.long	processor_id			@ r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	.long	__machine_arch_type		@ r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	.long	__atags_pointer			@ r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) #ifdef CONFIG_CPU_CP15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	.long	cr_alignment			@ r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) M_CLASS(.long	exc_ret)			@ r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) AR_CLASS(.long	0)				@ r3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	.size	__mmap_switched_data, . - __mmap_switched_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	__FINIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	.text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)  * This provides a C-API version of __lookup_processor_type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) ENTRY(lookup_processor_type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	stmfd	sp!, {r4 - r6, r9, lr}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	mov	r9, r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	bl	__lookup_processor_type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	mov	r0, r5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	ldmfd	sp!, {r4 - r6, r9, pc}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) ENDPROC(lookup_processor_type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)  * Read processor ID register (CP#15, CR0), and look up in the linker-built
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)  * supported processor list.  Note that we can't use the absolute addresses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)  * for the __proc_info lists since we aren't running with the MMU on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)  * (and therefore, we are not in the correct address space).  We have to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)  * calculate the offset.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)  *	r9 = cpuid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)  * Returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)  *	r3, r4, r6 corrupted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)  *	r5 = proc_info pointer in physical address space
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)  *	r9 = cpuid (preserved)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) __lookup_processor_type:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	adr	r3, __lookup_processor_type_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	ldmia	r3, {r4 - r6}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	sub	r3, r3, r4			@ get offset between virt&phys
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	add	r5, r5, r3			@ convert virt addresses to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	add	r6, r6, r3			@ physical address space
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 1:	ldmia	r5, {r3, r4}			@ value, mask
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	and	r4, r4, r9			@ mask wanted bits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	teq	r3, r4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	beq	2f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	add	r5, r5, #PROC_INFO_SZ		@ sizeof(proc_info_list)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	cmp	r5, r6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	blo	1b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	mov	r5, #0				@ unknown processor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 2:	ret	lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) ENDPROC(__lookup_processor_type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)  * Look in <asm/procinfo.h> for information about the __proc_info structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	.align	2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	.type	__lookup_processor_type_data, %object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) __lookup_processor_type_data:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	.long	.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	.long	__proc_info_begin
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	.long	__proc_info_end
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	.size	__lookup_processor_type_data, . - __lookup_processor_type_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) __error_lpae:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) #ifdef CONFIG_DEBUG_LL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	adr	r0, str_lpae
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	bl 	printascii
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	b	__error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) str_lpae: .asciz "\nError: Kernel with LPAE support, but CPU does not support LPAE.\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	b	__error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	.align
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) ENDPROC(__error_lpae)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) __error_p:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) #ifdef CONFIG_DEBUG_LL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	adr	r0, str_p1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	bl	printascii
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	mov	r0, r9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	bl	printhex8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	adr	r0, str_p2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	bl	printascii
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	b	__error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) str_p1:	.asciz	"\nError: unrecognized/unsupported processor variant (0x"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) str_p2:	.asciz	").\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	.align
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) ENDPROC(__error_p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) __error:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) #ifdef CONFIG_ARCH_RPC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)  * Turn the screen red on a error - RiscPC only.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	mov	r0, #0x02000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	mov	r3, #0x11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	orr	r3, r3, r3, lsl #8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	orr	r3, r3, r3, lsl #16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	str	r3, [r0], #4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	str	r3, [r0], #4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	str	r3, [r0], #4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	str	r3, [r0], #4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 1:	mov	r0, r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	b	1b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) ENDPROC(__error)