Move rpmb_sim.c and rpmb_backend.c to hw/platform/rpmb/
Signed-off-by: Huang Yang <yang.huang@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
A simulated rpmbfile requires to enable 4MB access by writing
the last byte.
Otherwise, the read operation should be failed if no write
was operated on the address greater than the read address.
Writing the last byte during file creating ensures the whole
4MB address is readable.
Signed-off-by: Huang Yang <yang.huang@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Fix by a fixed string length and correcting return value
Signed-off-by: Huang Yang <yang.huang@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Android HWC has problem when only see one display, then this is
workaround patch to make Android HDMI2 display normal.
V2: only change AaaG UOS kernel boot arg
Signed-off-by: Fei Jiang <fei.jiang@intel.com>
According to the syntax defined in C99, each struct/union field must have an
identifier. This patch removes unnamed struct/union fields that can be easily
expressed in a C99-compatible way.
Here is a summary of structs/unions removed.
struct vhm_request:
union {
uint32_t type; uint32_t type;
int32_t reserved0[16]; => int32_t reserved0[15];
};
struct vhm_request_buffer:
struct vhm_request_buffer {
union { union vhm_request_buffer {
struct vhm_request ...; => struct vhm_request ...;
int8_t reserved[4096]; int8_t reserved[4096];
} }
}
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
With '--ptdev_no_reset', DM doen not abort but warn when assign PCIe
dev without reset capability.
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Check reset method for PCIe dev according to 'reset' in sysfs, which
indicates reset capability, like FLR and secondary bus reset. PCIe dev
without reset capability is refused for passthrough to avoid failure
after UOS reboot.
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Support log level options, which could change the related log level
without code change.
The new usage:
-s <n>,xhci,[bus1-port1,bus2-port2]:[tablet]:[log=x]
eg: -s 8,xhci,1-2,2-2:log=D
eg: -s 7,xhci,tablet
eg: -s 7,xhci,1-2,2-2:tablet
Note: please follow the board hardware design, assign the ports
according to the receptacle connection
Change-Id: I44639c7b076d21a40eb8f7b99cea8decc5c13c0c
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Re-write the xHCI option parse function to support port mapper.
The new usage:
-s <n>,xhci,[bus1-port1,bus2-port2]:[tablet]
eg: -s 8,xhci,1-2,2-2
eg: -s 7,xhci,tablet
eg: -s 7,xhci,1-2,2-2:tablet
Note: please follow the board hardware design, assign the ports
according to the receptacle connection
Change-Id: I3c8392f7e15580cf768c8c4a619d705411da699d
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
add support for xHCI de-initialization when the guest
dose shutdown or reboot.
Change-Id: I3dfc1ed1a905b455ef455dff2065e872aa5c1ef8
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
add support for xHCI port sharing feature, which enable the ability
to assign different native ports to different multi-UOSes. For
example:
1-2,1-2 assigned to UOS-1.
1-1,2-1 assigned to UOS-2.
Change-Id: I899070f7a8a6eb23179e41e7b1f1da24c52482b2
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
New USB APIs:
usb_native_is_bus_existed/usb_native_is_port_existed: Check if specific
usb bus or port are valid or not.
usb_native_is_ss_port: Check if the specific port is supper speed usb port.
Change-Id: I9ab54f6e81742321128d6abd5845ef966f0e9f37
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Implements the disconnect callback of libusb which will be called once
USB device plug out.
Change-Id: Ic5f072f08a92270e6e5836b49e5066da783af243
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Support USB mouse, USB keyboard and USB flash drive by enabling the
USB bulk and interrupt transfer for port mapper.
Change-Id: Ia202729e0cfb26fb44a6b278cf4306f2b0b6fa36
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This patch implements the port change event related function, it
triggered when USB device be hot plugged in.
Change-Id: I065c1e93779f85f8ee6031960e129b59146e1bb7
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This patch implements the control transfer for port mapper. With this
patch, USB2.0 device can be enumerated successfully in user OS.
Change-Id: I567bd00ca310d68375acd94a5cc5bcd287665df1
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Add a function to covert libusb error to the common USB core
error type.
Change-Id: Icb03fae2acdc914b3d32a5942faf7d79793a4bee
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
move the UREQ macro from usb_mouse.c to usb.h
Change-Id: I977cf73291610b0448eb031a500788a397b55f88
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Allocate an emulated USB instance in connect callback function. This
instance is the entity of virtual USB device which will be enumerated
by the UOS.
Change-Id: I948d2ce9eca7e9d5bbab673f2505efc0a03c03b4
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
For the purpose of USB port mapper, change struct usb_devemu to
common interface between HCD layer and USB device layer.
Besides, implements ue_init/ue_deinit/ue_info for port mapper.
Change-Id: Id4b7345c7b321b9bdab58139c61169d9229cb6f8
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Introduce the struct usb_dev which is used to abstract the physical USB
devices. And APIs for external call are also provided.
Change-Id: Ia25d52a6c670040da787f82b3bea34eee9f3d04d
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This patch involves the libusb to communicate with the SOS USB kernel
stack, and the README.rst is also updated for this purpose.
The libusb is under GNU Lesser General Public License version 2.1.
Change-Id: Ieecd08f41993162115e8e588980b81b769c89a37
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Change the DPRINTF macro to UPRINTF for USB subsystem. The
UPRINTF will print log according to certain log level.
Change-Id: I5db8813357c9f684c25f23650e7c914f9063f842
Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This patch implements INIT, ACTIVE, SUSPENDING and SUSPENDED operations of
IOC mediator lifecycle virtualization.
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>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Implements state transfer framework to support IOC lifecycle virtualization.
Four states will be involved in this framework includes INIT, ACTIVE,SUSPENDING and
SUSPENDED.
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>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Separate wakeup reason and hearbeat functions from lifecycle processing since
lifecycle virtualization only contains wakeup reason and heartbeat, the other
functions of lifecycle like boot selector, are not handled by IOC mediator.
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>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Full logic to supprot vRPMB:
1. Automatic switch between physical or simulated RPMB.
But hardcode to use simulated one.
2. Parse RPMB cmd to basic APIs to:
2.1 check request frame HMAC with uos vkey
2.2 replace RPMB frame with real values.
3. RPMB partitioning for multiple UOS.
It's hardcoded for coming config file support.
Signed-off-by: Huang Yang <yang.huang@intel.com>
Signed-off-by: Du Min <minx.du@intel.com>
Acked-by: Zhu Bing <bing.zhu@intel.com>
Create file as simulated RPMB storage for pre-production usage.
Add RPMB APIs to emulate behavior of physical RPMB controllor.
Signed-off-by: Huang Yang <yang.huang@intel.com>
Signed-off-by: Du Min <minx.du@intel.com>
Acked-by: Zhu Bing <bing.zhu@intel.com>
This patch implements virtio rpmb backend VBS-U component,
it includes the basic module interface with DM. This
component will work with vRPMB FE driver together to
provide one communication channel between UOS and SOS.
Signed-off-by: weideng <wei.a.deng@intel.com>
Signed-off-by: yingbinx <yingbinx.zeng@intel.com>
Acked-by: Zhu Bing <bing.zhu@intel.com>
After i915.avail_planes_per_pipe(0x0000F) is added to SOS, it will cause
that the pipe B/C is initialized without plane. In such case this pipe
can't be used by UOS, with error: primary plane disabled.
The bootarg is changed so that the pipe B/C on SOS can be initialized with
at least one plane.
Signed-off-by: Jiang Fei <fei.jiang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Move the platform apl-mrb samples to devicemodel samples directory.
Add the install target to the missing samples files and re-organize the
samples directory structure to have nuc and apl-mrb samples.
Suggested-by: Arzhan Kinzhalin <arzhan.i.kinzhalin@intel.com>
Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
-memory was dereferenced after being freed:
MACRO 'LIST_FOREACH()' dereference
'client' for next list node after 'client'
was freed.
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
suspicious dereference of pointer 'fi->fi_devi'
by passing it to function 'pci_emul_free_bars()'
before NULL check.
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is reported to cause UOS reboot fail becasue the
pci_businfo[] only be allocated when calling pci_parse_slot
in dm initialization while UOS reboot will not allocate again.
So we can't free it here.
This reverts commit 7aaff68798.
Signed-off-by: Jie Deng <jie.deng@intel.com>
Current only 8 vioapic pins for pci irq (total 24 with 16 reserved),
which easily leads virtual GSI sharing with more and more passthrough
devices. This patch doulbes vioapic pin count and adds reboot hooks to
allocate from same pin after each reboot.
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
Remove 'license_header' files that were located in hypervisor/ and
devicemodel/ and used by the respective Makefiles to build the
'include/version.h' header file.
Both Makefiles were adjusted to use the top-level LICENSE file
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Entries of pci_businfo[] allocated in function "pci_parse_slot"
using calloc need to be freed when deinit.
Signed-off-by: Jie Deng <jie.deng@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Anthony Xu <anthony.xu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
The tools directory is moved out of ./devicemodle, to be in parallel with
hypervisor, devicemodel and doc.
Signed-off-by: Yan, Like <like.yan@intel.com>