44#include <asm/epapr_hcalls.h>
46#define FH_API_VERSION 1
48#define FH_ERR_GET_INFO 1
49#define FH_PARTITION_GET_DTPROP 2
50#define FH_PARTITION_SET_DTPROP 3
51#define FH_PARTITION_RESTART 4
52#define FH_PARTITION_GET_STATUS 5
53#define FH_PARTITION_START 6
54#define FH_PARTITION_STOP 7
55#define FH_PARTITION_MEMCPY 8
56#define FH_DMA_ENABLE 9
57#define FH_DMA_DISABLE 10
59#define FH_VMPIC_GET_MSIR 12
60#define FH_SYSTEM_RESET 13
61#define FH_GET_CORE_STATE 14
62#define FH_ENTER_NAP 15
64#define FH_CLAIM_DEVICE 17
65#define FH_PARTITION_STOP_DMA 18
68#define FH_HCALL_TOKEN(num) _EV_HCALL_TOKEN(EV_FSL_VENDOR_ID, num)
89static inline unsigned int fh_send_nmi(
unsigned int vcpu_mask)
91 register uintptr_t r11 __asm__(
"r11");
92 register uintptr_t r3 __asm__(
"r3");
94 r11 = FH_HCALL_TOKEN(FH_SEND_NMI);
97 asm volatile(
"bl epapr_hypercall_start"
98 :
"+r" (r11),
"+r" (r3)
99 : : EV_HCALL_CLOBBERS1
106#define FH_DTPROP_MAX_PATHLEN 4096
107#define FH_DTPROP_MAX_PROPLEN 32768
119static inline unsigned int fh_partition_get_dtprop(
int handle,
120 uint64_t dtpath_addr,
121 uint64_t propname_addr,
122 uint64_t propvalue_addr,
123 uint32_t *propvalue_len)
125 register uintptr_t r11 __asm__(
"r11");
126 register uintptr_t r3 __asm__(
"r3");
127 register uintptr_t r4 __asm__(
"r4");
128 register uintptr_t r5 __asm__(
"r5");
129 register uintptr_t r6 __asm__(
"r6");
130 register uintptr_t r7 __asm__(
"r7");
131 register uintptr_t r8 __asm__(
"r8");
132 register uintptr_t r9 __asm__(
"r9");
133 register uintptr_t r10 __asm__(
"r10");
135 r11 = FH_HCALL_TOKEN(FH_PARTITION_GET_DTPROP);
138#ifdef CONFIG_PHYS_64BIT
139 r4 = dtpath_addr >> 32;
140 r6 = propname_addr >> 32;
141 r8 = propvalue_addr >> 32;
147 r5 = (uint32_t)dtpath_addr;
148 r7 = (uint32_t)propname_addr;
149 r9 = (uint32_t)propvalue_addr;
150 r10 = *propvalue_len;
152 asm volatile(
"bl epapr_hypercall_start"
154 "+r" (r3),
"+r" (r4),
"+r" (r5),
"+r" (r6),
"+r" (r7),
155 "+r" (r8),
"+r" (r9),
"+r" (r10)
156 : : EV_HCALL_CLOBBERS8
173static inline unsigned int fh_partition_set_dtprop(
int handle,
174 uint64_t dtpath_addr,
175 uint64_t propname_addr,
176 uint64_t propvalue_addr,
177 uint32_t propvalue_len)
179 register uintptr_t r11 __asm__(
"r11");
180 register uintptr_t r3 __asm__(
"r3");
181 register uintptr_t r4 __asm__(
"r4");
182 register uintptr_t r6 __asm__(
"r6");
183 register uintptr_t r8 __asm__(
"r8");
184 register uintptr_t r5 __asm__(
"r5");
185 register uintptr_t r7 __asm__(
"r7");
186 register uintptr_t r9 __asm__(
"r9");
187 register uintptr_t r10 __asm__(
"r10");
189 r11 = FH_HCALL_TOKEN(FH_PARTITION_SET_DTPROP);
192#ifdef CONFIG_PHYS_64BIT
193 r4 = dtpath_addr >> 32;
194 r6 = propname_addr >> 32;
195 r8 = propvalue_addr >> 32;
201 r5 = (uint32_t)dtpath_addr;
202 r7 = (uint32_t)propname_addr;
203 r9 = (uint32_t)propvalue_addr;
206 asm volatile(
"bl epapr_hypercall_start"
208 "+r" (r3),
"+r" (r4),
"+r" (r5),
"+r" (r6),
"+r" (r7),
209 "+r" (r8),
"+r" (r9),
"+r" (r10)
210 : : EV_HCALL_CLOBBERS8
222static inline unsigned int fh_partition_restart(
unsigned int partition)
224 register uintptr_t r11 __asm__(
"r11");
225 register uintptr_t r3 __asm__(
"r3");
227 r11 = FH_HCALL_TOKEN(FH_PARTITION_RESTART);
230 asm volatile(
"bl epapr_hypercall_start"
231 :
"+r" (r11),
"+r" (r3)
232 : : EV_HCALL_CLOBBERS1
238#define FH_PARTITION_STOPPED 0
239#define FH_PARTITION_RUNNING 1
240#define FH_PARTITION_STARTING 2
241#define FH_PARTITION_STOPPING 3
242#define FH_PARTITION_PAUSING 4
243#define FH_PARTITION_PAUSED 5
244#define FH_PARTITION_RESUMING 6
253static inline unsigned int fh_partition_get_status(
unsigned int partition,
254 unsigned int *status)
256 register uintptr_t r11 __asm__(
"r11");
257 register uintptr_t r3 __asm__(
"r3");
258 register uintptr_t r4 __asm__(
"r4");
260 r11 = FH_HCALL_TOKEN(FH_PARTITION_GET_STATUS);
263 asm volatile(
"bl epapr_hypercall_start"
264 :
"+r" (r11),
"+r" (r3),
"=r" (r4)
265 : : EV_HCALL_CLOBBERS2
283static inline unsigned int fh_partition_start(
unsigned int partition,
284 uint32_t entry_point,
int load)
286 register uintptr_t r11 __asm__(
"r11");
287 register uintptr_t r3 __asm__(
"r3");
288 register uintptr_t r4 __asm__(
"r4");
289 register uintptr_t r5 __asm__(
"r5");
291 r11 = FH_HCALL_TOKEN(FH_PARTITION_START);
296 asm volatile(
"bl epapr_hypercall_start"
297 :
"+r" (r11),
"+r" (r3),
"+r" (r4),
"+r" (r5)
298 : : EV_HCALL_CLOBBERS3
310static inline unsigned int fh_partition_stop(
unsigned int partition)
312 register uintptr_t r11 __asm__(
"r11");
313 register uintptr_t r3 __asm__(
"r3");
315 r11 = FH_HCALL_TOKEN(FH_PARTITION_STOP);
318 asm volatile(
"bl epapr_hypercall_start"
319 :
"+r" (r11),
"+r" (r3)
320 : : EV_HCALL_CLOBBERS1
355static inline unsigned int fh_partition_memcpy(
unsigned int source,
356 unsigned int target, uint64_t sg_list,
unsigned int count)
358 register uintptr_t r11 __asm__(
"r11");
359 register uintptr_t r3 __asm__(
"r3");
360 register uintptr_t r4 __asm__(
"r4");
361 register uintptr_t r5 __asm__(
"r5");
362 register uintptr_t r6 __asm__(
"r6");
363 register uintptr_t r7 __asm__(
"r7");
365 r11 = FH_HCALL_TOKEN(FH_PARTITION_MEMCPY);
368 r5 = (uint32_t) sg_list;
370#ifdef CONFIG_PHYS_64BIT
377 asm volatile(
"bl epapr_hypercall_start"
379 "+r" (r3),
"+r" (r4),
"+r" (r5),
"+r" (r6),
"+r" (r7)
380 : : EV_HCALL_CLOBBERS5
392static inline unsigned int fh_dma_enable(
unsigned int liodn)
394 register uintptr_t r11 __asm__(
"r11");
395 register uintptr_t r3 __asm__(
"r3");
397 r11 = FH_HCALL_TOKEN(FH_DMA_ENABLE);
400 asm volatile(
"bl epapr_hypercall_start"
401 :
"+r" (r11),
"+r" (r3)
402 : : EV_HCALL_CLOBBERS1
414static inline unsigned int fh_dma_disable(
unsigned int liodn)
416 register uintptr_t r11 __asm__(
"r11");
417 register uintptr_t r3 __asm__(
"r3");
419 r11 = FH_HCALL_TOKEN(FH_DMA_DISABLE);
422 asm volatile(
"bl epapr_hypercall_start"
423 :
"+r" (r11),
"+r" (r3)
424 : : EV_HCALL_CLOBBERS1
438static inline unsigned int fh_vmpic_get_msir(
unsigned int interrupt,
439 unsigned int *msir_val)
441 register uintptr_t r11 __asm__(
"r11");
442 register uintptr_t r3 __asm__(
"r3");
443 register uintptr_t r4 __asm__(
"r4");
445 r11 = FH_HCALL_TOKEN(FH_VMPIC_GET_MSIR);
448 asm volatile(
"bl epapr_hypercall_start"
449 :
"+r" (r11),
"+r" (r3),
"=r" (r4)
450 : : EV_HCALL_CLOBBERS2
463static inline unsigned int fh_system_reset(
void)
465 register uintptr_t r11 __asm__(
"r11");
466 register uintptr_t r3 __asm__(
"r3");
468 r11 = FH_HCALL_TOKEN(FH_SYSTEM_RESET);
470 asm volatile(
"bl epapr_hypercall_start"
471 :
"+r" (r11),
"=r" (r3)
472 : : EV_HCALL_CLOBBERS1
490static inline unsigned int fh_err_get_info(
int queue, uint32_t *bufsize,
491 uint32_t addr_hi, uint32_t addr_lo,
int peek)
493 register uintptr_t r11 __asm__(
"r11");
494 register uintptr_t r3 __asm__(
"r3");
495 register uintptr_t r4 __asm__(
"r4");
496 register uintptr_t r5 __asm__(
"r5");
497 register uintptr_t r6 __asm__(
"r6");
498 register uintptr_t r7 __asm__(
"r7");
500 r11 = FH_HCALL_TOKEN(FH_ERR_GET_INFO);
507 asm volatile(
"bl epapr_hypercall_start"
508 :
"+r" (r11),
"+r" (r3),
"+r" (r4),
"+r" (r5),
"+r" (r6),
510 : : EV_HCALL_CLOBBERS5
520#define FH_VCPU_IDLE 1
532static inline unsigned int fh_get_core_state(
unsigned int handle,
533 unsigned int vcpu,
unsigned int *state)
535 register uintptr_t r11 __asm__(
"r11");
536 register uintptr_t r3 __asm__(
"r3");
537 register uintptr_t r4 __asm__(
"r4");
539 r11 = FH_HCALL_TOKEN(FH_GET_CORE_STATE);
543 asm volatile(
"bl epapr_hypercall_start"
544 :
"+r" (r11),
"+r" (r3),
"+r" (r4)
545 : : EV_HCALL_CLOBBERS2
563static inline unsigned int fh_enter_nap(
unsigned int handle,
unsigned int vcpu)
565 register uintptr_t r11 __asm__(
"r11");
566 register uintptr_t r3 __asm__(
"r3");
567 register uintptr_t r4 __asm__(
"r4");
569 r11 = FH_HCALL_TOKEN(FH_ENTER_NAP);
573 asm volatile(
"bl epapr_hypercall_start"
574 :
"+r" (r11),
"+r" (r3),
"+r" (r4)
575 : : EV_HCALL_CLOBBERS2
588static inline unsigned int fh_exit_nap(
unsigned int handle,
unsigned int vcpu)
590 register uintptr_t r11 __asm__(
"r11");
591 register uintptr_t r3 __asm__(
"r3");
592 register uintptr_t r4 __asm__(
"r4");
594 r11 = FH_HCALL_TOKEN(FH_EXIT_NAP);
598 asm volatile(
"bl epapr_hypercall_start"
599 :
"+r" (r11),
"+r" (r3),
"+r" (r4)
600 : : EV_HCALL_CLOBBERS2
611static inline unsigned int fh_claim_device(
unsigned int handle)
613 register uintptr_t r11 __asm__(
"r11");
614 register uintptr_t r3 __asm__(
"r3");
616 r11 = FH_HCALL_TOKEN(FH_CLAIM_DEVICE);
619 asm volatile(
"bl epapr_hypercall_start"
620 :
"+r" (r11),
"+r" (r3)
621 : : EV_HCALL_CLOBBERS1
638static inline unsigned int fh_partition_stop_dma(
unsigned int handle)
640 register uintptr_t r11 __asm__(
"r11");
641 register uintptr_t r3 __asm__(
"r3");
643 r11 = FH_HCALL_TOKEN(FH_PARTITION_STOP_DMA);
646 asm volatile(
"bl epapr_hypercall_start"
647 :
"+r" (r11),
"+r" (r3)
648 : : EV_HCALL_CLOBBERS1
Definition: xnandpsu_onfi.h:185
Definition: fsl_hcalls.h:339
uint64_t source
Definition: fsl_hcalls.h:340
uint64_t size
Definition: fsl_hcalls.h:342
uint64_t reserved
Definition: fsl_hcalls.h:343
uint64_t target
Definition: fsl_hcalls.h:341