18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * linux/arch/arm/lib/ecard.S 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 1995, 1996 Russell King 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * 27/03/03 Ian Molton Clean up CONFIG_CPU 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci#include <linux/linkage.h> 108c2ecf20Sopenharmony_ci#include <asm/assembler.h> 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#define CPSR2SPSR(rt) \ 138c2ecf20Sopenharmony_ci mrs rt, cpsr; \ 148c2ecf20Sopenharmony_ci msr spsr_cxsf, rt 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci@ Purpose: call an expansion card loader to read bytes. 178c2ecf20Sopenharmony_ci@ Proto : char read_loader(int offset, char *card_base, char *loader); 188c2ecf20Sopenharmony_ci@ Returns: byte read 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ciENTRY(ecard_loader_read) 218c2ecf20Sopenharmony_ci stmfd sp!, {r4 - r12, lr} 228c2ecf20Sopenharmony_ci mov r11, r1 238c2ecf20Sopenharmony_ci mov r1, r0 248c2ecf20Sopenharmony_ci CPSR2SPSR(r0) 258c2ecf20Sopenharmony_ci mov lr, pc 268c2ecf20Sopenharmony_ci mov pc, r2 278c2ecf20Sopenharmony_ci ldmfd sp!, {r4 - r12, pc} 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci@ Purpose: call an expansion card loader to reset the card 308c2ecf20Sopenharmony_ci@ Proto : void read_loader(int card_base, char *loader); 318c2ecf20Sopenharmony_ci@ Returns: byte read 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ciENTRY(ecard_loader_reset) 348c2ecf20Sopenharmony_ci stmfd sp!, {r4 - r12, lr} 358c2ecf20Sopenharmony_ci mov r11, r0 368c2ecf20Sopenharmony_ci CPSR2SPSR(r0) 378c2ecf20Sopenharmony_ci mov lr, pc 388c2ecf20Sopenharmony_ci add pc, r1, #8 398c2ecf20Sopenharmony_ci ldmfd sp!, {r4 - r12, pc} 408c2ecf20Sopenharmony_ci 41