| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $Id: rmixl_fmnvar.h,v 1.1.2.6 2012/01/04 16:17:53 matt Exp $ */ | | 1 | /* $Id: rmixl_fmnvar.h,v 1.1.2.7 2012/01/19 09:59:08 matt Exp $ */ |
2 | /*- | | 2 | /*- |
3 | * Copyright (c) 2010 The NetBSD Foundation, Inc. | | 3 | * Copyright (c) 2010 The NetBSD Foundation, Inc. |
4 | * All rights reserved. | | 4 | * All rights reserved. |
5 | * | | 5 | * |
6 | * This code is derived from software contributed to The NetBSD Foundation | | 6 | * This code is derived from software contributed to The NetBSD Foundation |
7 | * by Cliff Neighbors. | | 7 | * by Cliff Neighbors. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -21,26 +21,27 @@ | | | @@ -21,26 +21,27 @@ |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
28 | * POSSIBILITY OF SUCH DAMAGE. | | 28 | * POSSIBILITY OF SUCH DAMAGE. |
29 | */ | | 29 | */ |
30 | | | 30 | |
31 | #ifndef _ARCH_MIPS_RMIXL_RMIXL_FMNVAR_H_ | | 31 | #ifndef _ARCH_MIPS_RMIXL_RMIXL_FMNVAR_H_ |
32 | #define _ARCH_MIPS_RMIXL_RMIXL_FMNVAR_H_ | | 32 | #define _ARCH_MIPS_RMIXL_RMIXL_FMNVAR_H_ |
33 | | | 33 | |
| | | 34 | #include <sys/cpu.h> |
34 | #include <mips/cpuregs.h> | | 35 | #include <mips/cpuregs.h> |
35 | | | 36 | |
36 | #define RMIXL_FMN_CODE_PSB_WAKEUP 200 /* firmware MSGRNG_CODE_BOOT_WAKEUP */ | | 37 | #define RMIXL_FMN_CODE_PSB_WAKEUP 200 /* firmware MSGRNG_CODE_BOOT_WAKEUP */ |
37 | #define RMIXL_FMN_CODE_HELLO_REQ 201 | | 38 | #define RMIXL_FMN_CODE_HELLO_REQ 201 |
38 | #define RMIXL_FMN_CODE_HELLO_ACK 202 | | 39 | #define RMIXL_FMN_CODE_HELLO_ACK 202 |
39 | | | 40 | |
40 | #define RMIXL_FMN_HELLO_REQ_SZ 4 | | 41 | #define RMIXL_FMN_HELLO_REQ_SZ 4 |
41 | #define RMIXL_FMN_HELLO_ACK_SZ 4 | | 42 | #define RMIXL_FMN_HELLO_ACK_SZ 4 |
42 | | | 43 | |
43 | typedef struct rmixl_fmn_msg { | | 44 | typedef struct rmixl_fmn_msg { |
44 | uint64_t data[4]; | | 45 | uint64_t data[4]; |
45 | } rmixl_fmn_msg_t; | | 46 | } rmixl_fmn_msg_t; |
46 | | | 47 | |
| @@ -336,25 +337,31 @@ rmixl_cp2_restore(uint32_t ocu) | | | @@ -336,25 +337,31 @@ rmixl_cp2_restore(uint32_t ocu) |
336 | #define RMIXLS_FMN_STID_CDE 8 | | 337 | #define RMIXLS_FMN_STID_CDE 8 |
337 | #define RMIXLS_FMN_STID_PCIE 9 | | 338 | #define RMIXLS_FMN_STID_PCIE 9 |
338 | #define RMIXLS_FMN_STID_SAE 10 | | 339 | #define RMIXLS_FMN_STID_SAE 10 |
339 | #define RMIXLS_FMN_NSTID (RMIXLS_FMN_STID_SAE+1) | | 340 | #define RMIXLS_FMN_NSTID (RMIXLS_FMN_STID_SAE+1) |
340 | #else | | 341 | #else |
341 | #define RMIXLS_FMN_NSTID 0 | | 342 | #define RMIXLS_FMN_NSTID 0 |
342 | #endif | | 343 | #endif |
343 | | | 344 | |
344 | #define RMIXL_FMN_NSTID \ | | 345 | #define RMIXL_FMN_NSTID \ |
345 | MAX(MAX(RMIXLR_FMN_NSTID, RMIXLS_FMN_NSTID), RMIXLP_FMN_NSTID) | | 346 | MAX(MAX(RMIXLR_FMN_NSTID, RMIXLS_FMN_NSTID), RMIXLP_FMN_NSTID) |
346 | | | 347 | |
347 | typedef int (*rmixl_fmn_intr_handler_t)(void *, rmixl_fmn_rxmsg_t *); | | 348 | typedef int (*rmixl_fmn_intr_handler_t)(void *, rmixl_fmn_rxmsg_t *); |
348 | | | 349 | |
| | | 350 | void rmixl_fmn_cpu_attach(struct cpu_info *ci); |
349 | void rmixl_fmn_init(void); | | 351 | void rmixl_fmn_init(void); |
350 | void rmixl_fmn_init_thread(void); | | 352 | void rmixl_fmn_init_thread(void); |
351 | void * rmixl_fmn_intr_establish(size_t, rmixl_fmn_intr_handler_t, void *); | | 353 | void * rmixl_fmn_intr_establish(size_t, rmixl_fmn_intr_handler_t, void *); |
352 | void rmixl_fmn_intr_disestablish(void *); | | 354 | void rmixl_fmn_intr_disestablish(void *); |
353 | void rmixl_fmn_intr_poll(u_int, rmixl_fmn_rxmsg_t *); | | 355 | void rmixl_fmn_intr_poll(u_int, rmixl_fmn_rxmsg_t *); |
| | | 356 | |
| | | 357 | size_t rmixl_fmn_qid_to_stid(size_t); |
| | | 358 | const char * |
| | | 359 | rmixl_fmn_stid_name(size_t); |
| | | 360 | |
354 | /* | | 361 | /* |
355 | * true == succes, false = failure | | 362 | * true == succes, false = failure |
356 | */ | | 363 | */ |
357 | bool rmixl_fmn_msg_send(u_int, u_int, u_int, u_int, const rmixl_fmn_msg_t *); | | 364 | bool rmixl_fmn_msg_send(u_int, u_int, u_int, u_int, const rmixl_fmn_msg_t *); |
358 | bool rmixl_fmn_msg_recv(u_int, rmixl_fmn_rxmsg_t *); | | 365 | bool rmixl_fmn_msg_recv(u_int, rmixl_fmn_rxmsg_t *); |
359 | | | 366 | |
360 | #endif /* _ARCH_MIPS_RMIXL_RMIXL_FMNVAR_H_ */ | | 367 | #endif /* _ARCH_MIPS_RMIXL_RMIXL_FMNVAR_H_ */ |