2 * dwc_otg_fiq_fsm.S - assembly stub for the FSM FIQ
4 * Copyright (c) 2013 Raspberry Pi Foundation
6 * Author: Jonathan Bell <jonathan@raspberrypi.org>
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * * Neither the name of Raspberry Pi nor the
17 * names of its contributors may be used to endorse or promote products
18 * derived from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
24 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #include <asm/assembler.h>
34 #include <linux/linkage.h>
39 .global _dwc_otg_fiq_stub_end;
42 * _dwc_otg_fiq_stub() - entry copied to the FIQ vector page to allow
43 * a C-style function call with arguments from the FIQ banked registers.
44 * r0 = &hcd->fiq_state
45 * r1 = &hcd->num_channels
46 * r2 = &hcd->dma_buffers
47 * Tramples: r0, r1, r2, r4, fp, ip
50 ENTRY(_dwc_otg_fiq_stub)
51 /* Stash unbanked regs - SP will have been set up for us */
53 stmdb sp!, {r0-r12, lr};
55 // Cycle profiling - read cycle counter at start
56 mrc p15, 0, r5, c15, c12, 1;
58 /* r11 = fp, don't trample it */
60 /* set EABI frame size */
63 /* for fiq NOP mode - just need state */
65 /* r9 = num_channels */
67 /* r10 = struct *dma_bufs */
70 /* r4 = &fiq_c_function */
73 mrc p15, 0, r4, c15, c12, 1;
75 // r5 is now the cycle count time for executing the FIQ. Store it somewhere?
77 ldmia sp!, {r0-r12, lr};
79 _dwc_otg_fiq_stub_end:
80 END(_dwc_otg_fiq_stub)