Add deinit function for uart.
Another work is add resource cleanup functions which is called
by other components when they are using uart.
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Add three PTY devices as dummy native channels. They are used for emulating
native lifecycle channel, native signal channel and native OEM raw channel
for IOC debugging.
Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This patch is used for IOC mediator debugging. Due to IOC message logs are
too much, need to save into one file instead of output stdout directly.
By default, the debug log is disabled.
Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This patch implements the signal whitelist feature.
All the signal messages will be discarded if they are not existed in whitelist.
Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This patch implements the IOC CBC signal serivces including single signal,
multi-signal and group signal. All of them are used for CAN devices
communication and IOC on-board peripherals control.
Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This patch implements the IOC lifecycle virtualization.
In native environment, lifecycle is uesed for SoC system power control,
likes enter/exit S3/S5. So these related messages can not forward directly
between physical IOC and Guest OS, they need to be mapped to VM pause, exit
and launch.
Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This patch adds the IOC signal identities and signal group identities,
that will be used by subsequent signal support patches.
Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Carrier Board Communication(CBC) protocol is a duplex protocol for IOC data
transfer, including physical layer, link layer, address layer and service layer.
Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
IOC mediator communicates with native IOC HW through several native channels of
CBC protocol. And IOC mediator communicates with virtual UART through one virtual
channel.
This patch implements channel operations including open/close/read/write.
Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
IOC mediator main functionality is transfer data between native CBC char
devices and virtual UART, it is implemented as full virtualization, Guest
OS can reuse native CBC driver directly.
Signed-off-by: Liu Yuan <yuan1.liu@intel.com>
Reviewed-by: Wang Yu <yu1.wang@intel.com>
Reviewed-by: Liu Shuo <shuo.a.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Unlike kqueue/kevent of BSD, the epoll of Linux could be
add/del by using different API on the fly.
This patch drops the notify used by mevent_add/del and
call epoll_ctl to add/delete target fd. Only keeps
global_head to track mevent added and makes the code
logic in mevent_dispatch() a littel bit simpler.
Another thing is related with epoll_ctl. If the target
fd is regular fd which doesn't support epoll, epoll_ctl
will return -1. When DM is start by systemd, the STDIO
is not mapped to terminal, epoll_ctl on STDIO could
return -1. Which block UOS boot. We only call mevent_add
after confirm STDIO is mapped to terminal.
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
malloc: allocate a block of memory, the contents of the block are undefined.
calloc: allocate a block of memory for an array of num elements and initializes all its bits to zero.
Signed-off-by: yechunliang <yechunliangcn@163.com>
The patch includes:
1. vrtc_cleanup -> vrtc_deinit to align with other devices
2. delete timer created in vrtc_init
3. make call to vrtc_deinit in cleanup path
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <Eddie.dong@intel.com>
old code has no deinit functionality for virtual keyboard device.
Which will trigger resource leak when system is reboot.
deinit function is added to:
1. deinit low ps2 based keyboard and mouse
2. release memory/io resource of virtual keyboard device
NOTE: IRQ resource will be handed in pci irq module
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <Eddie.dong@intel.com>
Add deinit function for ps2kbd and ps2mouse.
To support deinit function for ps2kbd and ps2mouse which
has struct atkbdc_base as parameter, we make struct
atkbdc_base exported as public.
We also add console unregister function for keyboard
and mouse. Which are called in ps2mouse/ps2kbd deinit
function.
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <Eddie.dong@intel.com>
Linux kernel CF9 reboot is doing things like:
- read value from 0xcf9
- mask out the value according to the reboot type (warm vs cold)
- BIT OR the value with reboot code
- write the value to 0xcf9
If there are two reboot event and the first one is cold
reboot and the second one is warm reboot, vsbl query
reboot type after the second one and will get code reboot
instead of warm reboot.
We should clear the data of 0xcf9 if guest request cold reboot.
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>