• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 Freescale Semiconductor, Inc.
3  * Copyright 2017-2018 NXP
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 /*!
9  * File containing client-side RPC functions for the MISC service. These
10  * functions are ported to clients that communicate to the SC.
11  *
12  * @addtogroup MISC_SVC
13  * @{
14  */
15 
16 /* Includes */
17 
18 #include <sci/sci_types.h>
19 #include <sci/svc/rm/sci_rm_api.h>
20 #include <sci/svc/misc/sci_misc_api.h>
21 #include <sci/sci_rpc.h>
22 #include <stdlib.h>
23 #include "sci_misc_rpc.h"
24 
25 /* Local Defines */
26 
27 /* Local Types */
28 
29 /* Local Functions */
30 
sc_misc_set_control(sc_ipc_t ipc,sc_rsrc_t resource,sc_ctrl_t ctrl,uint32_t val)31 sc_err_t sc_misc_set_control(sc_ipc_t ipc, sc_rsrc_t resource,
32 			     sc_ctrl_t ctrl, uint32_t val)
33 {
34 	sc_rpc_msg_t msg;
35 	uint8_t result;
36 
37 	RPC_VER(&msg) = SC_RPC_VERSION;
38 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
39 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SET_CONTROL;
40 	RPC_U32(&msg, 0U) = (uint32_t)ctrl;
41 	RPC_U32(&msg, 4U) = (uint32_t)val;
42 	RPC_U16(&msg, 8U) = (uint16_t)resource;
43 	RPC_SIZE(&msg) = 4U;
44 
45 	sc_call_rpc(ipc, &msg, SC_FALSE);
46 
47 	result = RPC_R8(&msg);
48 	return (sc_err_t)result;
49 }
50 
sc_misc_get_control(sc_ipc_t ipc,sc_rsrc_t resource,sc_ctrl_t ctrl,uint32_t * val)51 sc_err_t sc_misc_get_control(sc_ipc_t ipc, sc_rsrc_t resource,
52 			     sc_ctrl_t ctrl, uint32_t *val)
53 {
54 	sc_rpc_msg_t msg;
55 	uint8_t result;
56 
57 	RPC_VER(&msg) = SC_RPC_VERSION;
58 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
59 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_GET_CONTROL;
60 	RPC_U32(&msg, 0U) = (uint32_t)ctrl;
61 	RPC_U16(&msg, 4U) = (uint16_t)resource;
62 	RPC_SIZE(&msg) = 3U;
63 
64 	sc_call_rpc(ipc, &msg, SC_FALSE);
65 
66 	if (val != NULL)
67 		*val = RPC_U32(&msg, 0U);
68 
69 	result = RPC_R8(&msg);
70 	return (sc_err_t)result;
71 }
72 
sc_misc_set_max_dma_group(sc_ipc_t ipc,sc_rm_pt_t pt,sc_misc_dma_group_t max)73 sc_err_t sc_misc_set_max_dma_group(sc_ipc_t ipc, sc_rm_pt_t pt,
74 				   sc_misc_dma_group_t max)
75 {
76 	sc_rpc_msg_t msg;
77 	uint8_t result;
78 
79 	RPC_VER(&msg) = SC_RPC_VERSION;
80 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
81 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SET_MAX_DMA_GROUP;
82 	RPC_U8(&msg, 0U) = (uint8_t)pt;
83 	RPC_U8(&msg, 1U) = (uint8_t)max;
84 	RPC_SIZE(&msg) = 2U;
85 
86 	sc_call_rpc(ipc, &msg, SC_FALSE);
87 
88 	result = RPC_R8(&msg);
89 	return (sc_err_t)result;
90 }
91 
sc_misc_set_dma_group(sc_ipc_t ipc,sc_rsrc_t resource,sc_misc_dma_group_t group)92 sc_err_t sc_misc_set_dma_group(sc_ipc_t ipc, sc_rsrc_t resource,
93 			       sc_misc_dma_group_t group)
94 {
95 	sc_rpc_msg_t msg;
96 	uint8_t result;
97 
98 	RPC_VER(&msg) = SC_RPC_VERSION;
99 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
100 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SET_DMA_GROUP;
101 	RPC_U16(&msg, 0U) = (uint16_t)resource;
102 	RPC_U8(&msg, 2U) = (uint8_t)group;
103 	RPC_SIZE(&msg) = 2U;
104 
105 	sc_call_rpc(ipc, &msg, SC_FALSE);
106 
107 	result = RPC_R8(&msg);
108 	return (sc_err_t)result;
109 }
110 
sc_misc_seco_image_load(sc_ipc_t ipc,sc_faddr_t addr_src,sc_faddr_t addr_dst,uint32_t len,sc_bool_t fw)111 sc_err_t sc_misc_seco_image_load(sc_ipc_t ipc, sc_faddr_t addr_src,
112 				 sc_faddr_t addr_dst, uint32_t len,
113 				 sc_bool_t fw)
114 {
115 	sc_rpc_msg_t msg;
116 	uint8_t result;
117 
118 	RPC_VER(&msg) = SC_RPC_VERSION;
119 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
120 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SECO_IMAGE_LOAD;
121 	RPC_U32(&msg, 0U) = (uint32_t)(addr_src >> 32U);
122 	RPC_U32(&msg, 4U) = (uint32_t)addr_src;
123 	RPC_U32(&msg, 8U) = (uint32_t)(addr_dst >> 32U);
124 	RPC_U32(&msg, 12U) = (uint32_t)addr_dst;
125 	RPC_U32(&msg, 16U) = (uint32_t)len;
126 	RPC_U8(&msg, 20U) = (uint8_t)fw;
127 	RPC_SIZE(&msg) = 7U;
128 
129 	sc_call_rpc(ipc, &msg, SC_FALSE);
130 
131 	result = RPC_R8(&msg);
132 	return (sc_err_t)result;
133 }
134 
sc_misc_seco_authenticate(sc_ipc_t ipc,sc_misc_seco_auth_cmd_t cmd,sc_faddr_t addr)135 sc_err_t sc_misc_seco_authenticate(sc_ipc_t ipc,
136 				   sc_misc_seco_auth_cmd_t cmd, sc_faddr_t addr)
137 {
138 	sc_rpc_msg_t msg;
139 	uint8_t result;
140 
141 	RPC_VER(&msg) = SC_RPC_VERSION;
142 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
143 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SECO_AUTHENTICATE;
144 	RPC_U32(&msg, 0U) = (uint32_t)(addr >> 32U);
145 	RPC_U32(&msg, 4U) = (uint32_t)addr;
146 	RPC_U8(&msg, 8U) = (uint8_t)cmd;
147 	RPC_SIZE(&msg) = 4U;
148 
149 	sc_call_rpc(ipc, &msg, SC_FALSE);
150 
151 	result = RPC_R8(&msg);
152 	return (sc_err_t)result;
153 }
154 
sc_misc_seco_fuse_write(sc_ipc_t ipc,sc_faddr_t addr)155 sc_err_t sc_misc_seco_fuse_write(sc_ipc_t ipc, sc_faddr_t addr)
156 {
157 	sc_rpc_msg_t msg;
158 	uint8_t result;
159 
160 	RPC_VER(&msg) = SC_RPC_VERSION;
161 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
162 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SECO_FUSE_WRITE;
163 	RPC_U32(&msg, 0U) = (uint32_t)(addr >> 32U);
164 	RPC_U32(&msg, 4U) = (uint32_t)addr;
165 	RPC_SIZE(&msg) = 3U;
166 
167 	sc_call_rpc(ipc, &msg, SC_FALSE);
168 
169 	result = RPC_R8(&msg);
170 	return (sc_err_t)result;
171 }
172 
sc_misc_seco_enable_debug(sc_ipc_t ipc,sc_faddr_t addr)173 sc_err_t sc_misc_seco_enable_debug(sc_ipc_t ipc, sc_faddr_t addr)
174 {
175 	sc_rpc_msg_t msg;
176 	uint8_t result;
177 
178 	RPC_VER(&msg) = SC_RPC_VERSION;
179 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
180 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SECO_ENABLE_DEBUG;
181 	RPC_U32(&msg, 0U) = (uint32_t)(addr >> 32U);
182 	RPC_U32(&msg, 4U) = (uint32_t)addr;
183 	RPC_SIZE(&msg) = 3U;
184 
185 	sc_call_rpc(ipc, &msg, SC_FALSE);
186 
187 	result = RPC_R8(&msg);
188 	return (sc_err_t)result;
189 }
190 
sc_misc_seco_forward_lifecycle(sc_ipc_t ipc,uint32_t lifecycle)191 sc_err_t sc_misc_seco_forward_lifecycle(sc_ipc_t ipc, uint32_t lifecycle)
192 {
193 	sc_rpc_msg_t msg;
194 	uint8_t result;
195 
196 	RPC_VER(&msg) = SC_RPC_VERSION;
197 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
198 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SECO_FORWARD_LIFECYCLE;
199 	RPC_U32(&msg, 0U) = (uint32_t)lifecycle;
200 	RPC_SIZE(&msg) = 2U;
201 
202 	sc_call_rpc(ipc, &msg, SC_FALSE);
203 
204 	result = RPC_R8(&msg);
205 	return (sc_err_t)result;
206 }
207 
sc_misc_seco_return_lifecycle(sc_ipc_t ipc,sc_faddr_t addr)208 sc_err_t sc_misc_seco_return_lifecycle(sc_ipc_t ipc, sc_faddr_t addr)
209 {
210 	sc_rpc_msg_t msg;
211 	uint8_t result;
212 
213 	RPC_VER(&msg) = SC_RPC_VERSION;
214 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
215 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SECO_RETURN_LIFECYCLE;
216 	RPC_U32(&msg, 0U) = (uint32_t)(addr >> 32U);
217 	RPC_U32(&msg, 4U) = (uint32_t)addr;
218 	RPC_SIZE(&msg) = 3U;
219 
220 	sc_call_rpc(ipc, &msg, SC_FALSE);
221 
222 	result = RPC_R8(&msg);
223 	return (sc_err_t)result;
224 }
225 
sc_misc_seco_build_info(sc_ipc_t ipc,uint32_t * version,uint32_t * commit)226 void sc_misc_seco_build_info(sc_ipc_t ipc, uint32_t *version, uint32_t *commit)
227 {
228 	sc_rpc_msg_t msg;
229 
230 	RPC_VER(&msg) = SC_RPC_VERSION;
231 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
232 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SECO_BUILD_INFO;
233 	RPC_SIZE(&msg) = 1U;
234 
235 	sc_call_rpc(ipc, &msg, SC_FALSE);
236 
237 	if (version != NULL)
238 		*version = RPC_U32(&msg, 0U);
239 
240 	if (commit != NULL)
241 		*commit = RPC_U32(&msg, 4U);
242 }
243 
sc_misc_seco_chip_info(sc_ipc_t ipc,uint16_t * lc,uint16_t * monotonic,uint32_t * uid_l,uint32_t * uid_h)244 sc_err_t sc_misc_seco_chip_info(sc_ipc_t ipc, uint16_t *lc,
245 				uint16_t *monotonic, uint32_t *uid_l,
246 				uint32_t *uid_h)
247 {
248 	sc_rpc_msg_t msg;
249 	uint8_t result;
250 
251 	RPC_VER(&msg) = SC_RPC_VERSION;
252 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
253 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SECO_CHIP_INFO;
254 	RPC_SIZE(&msg) = 1U;
255 
256 	sc_call_rpc(ipc, &msg, SC_FALSE);
257 
258 	if (uid_l != NULL)
259 		*uid_l = RPC_U32(&msg, 0U);
260 
261 	if (uid_h != NULL)
262 		*uid_h = RPC_U32(&msg, 4U);
263 
264 	if (lc != NULL)
265 		*lc = RPC_U16(&msg, 8U);
266 
267 	if (monotonic != NULL)
268 		*monotonic = RPC_U16(&msg, 10U);
269 
270 	result = RPC_R8(&msg);
271 	return (sc_err_t)result;
272 }
273 
sc_misc_debug_out(sc_ipc_t ipc,uint8_t ch)274 void sc_misc_debug_out(sc_ipc_t ipc, uint8_t ch)
275 {
276 	sc_rpc_msg_t msg;
277 
278 	RPC_VER(&msg) = SC_RPC_VERSION;
279 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
280 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_DEBUG_OUT;
281 	RPC_U8(&msg, 0U) = (uint8_t)ch;
282 	RPC_SIZE(&msg) = 2U;
283 
284 	sc_call_rpc(ipc, &msg, SC_FALSE);
285 }
286 
sc_misc_waveform_capture(sc_ipc_t ipc,sc_bool_t enable)287 sc_err_t sc_misc_waveform_capture(sc_ipc_t ipc, sc_bool_t enable)
288 {
289 	sc_rpc_msg_t msg;
290 	uint8_t result;
291 
292 	RPC_VER(&msg) = SC_RPC_VERSION;
293 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
294 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_WAVEFORM_CAPTURE;
295 	RPC_U8(&msg, 0U) = (uint8_t)enable;
296 	RPC_SIZE(&msg) = 2U;
297 
298 	sc_call_rpc(ipc, &msg, SC_FALSE);
299 
300 	result = RPC_R8(&msg);
301 	return (sc_err_t)result;
302 }
303 
sc_misc_build_info(sc_ipc_t ipc,uint32_t * build,uint32_t * commit)304 void sc_misc_build_info(sc_ipc_t ipc, uint32_t *build, uint32_t *commit)
305 {
306 	sc_rpc_msg_t msg;
307 
308 	RPC_VER(&msg) = SC_RPC_VERSION;
309 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
310 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_BUILD_INFO;
311 	RPC_SIZE(&msg) = 1U;
312 
313 	sc_call_rpc(ipc, &msg, SC_FALSE);
314 
315 	if (build != NULL)
316 		*build = RPC_U32(&msg, 0U);
317 
318 	if (commit != NULL)
319 		*commit = RPC_U32(&msg, 4U);
320 }
321 
sc_misc_unique_id(sc_ipc_t ipc,uint32_t * id_l,uint32_t * id_h)322 void sc_misc_unique_id(sc_ipc_t ipc, uint32_t *id_l, uint32_t *id_h)
323 {
324 	sc_rpc_msg_t msg;
325 
326 	RPC_VER(&msg) = SC_RPC_VERSION;
327 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
328 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_UNIQUE_ID;
329 	RPC_SIZE(&msg) = 1U;
330 
331 	sc_call_rpc(ipc, &msg, SC_FALSE);
332 
333 	if (id_l != NULL)
334 		*id_l = RPC_U32(&msg, 0U);
335 
336 	if (id_h != NULL)
337 		*id_h = RPC_U32(&msg, 4U);
338 }
339 
sc_misc_set_ari(sc_ipc_t ipc,sc_rsrc_t resource,sc_rsrc_t resource_mst,uint16_t ari,sc_bool_t enable)340 sc_err_t sc_misc_set_ari(sc_ipc_t ipc, sc_rsrc_t resource,
341 			 sc_rsrc_t resource_mst, uint16_t ari, sc_bool_t enable)
342 {
343 	sc_rpc_msg_t msg;
344 	uint8_t result;
345 
346 	RPC_VER(&msg) = SC_RPC_VERSION;
347 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
348 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SET_ARI;
349 	RPC_U16(&msg, 0U) = (uint16_t)resource;
350 	RPC_U16(&msg, 2U) = (uint16_t)resource_mst;
351 	RPC_U16(&msg, 4U) = (uint16_t)ari;
352 	RPC_U8(&msg, 6U) = (uint8_t)enable;
353 	RPC_SIZE(&msg) = 3U;
354 
355 	sc_call_rpc(ipc, &msg, SC_FALSE);
356 
357 	result = RPC_R8(&msg);
358 	return (sc_err_t)result;
359 }
360 
sc_misc_boot_status(sc_ipc_t ipc,sc_misc_boot_status_t status)361 void sc_misc_boot_status(sc_ipc_t ipc, sc_misc_boot_status_t status)
362 {
363 	sc_rpc_msg_t msg;
364 
365 	RPC_VER(&msg) = SC_RPC_VERSION;
366 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
367 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_BOOT_STATUS;
368 	RPC_U8(&msg, 0U) = (uint8_t)status;
369 	RPC_SIZE(&msg) = 2U;
370 
371 	sc_call_rpc(ipc, &msg, SC_TRUE);
372 }
373 
sc_misc_boot_done(sc_ipc_t ipc,sc_rsrc_t cpu)374 sc_err_t sc_misc_boot_done(sc_ipc_t ipc, sc_rsrc_t cpu)
375 {
376 	sc_rpc_msg_t msg;
377 	uint8_t result;
378 
379 	RPC_VER(&msg) = SC_RPC_VERSION;
380 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
381 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_BOOT_DONE;
382 	RPC_U16(&msg, 0U) = (uint16_t)cpu;
383 	RPC_SIZE(&msg) = 2U;
384 
385 	sc_call_rpc(ipc, &msg, SC_FALSE);
386 
387 	result = RPC_R8(&msg);
388 	return (sc_err_t)result;
389 }
390 
sc_misc_otp_fuse_read(sc_ipc_t ipc,uint32_t word,uint32_t * val)391 sc_err_t sc_misc_otp_fuse_read(sc_ipc_t ipc, uint32_t word, uint32_t *val)
392 {
393 	sc_rpc_msg_t msg;
394 	uint8_t result;
395 
396 	RPC_VER(&msg) = SC_RPC_VERSION;
397 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
398 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_OTP_FUSE_READ;
399 	RPC_U32(&msg, 0U) = (uint32_t)word;
400 	RPC_SIZE(&msg) = 2U;
401 
402 	sc_call_rpc(ipc, &msg, SC_FALSE);
403 
404 	if (val != NULL)
405 		*val = RPC_U32(&msg, 0U);
406 
407 	result = RPC_R8(&msg);
408 	return (sc_err_t)result;
409 }
410 
sc_misc_otp_fuse_write(sc_ipc_t ipc,uint32_t word,uint32_t val)411 sc_err_t sc_misc_otp_fuse_write(sc_ipc_t ipc, uint32_t word, uint32_t val)
412 {
413 	sc_rpc_msg_t msg;
414 	uint8_t result;
415 
416 	RPC_VER(&msg) = SC_RPC_VERSION;
417 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
418 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_OTP_FUSE_WRITE;
419 	RPC_U32(&msg, 0U) = (uint32_t)word;
420 	RPC_U32(&msg, 4U) = (uint32_t)val;
421 	RPC_SIZE(&msg) = 3U;
422 
423 	sc_call_rpc(ipc, &msg, SC_FALSE);
424 
425 	result = RPC_R8(&msg);
426 	return (sc_err_t)result;
427 }
428 
sc_misc_set_temp(sc_ipc_t ipc,sc_rsrc_t resource,sc_misc_temp_t temp,int16_t celsius,int8_t tenths)429 sc_err_t sc_misc_set_temp(sc_ipc_t ipc, sc_rsrc_t resource,
430 			  sc_misc_temp_t temp, int16_t celsius, int8_t tenths)
431 {
432 	sc_rpc_msg_t msg;
433 	uint8_t result;
434 
435 	RPC_VER(&msg) = SC_RPC_VERSION;
436 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
437 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_SET_TEMP;
438 	RPC_U16(&msg, 0U) = (uint16_t)resource;
439 	RPC_I16(&msg, 2U) = (int16_t) celsius;
440 	RPC_U8(&msg, 4U) = (uint8_t)temp;
441 	RPC_I8(&msg, 5U) = (int8_t) tenths;
442 	RPC_SIZE(&msg) = 3U;
443 
444 	sc_call_rpc(ipc, &msg, SC_FALSE);
445 
446 	result = RPC_R8(&msg);
447 	return (sc_err_t)result;
448 }
449 
sc_misc_get_temp(sc_ipc_t ipc,sc_rsrc_t resource,sc_misc_temp_t temp,int16_t * celsius,int8_t * tenths)450 sc_err_t sc_misc_get_temp(sc_ipc_t ipc, sc_rsrc_t resource,
451 			  sc_misc_temp_t temp, int16_t *celsius,
452 			  int8_t *tenths)
453 {
454 	sc_rpc_msg_t msg;
455 	uint8_t result;
456 
457 	RPC_VER(&msg) = SC_RPC_VERSION;
458 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
459 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_GET_TEMP;
460 	RPC_U16(&msg, 0U) = (uint16_t)resource;
461 	RPC_U8(&msg, 2U) = (uint8_t)temp;
462 	RPC_SIZE(&msg) = 2U;
463 
464 	sc_call_rpc(ipc, &msg, SC_FALSE);
465 
466 	if (celsius != NULL)
467 		*celsius = RPC_I16(&msg, 0U);
468 
469 	result = RPC_R8(&msg);
470 	if (tenths != NULL)
471 		*tenths = RPC_I8(&msg, 2U);
472 
473 	return (sc_err_t)result;
474 }
475 
sc_misc_get_boot_dev(sc_ipc_t ipc,sc_rsrc_t * dev)476 void sc_misc_get_boot_dev(sc_ipc_t ipc, sc_rsrc_t *dev)
477 {
478 	sc_rpc_msg_t msg;
479 
480 	RPC_VER(&msg) = SC_RPC_VERSION;
481 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
482 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_GET_BOOT_DEV;
483 	RPC_SIZE(&msg) = 1U;
484 
485 	sc_call_rpc(ipc, &msg, SC_FALSE);
486 
487 	if (dev != NULL)
488 		*dev = RPC_U16(&msg, 0U);
489 }
490 
sc_misc_get_button_status(sc_ipc_t ipc,sc_bool_t * status)491 void sc_misc_get_button_status(sc_ipc_t ipc, sc_bool_t *status)
492 {
493 	sc_rpc_msg_t msg;
494 
495 	RPC_VER(&msg) = SC_RPC_VERSION;
496 	RPC_SVC(&msg) = (uint8_t)SC_RPC_SVC_MISC;
497 	RPC_FUNC(&msg) = (uint8_t)MISC_FUNC_GET_BUTTON_STATUS;
498 	RPC_SIZE(&msg) = 1U;
499 
500 	sc_call_rpc(ipc, &msg, SC_FALSE);
501 
502 	if (status != NULL)
503 		*status = RPC_U8(&msg, 0U);
504 }
505 
506 /**@}*/
507