2015-11-21 22:25:41 -05:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015 Intel Corporation.
|
|
|
|
*
|
2017-01-18 17:01:01 -08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2015-11-21 22:25:41 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t. This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.
We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.
We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.
Jira: ZEP-2051
Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-19 10:32:08 -05:00
|
|
|
#include <zephyr/types.h>
|
2015-11-21 22:25:41 -05:00
|
|
|
#include <device.h>
|
|
|
|
#include <init.h>
|
|
|
|
|
|
|
|
#include "board.h"
|
2016-12-23 08:35:34 -05:00
|
|
|
#include <kernel.h>
|
2015-11-21 22:25:41 -05:00
|
|
|
#include <arch/cpu.h>
|
|
|
|
|
2015-11-12 14:00:47 -08:00
|
|
|
#if CONFIG_IPM_QUARK_SE
|
|
|
|
#include <ipm.h>
|
|
|
|
#include <ipm/ipm_quark_se.h>
|
2015-11-21 22:25:41 -05:00
|
|
|
|
2015-11-12 14:00:47 -08:00
|
|
|
static int x86_quark_se_ipm_init(void)
|
2015-11-21 22:25:41 -05:00
|
|
|
{
|
2016-08-16 10:58:40 -07:00
|
|
|
IRQ_CONNECT(QUARK_SE_IPM_INTERRUPT, CONFIG_QUARK_SE_IPM_IRQ_PRI,
|
2016-01-08 00:46:14 -08:00
|
|
|
quark_se_ipm_isr, NULL, 0);
|
2015-11-12 14:00:47 -08:00
|
|
|
irq_enable(QUARK_SE_IPM_INTERRUPT);
|
2016-03-21 17:33:24 -03:00
|
|
|
return 0;
|
2015-11-21 22:25:41 -05:00
|
|
|
}
|
|
|
|
|
2015-11-12 14:00:47 -08:00
|
|
|
static struct quark_se_ipm_controller_config_info ipm_controller_config = {
|
|
|
|
.controller_init = x86_quark_se_ipm_init
|
2015-11-21 22:25:41 -05:00
|
|
|
};
|
2016-04-14 09:28:35 -07:00
|
|
|
DEVICE_AND_API_INIT(quark_se_ipm, "", quark_se_ipm_controller_initialize,
|
2016-01-28 14:48:47 -05:00
|
|
|
NULL, &ipm_controller_config,
|
2016-11-08 11:06:55 -08:00
|
|
|
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
2016-04-14 09:28:35 -07:00
|
|
|
&ipm_quark_se_api_funcs);
|
2015-11-21 22:25:41 -05:00
|
|
|
|
2015-11-12 14:00:47 -08:00
|
|
|
#if defined(CONFIG_IPM_CONSOLE_RECEIVER) && defined(CONFIG_PRINTK)
|
|
|
|
#include <console/ipm_console.h>
|
2015-11-21 22:25:41 -05:00
|
|
|
|
2015-11-12 14:00:47 -08:00
|
|
|
QUARK_SE_IPM_DEFINE(quark_se_ipm4, 4, QUARK_SE_IPM_INBOUND);
|
2015-11-21 22:25:41 -05:00
|
|
|
|
2015-11-12 14:00:47 -08:00
|
|
|
#define QUARK_SE_IPM_CONSOLE_LINE_BUF_SIZE 80
|
2015-11-21 22:25:41 -05:00
|
|
|
|
2017-04-20 13:30:33 -05:00
|
|
|
static u32_t ipm_console_ring_buf_data[CONFIG_QUARK_SE_IPM_CONSOLE_RING_BUF_SIZE32];
|
2017-06-09 21:30:19 -04:00
|
|
|
static K_THREAD_STACK_DEFINE(ipm_console_thread_stack, CONFIG_IPM_CONSOLE_STACK_SIZE);
|
2015-11-12 14:00:47 -08:00
|
|
|
static char ipm_console_line_buf[QUARK_SE_IPM_CONSOLE_LINE_BUF_SIZE];
|
2015-11-21 22:25:41 -05:00
|
|
|
|
2016-10-09 11:31:55 +01:00
|
|
|
static struct ipm_console_receiver_config_info quark_se_ipm_receiver_config = {
|
2015-11-12 14:00:47 -08:00
|
|
|
.bind_to = "quark_se_ipm4",
|
2016-11-12 08:00:52 -05:00
|
|
|
.thread_stack = ipm_console_thread_stack,
|
2015-11-12 14:00:47 -08:00
|
|
|
.ring_buf_data = ipm_console_ring_buf_data,
|
2016-01-20 11:42:12 -08:00
|
|
|
.rb_size32 = CONFIG_QUARK_SE_IPM_CONSOLE_RING_BUF_SIZE32,
|
2015-11-12 14:00:47 -08:00
|
|
|
.line_buf = ipm_console_line_buf,
|
|
|
|
.lb_size = QUARK_SE_IPM_CONSOLE_LINE_BUF_SIZE,
|
|
|
|
.flags = IPM_CONSOLE_PRINTK
|
2015-11-21 22:25:41 -05:00
|
|
|
};
|
2015-11-12 14:00:47 -08:00
|
|
|
struct ipm_console_receiver_runtime_data quark_se_ipm_receiver_driver_data;
|
2016-01-28 14:48:47 -05:00
|
|
|
DEVICE_INIT(ipm_console0, "ipm_console0", ipm_console_receiver_init,
|
|
|
|
&quark_se_ipm_receiver_driver_data, &quark_se_ipm_receiver_config,
|
2016-11-08 11:06:55 -08:00
|
|
|
POST_KERNEL, CONFIG_IPM_CONSOLE_INIT_PRIORITY);
|
2015-11-21 22:25:41 -05:00
|
|
|
|
2015-11-12 14:00:47 -08:00
|
|
|
#endif /* CONFIG_PRINTK && CONFIG_IPM_CONSOLE_RECEIVER */
|
|
|
|
#endif /* CONFIG_IPM_QUARK_SE */
|