Commit Graph

331 Commits

Author SHA1 Message Date
Jian Jun Chen f63c7a7355 dm: virtio: set VBS-K status to VIRTIO_DEV_INIT_SUCCESS after reset
When reset VBS-K status should be set to VIRTIO_DEV_INIT_SUCCESS
because at the time the char dev of VBS-K is still opened and
when set_status callback is called later, it depends on
VIRTIO_DEV_INIT_SUCCESS to resume.

Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-16 16:22:43 +08:00
Jian Jun Chen 1378a8440a dm: virtio: add support for VBS-K device reset
A new ioctl is introduced in VBS-K to issue reset command to kernel
VBS-K driver. This is used to support VBS-K S3. When FE enters S3
reset command is sent to device model. Backend driver in device model
should use this ioctl to inform the VBS-K drvier in kernel.

Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-16 16:22:43 +08:00
Deng Wei 932bc32dcc DM: virtio rpmb backend driver updates
RPMB frontend driver in UOS kernel has fixed unstable issue,
which requires BE for update as well. E.g. structure adjustment,
definition modification and so on.

Signed-off-by: Deng Wei <wei.a.deng@intel.com>
Signed-off-by: Huang Yang <yang.huang@intel.com>
Acked-by: Zhu Bing <bing.zhu@intel.com>
2018-08-16 09:42:20 +08:00
Xiaoguang Wu 0292e14ff9 DM USB: xHCI: enable xHCI SOS S3 support
This patch enable the support for SOS S3 from the perspective
of USB xHCI.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-15 11:18:33 +08:00
Xiaoguang Wu 0b405ee780 DM USB: xHCI: change flow of creation of virtual USB device
The xHCI emulation greatly depends on the user space library libusb
which is based on the usbfs module in Linux kernel. The libusb will
bind usbfs to physical USB device which makes hardware control over
libusb in user space possible.

The pci_xhci_dev_create is called in pci_xhci_native_usb_dev_conn_cb
which is a callback function triggered by physical USB device plugging.
This function will bind the physical USB device to usbfs in SOS, which
we depend to create the communication between UOS xHCI driver with
physical USB device.

This design will fail if the reconnection happened in the SOS, which
will bind class driver to the physical USB device instead of usbfs,
hence the libusb device handle in DM is invalid.

Currently, the native S3 will disable the vbus for all xHCI ports and
re-drive during S3 resume. This behavior cause native USB driver unbind
the usbfs and bind to related class driver, then made the DM lost
control and failed to continue emulation.

To fix this issue, place the pci_xhci_dev_create in the function
pci_xhci_cmd_enable_slot. According to the xHCI spec 4.5.3 Figure 10,
the UOS always send Enable Slot command when a device is attached or
recovered from errors (by Disable Slot command). So every time the SOS
can't resuming normally or some unexpected disconnection happens, this
desigen will always survive by Disable Slot and Enable Slot command
series from UOS xHCI driver.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-15 11:18:33 +08:00
Xiaoguang Wu b359dc361a DM USB: xHCI: code cleanup: change variable name
Replace 'native_assign_ports' with 'port_map_tbl' to be more accurate
for the role of this variable plays.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-15 11:18:33 +08:00
Xiaoguang Wu 27eeea4cd3 DM USB: xHCI: refine port assignment logic
The variable native_assign_ports in struct pci_xhci_vdev is used
to record wether certain root hub port in SOS is assigned to UOS.
The logic uses zero to express 'not assigned' and nonzero to express
'assigned'. In this patch, use macro to replace number to express
better.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-15 11:18:33 +08:00
Xiaoguang Wu 5cc389aa29 DM USB: xHCI: limit bus and port numbers of xHCI
Currently the maximum number of bus and port for xHCI are
both set to 255, it is theoretically possible but in fact
not neccessary. This patch changes those two values to be
more proper: 4 buses and 20 ports.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-15 11:18:33 +08:00
Xiaoguang Wu 2abec44e15 DM USB: introduce struct usb_native_devinfo
Current design cannot get physical USB device information without
the creation of pci_xhci_dev_emu. This brings some difficulties in
certain situations, hence struct usb_native_devinfo is introduced
to describe neccessary information to solve this trouble.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-15 11:18:33 +08:00
Xiaoguang Wu 363b4da4df DM USB: xHCI: refine xHCI PORTSC Register related functions
PORTSC (Port Status and Control Register) register play a very
important role in USB sub-system. This patch is used to refine
related manipulation functions.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-15 11:18:33 +08:00
Xiaoguang Wu b746377f45 DM USB: xHCI: fix an xHCI issue to enable UOS s3 feature
Current DM design use two variables to do the indexing of xHCI
Event Ring: er_enq_idx and er_events_cnt. They are members of
the struct pci_xhci_rtsregs.

In UOS, during the process of xHCI resuming, the xHCI driver
will restore the ERSTBA (Event Ring Segment Table Base Address)
register to be the value before suspending. And at this point,
the old DM implementation will set both er_enq_idx and
er_events_cnt to be zero, so the DM will access the Event Ring
from the start position in the buffer. But at the same time the
UOS xHCI driver still wants to access the old position in the
Event Ring before suspending, which will result of unexpected
errors.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-15 11:18:33 +08:00
yuhong.tao@intel.com b0861621d9 dm: monotor: bugfix: update wakeup reason before call recume() callback
In handle_resume(), wakeup_reason is updated before call
ops->ops->resume(). Because ops->ops->resume() needs to know the
latest wakeup reason.

Acked-by: Yan Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-08-15 11:16:54 +08:00
Bandi,Kushal 7a739ccef0 DM: Add dm for IPU mediation
This device model is to configure the virtual IPU PCI device.
In order to execute this DM the lauch script needs to add
virtio-ipu as parameter to acrn-dm
For e.g. -s 21,virtio-ipu

Signed-off-by: Bandi,Kushal <kushal.bandi@intel.com>
2018-08-13 16:18:49 +08:00
Binbin Wu a568c9e3f7 dm: bios: update vsbl to v0.8.1
Support trusty S3 resume.
New watchdog reset report value.
Increase the limitation of bzImage size.

Signed-off-by: Binbin Wu <binbin.wu@intel.com>
2018-08-13 14:28:58 +08:00
ailin,yang 5a559ce6f5 fixed cpu info incorrect and remove 2M hugepages
with original script, user can not get 3 CPU cores info with cat/proc/cpuinfo in UOS.
it just show 1 only.  with this patch,  default,  user can see 1 cpu info in SOS and 3 cores info in UOS.
and remove 2M hugepages settings because it is not using any more.
# make sure there is enough 2M hugepages in the pool
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
also, this patch is setting default UOS memory to 2G
2018-08-13 14:27:19 +08:00
ailin,yang f11b2635c5 remove 2M hugepages
remove 2M hugepages setting here because it will not use any more. 
# make sure there is enough 2M hugepages in the pool
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
2018-08-13 14:24:10 +08:00
Jie Deng 8348800871 dm: virtio_rnd: use delayed blocking IO to make virtio_rnd works on Linux based SOS
Randomness sourced from /dev/random which does not block
once it has been seeded at bootup and you will always get
something when you read from that file. This is true on
Freebsd but unfortunately things are not the same on Linux.
Most cases, you can't read anything from /dev/random especially
on current acrn platform which lacking random events.
virtio_rnd inherted from freebsd doesn't work anymore.

This patch makes virtio_rnd working on Linux based SOS. It uses
blocking IO to sevice the front-end random driver and delays the
read operation into a new thread to avoid blocking the main
notify thread.

Signed-off-by: Jie Deng <jie.deng@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-10 16:50:16 +08:00
Conghui Chen 49322ac002 dm: storage: support cache mode toggling
1. support "writeback" and "writethru" mode toggling for virtio-blk
conditionally. When starting DM with "writethru" parameter in
virtio-blk, guest OS could not toggle cache mode. When starting DM
with "writeback" parameter in virtio-blk, guest OS could toggle
cache mode.

    ------------------------------
    DM cmdline  | toggle support
    ------------+-----------------
    writeback   | yes
    writethru   | no
    ------------------------------

2. To toggle cache mode, run below command in guest OS:

    echo "write back" > /sys/devices/xxx/vdx/cache_type
OR
    echo "write through" > /sys/devices/xxx/vdx/cache_type

Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-08-10 10:33:21 +08:00
Conghui Chen f4fcf5d6eb dm: virtio: remove hv_caps from virtio_ops
currently, each virtio device has their own virtio_ops implementation.
Take virtio-blk for example:

static struct virtio_ops virtio_blk_ops = {
        "virtio_blk",
        1,
        sizeof(struct virtio_blk_config),
        virtio_blk_reset,
        virtio_blk_notify,
        virtio_blk_cfgread,
        virtio_blk_cfgwrite,
        NULL,
        NULL,
        VIRTIO_BLK_S_HOSTCAPS,
};

If start DM with two virtio-blk, this global variable will be
assigined to two virtio-blk instances. Changing hv_caps for one
instance will affect others. But different instances may need
different capabilities.

To support this requirement, we suggest to move hv_caps to
virtio_base structure, and each instance can return their own
capabilities.

Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-10 10:33:21 +08:00
Conghui Chen 2592ea8fa4 dm: storage: support writethru and writeback mode
In writethru mode, guest storage write are reported completed only
when the data has been written to physical storage.

In writeback mode, guest storage write are reported completed when
data is placed in SOS page cache. Needs to be flushed to the
physical storage.

USAGE:
    -s x,virtio-blk,<filepath>,writeback
    -s x,virtio-blk,<filepath>,writethru

The default mode is *writethru*

Signed-off-by: Conghui Chen <conghui.chen@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-08-10 10:33:21 +08:00
Edwin Zhai ac39b90515 DM: update GSI sharing info
With latest FW, ethernet/wifi BDF changes from 3:0.0/4:0.0 to
2:0.0/3:0.0.

Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-08-09 15:42:51 +08:00
Junjie Mao 55105dbdeb DM: notify VHM request complete after pausing the VM
It is necessary to notify the VHM and hypervisor on the completion of a VHM
request even when the UOS is in suspend or system reset mode because the VHM and
hypervisor rely on the notification to reset their own states on the
request.

Currently the VHM request state is checked against REQ_STATE_PROCESSING instead
of REQ_STATE_COMPLETE when handling system reset or suspend/resume, leading to a
completed request unnotified, and causing the HV to complain on an occupied VHM
request when it raises a new one.

This patch fixes this issue by properly notifying completed requests to the VHM
& hypervisor. Some concerns are raised during a discussion on the potential
races which does not hurt for now but may in the future. These considerations
and potential solutions are documented as comments for future reference.

Tracked-On: #895
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-08-09 12:52:14 +08:00
Wei Liu 11c209e862 DM: add tag info while no repo in release
there is no git repo, which download from github release,
however, acrn-dm -v will get tag info from this repo, in
such case, the tag info was null.
this patch will fix nul tag, which get it from CL mock build.

Tracked-On: #676
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-08-09 09:47:08 +08:00
Minggui Cao af7943c5e6 DM: check more in guest service & launch script
some exceptions can happen if westnon or network name service
not started before launch uos guest, like gvt and network exceptions,
which can cause SOS reboot. so add the dependency.

add data partiton check in launch script, for it can be called in every
clearlinux platform.

Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2018-08-08 16:00:56 +08:00
Junjie Mao 638d7141d2 DM: adapt to the new VHM request state transitions
This is the counterpart in DM to the VHM request state update in the
hypervisor. Major changes include:

    * Remove accesses to the obsolete 'valid' member.
    * Access the 'processed' member using atomic operations.
    * Sync the documentation on vhm_request.

In addition, the new state transition also requires a VHM request to be always
handled properly, as there is no 'FAILED' state any more. Instead of crashing
the device model (and thus the UOS as well), the device model should return all
1s or ignore the request when it is to load from or store to an invalid address,
respectively.

Note: there is an issue in vm_system_reset() and vm_suspend_resume() where
completed VHM requests are not properly notified, causing the hypervisor to
complain as it sees uncompleted requests while trying to create a new one. This
issue will be resolved in a separate patch.

v1 -> v2:

    * Use macro-defined constants for the default values for invalid PIO/MMIO
      reads.
    * Change the return type of vmexit_handler_t in DM to void as the return
      values are no longer necessary.
    * Remove VM_EXITCODE that are no longer used.

Tracked-On: #875
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-08 15:53:07 +08:00
Junjie Mao ea137589e6 DM: add wrappers to gcc built-in atomic operations
This patch introduces wrappers to the built-in atomic operations provided by
gcc.

There are two sets of built-in atomic functions available. Before gcc 4.7.0 only
the __sync built-in functions are available, while since 4.7.0 a new set of
built-in functions with the __atomic prefix is introduced as a
replacement. Since the __sync functions will eventually be deprecated, the
__atomic ones are preferred whenever available.

The interfaces provided are listed below, mostly following the naming of the
underlying built-in functions which explain themselves.

    atomic_load
    atomic_store
    atomic_xchg
    atomic_cmpxchg

    atomic_add_fetch
    atomic_sub_fetch
    atomic_and_fetch
    atomic_xor_fetch
    atomic_or_fetch
    atomic_nand_fetch

    atomic_fetch_add
    atomic_fetch_sub
    atomic_fetch_and
    atomic_fetch_xor
    atomic_fetch_or
    atomic_fetch_nand

    atomic_test_and_set
    atomic_clear
    atomic_thread_fence
    atomic_signal_fence

Tracked-On: #875
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-08 15:53:07 +08:00
Liang Yang cebc8d9a01 DM USB: xHCI: Refine drd code to fix a potential NULL pointer issue.
Refine DM DRD code and modify some logical judgement to avoid
potential NULL pointer issue.

Signed-off-by: Liang Yang <liang3.yang@intel.com>
Reviewed-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-07 10:12:23 +08:00
Yuan Liu a5121e95e9 dm: uart: add state check of backend tty before uart_closetty
This patch resolves one arcn-dm crash issue when rebooting UOS.

The rootcause is that uart releases unopened backend tty.

One reproduced case is that the board does not support IOC but IOC
feature is enabled in the acrn-dm. After rebooting UOS, crash will
happen.

NOTE: This issue is not related to IOC, it also can be reproduced
with NON-IOC scenario. Just set one invalid PTY to the lpc, then
this issue should be reproduced.
We need re-visit the whole policy for such scenario in future.

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-07 10:11:03 +08:00
Yuan Liu 7a3d03c82d dm: uart: fix acrn-dm crash issue when invoke uart_closetty function
mevent is added only if uart backend fd refers TTY in uart_opentty.
So we should only delete mevent if uart backend fd refers TTY in uart_closetty.

This issue can be reproduced by below steps
1) acrnd starts UOS
2) run poweroff command in UOS
3) crash happens

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
2018-08-03 11:11:21 +08:00
Yin Fengwei 7db4c0aac9 DM: Add funciton to update PM_WAK_STS
According to ACPI spec, when system back to working mode from
S3, WAK_STS bit (15) should be set.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-08-02 13:14:03 +08:00
Yin Fengwei a8a27d82d0 dm: add S3 support for UOS
We do:
 - pause target vm
 - suspend all virtual devices
 - wait for resume notification
 - resume all virtual devices
 - reset target vm

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-08-02 13:14:03 +08:00
Yin Fengwei 8ee4c0b1dd DM: add vm_stop/reset_watchdog
When guest enter/exit S3, we need to do
1. stop watchdog timer when guest enter S3 to avoid watchdog
   timer reset guest when guest is in S3 state.
2. reset watchdog timer when guest exit from S3.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-08-02 13:14:03 +08:00
Yin Fengwei a2241d983d DM: register pm ops to monitor
Then, acrnctl could send command to monitor module of DM and call
functions defined in pm ops. One example is: acrnctl resume UOS
after UOS enter S3.

Also add general pm.c and move pm related function to this file.

Signed-off-by: Yan Like <like.yan@intel.com>
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-08-02 13:14:03 +08:00
Zhang, wenling cf8fd8cfbc Revert "HV: clear memory region used by UOS before it exit"
This reverts commit cf7a94071b.
2018-08-01 11:32:31 -04:00
Jason Chen CJ a8e9d83e59 samples: change WIFI BDF to 3:0:0
SBL used to use 4:0:0 for WIFI device BDF, now it change back to 3:0:0

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
2018-08-01 12:46:25 +08:00
Yuan Liu 5e31e7c66f IOC mediator: Add parking brake and Hvac signals
This patch adds new signals about parking brake and Hvac in the signal
definition and signal whitelist.

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-08-01 11:37:19 +08:00
Binbin Wu 50af102872 dm: bios: update vSBL binary to v0.8
Update vSBL with the following new features:
	Support watchdog status report when boot.
	Update vFastboot version to 0.8
Add a changelog file.
Add a md5sum file of vSBL images.

Signed-off-by: Binbin Wu <binbin.wu@intel.com>
2018-07-31 12:49:19 +08:00
Xie, nanlin 8ed98d33b7 DM: fix make install issue in auto boot UOS service
fix make install issue

Signed-off-by: Nanlin Xie <nanlin.xie@intel.com>
2018-07-31 10:37:44 +08:00
Yuan Liu b7436272e7 IOC mediator: fix IOC mediator blocks acrn-dm shutdown flow
This patch resolves IOC mediator deinit function is blocked due to IOC mediator
core thread enters into sleep by epoll_wait, then pthread_join cannot return.

Trigger an event to wakeup core thread when IOC mediator deinit is invoked.

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-07-30 12:31:50 +08:00
Yonghua Huang cf7a94071b HV: clear memory region used by UOS before it exit
this patch fixes such an information leaking issue:
   in case that after a UOS is destroyed, its memroy
   will be reclaimed and maybe re-allocated for a new UOS,
   then the previous UOS sensitive data in memory may
   be leaked to the new UOS.

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-07-30 10:14:22 +08:00
Minggui Cao d40a6b9e93 DM: add service to support auot boot UOS
add acrn_guest.service, and modify makefile to install it
into root fs.

Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Like Yan <like.yan@intel.com>
2018-07-27 16:56:07 +08:00
Minggui Cao 3cab92655d DM: add param: -V 5 to auto check/boot UOS image
it can auto check android image, if exists, then launch it;
if not, it will try to luanch clearlinux. it can be used by
acrn_guest.service to auto boot UOS.

Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@intel.com>
2018-07-27 10:45:13 +08:00
Jason Chen CJ e71a0887a0 samples: offline SOS cpus before launch uos
offline SOS cpus except BSP to let them free for UOS cpu allocation

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-07-25 17:18:14 +08:00
Jason Chen CJ d5ead6151c samples: remove maxcpus from bootargs
after enable all cpus during sos bootup, there should not be maxcpus option
here

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-07-25 17:18:14 +08:00
Xinyun Liu 4344832700 Revert "DM sample: force enabling HDMI1 and HDMI2 connectors"
This reverts commit 47116e8c4b.

if eDP panel connected, something wrong happens:

eDP	HDMI1	HDMI2
---------------------------------------------------------
SOS	UOS1	UOS1	Good.
SOS	UOS1		BAD. SOS is OK. NO show in HDMI1
SOS		UOS1	BAD. SOS is OK. NO show in HDMI2
SOS			BAD.

This is also a temp solution: if only HDMI2 is connected, SOS will be
shown on HDMI2. But UOS1 is expected in some cases.

Signed-off-by: Xinyun Liu <xinyun.liu@intel.com>
Reviewed-by: Min He <min.he@intel.com>
2018-07-24 12:49:31 +08:00
Huihuang Shi bd6979925c fix assign.c interger violations
fix all assign.c integer violations except related
"Implicit conversion: actual to formal param".

Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-07-23 10:31:57 +08:00
Xiaoguang Wu 9ac1be2c5e DM USB: enable isochronous transfer
Enable isochronous transfer to support related USB devices

Change-Id: Id9fe0714e937fafc47de090ba6d349713cbe1b8b
Tracked-On:
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-07-20 10:42:34 +08:00
Xiaoguang Wu b95f93927b DM USB: temporary solution for corner case of control transfer
In the process of implementation for USB isochronous transfer, the
timeout (100ms) is not enough for Plantronics USB headset. So pass
longer timeout (300ms) to function libusb_control_transfer will
make USB headset of Plantronics work.

This change only results a longer execution time in ENUMERATION process
for few devices like Plantronics USB headset which need more time to do
its internal operations. For most USB devices, time less than 100ms are
enough to complete the execution of libusb_control_transfer. So basically
it will not affect the whole system performance.

In the long term, a better solution (eg: async control transfer) will be
introduced to replace current implementation.

Change-Id: I380e0cc337ec5741b1e4ce989abacce826b7dde4
Tracked-On:
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-07-20 10:42:34 +08:00
Xiaoguang Wu 3389e83177 DM USB: add some BCD codes
BCD code is USB Specification Release Number in Binaray-Coded
Decimal. Add some BCD codes for some USB devices.

Change-Id: I40f04ef2ebaf5b0da554ff8f432415e8e3cebe01
Tracked-On:
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-07-20 10:42:34 +08:00
Xiaoguang Wu b9597d4fa8 DM USB: xHCI: add microframe index(MFINDEX) register emulation support
Add microframe index register support, which is an important timing
component for isochronous transport.

Change-Id: I615664275b539cfb713d7795edd3f213b0302b92
Tracked-On:
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2018-07-20 10:42:34 +08:00