Commit Graph

361 Commits

Author SHA1 Message Date
Wei Liu 631c461314 acrn-config: Cx desc parsing enhancement
Previous code parse the Cx value by hardcoded position in sysfs desc
node, but this might be changed in different kernel.

This patch will parse the Cx value position by index key word like
MWAIT/IOPORT.

Tracked-On: #4074
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-12 22:03:50 +08:00
Wei Liu d9cb750ed9 acrn-config: alloc vuart1 irq when pttyS1 not exist only
If pttyS1 do not exist, we can alloc irq for vuart1, but if pttyS1
exist, we should reuse the irq of pttyS1 to keep compliance.

Tracked-On: #4073
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-12 22:03:50 +08:00
Victor Sun 0011607a16 Makefile: refine include path for efi_stub
Move hypervisor related include path from CFLAGS to INCLUDE_PATH to make
structure more clean.

Tracked-On: #3779

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-12 10:51:04 +08:00
Victor Sun 9a3cc8f748 makefile: cover menuconfig way to configure board/scenario
We now have four methods to configure board and scenario when
build acrn (sorted with priority):
1. Change them with "make menuconfig" in hypervisor directory
2. Give baord_file/scenario_file as make command parameters
3. Give BOARD/SCENARIO as make command parameters
4. Use BOARD/SCENARIO default value defined in Makefile file

With this patch, we make sure we follow priority exactly.

Tracked-On: #4067

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-11 15:01:50 +08:00
Victor Sun ed8fb94778 Makefile: support make from XML for new board
Currently make hypervisor will depend on a $(BOARD).config file to load
board defconfig which triggered by oldconfig process, this will block
make from XMLs for a new board because $(BOARD).config never exist.
This requires us to patch configuration for new board earlier than make
oldconfig.

Tracked-On: #4067
Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-11-11 15:01:50 +08:00
Wei Liu 05bb56291b acrn-config: include msr.h in board.c
without the msr.h file the build will be failed when CAT is enabled.

Tracked-On: #4066
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:44:03 +08:00
Wei Liu 5cc2c0dca5 acrn-config: chose ttyS1 for vuart1
For vuart1, if it's mapped to a real native serial port, we must
re-use the native serial port io base and irq number. If no native
serial port is mapped to vuart1, non-exist io base and irq should
be used.

Please note: UOS launch script may need be updated according to
which serial port index is used by vuart1.

Now, we are using ttyS1 of SOS for vuart1 in our release. User may
need to remap vuart to different ttySx by following above rule if
ttyS1 in user platform is used by other devices like Bluetooth/Wifi.

Tracked-On: #4016
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-On: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 485529415e acrn-config: add 'xhci' usb mediator for laag and waag
Enable xhci usb mediator for whl-ipc-i5/whl-ipc-7 and KBL NUC for LaaG
and WaaG.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 572abc70d7 acrn-config: add serial config in new $(board).config
Enhance the $(board).config for new board.
Serial config should be set in $(board).config for new board.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu c3495c6839 acrn-config: refine mem_size_set function
mem_size should be set from xml, it should not be overrided dynamically.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 61926d2b11 acrn-config: refine interrupt_storm function
interrupt_storm should be enabled while passthrough device was set.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 83797610da acrn-config: add support to generate launch script
Add support to generate launch script for whl-ipc-i5/whl-ipc-i7.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 9c8059499a acrn-config: remove runC script from unnecessary launch script
1. run_cotainer is linux type uos, remove related runC script from
unnercessary luanch script.

Tracked-On: #3930
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 2fcbd5c3f5 acrn-config: add config files for whl-ipc-i7 board
Add board/scenario/launch config files for whl-ipc-i7.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu 28c1d001b5 acrn-config: add config files for whl-ipc-i5 board
Add board/scenario/launch config files for whl-ipc-i5.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 13:43:50 +08:00
Wei Liu b9c77e008d acrn-config: 'keep_gsi' flag set for Android vm
keep_gsi is needed as a workaround for the device that support both
MSI and legacy interrupt, so keep the flag for Android only because
it is not sure for some wifi/audio device on other Linux guest.

Tracked-On: #3956
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-11 11:08:21 +08:00
Wei Liu 7b0cafa84f acrn-config: generate dmar info for board.c
1. Parse DRHD_INFO section from board config xml, and generate dmar
structure information to board.c
2. Copy macro of DRHD_INFO from board config xml to $(board)_acpi_platform.h

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu ad9f424ce5 acrn-config: generate proper msr_index value for CLOS
Since msr_index relys on the MSR_IA32_L2_QOS_MASKn(n:max to 3)
macro which defined in hv source code, generate array that CLOS number
more than 4 means need define more than 4 macro.
This patch solve such issue by using MSR_IA32_L2/L3_MASK_BASE with the
msr index offset.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu 6d9ff40183 acrn-config: update DRHD_INFO section for board xml
The DRHD_INFO section should be updated with the refinement patches for
parsing DMAR table.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu 4658259be7 acrn-config: refine DRHD structure initialization
1. Initialize DRHDn_DEVSCOPEn_TYPE/DRHDn_DEVSCOPEn_ID for each devscope;
2. Remove DRHDn_IOAPIC_ID macro;
2. Refine the value format from base 10 to 16.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu 8fcfea1386 acrn-config: refinement for parsing DMAR table
Previous DRHD and device scope number are hard coded to 4, this patch removes
the limitation and parse the real drhd count/devscope count dynamically.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Wei Liu f10c937b40 acrn-config: correct value of DRHDx_IGNORE macro
The DRHDx_IGNORE should be defined to true when DRHD device BDF equal to
the given CONFIG_GPU_SBDF.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-11-08 16:43:08 +08:00
Li Fei1 af886fee8c efi-stub: reserve unconfigure high memory
Now ACRN support more and more platforms. However, the default configuration only
support board which memory is less than 16 GB. If a board memory is large than
16 GB, the developer needs to configure the memory configuration according to his
board. Otherwise, the boot will fail. This's because UEFI BIOS will use the high
memory as possible.
This patch try to allocate the memory as eraly as possible. So that the BIOS will
not access this region.

Tracked-On: #4007
Signed-off-by: Li Fei1 <fei1.li@intel.com>
2019-11-07 08:47:02 +08:00
wenlingz c8fa8e15f8 Modify KBL-NUC/SDC for default build
Tracked-On: #3968
Signed-off-by: wenlingz <wenling.zhang@intel.com>
2019-11-01 09:06:45 +08:00
Wei Liu 85b362fbeb acrn-config: modify vxworks uos id for industry launch config
As vm3 for industry scenario was removed from scenario config, so
modify the uos id to proper id.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-29 08:38:25 +08:00
Wei Liu 941d5ad308 acrn-config: parse rootfs_img and refine virtio-blk
1. Parse item of 'rootfs_img' from launch config xml.
2. Refine virtio-blk device for launch config.

Tracked-On: #3931
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2019-10-29 08:38:25 +08:00
Wei Liu 8cd7c34580 acrn-config: modify board name to uos name
We should use launch_$(uos type) for launch function name instead of using
launch_$(board name).

Tracked-On: #3931
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-29 08:38:25 +08:00
Wei Liu 812d8af65a acrn-config: add mem_size for launch vm
add mem_size parameter for acrn-dm while generating launch script.

Traked-On: #3932
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-29 08:38:25 +08:00
Wei Liu f46d8a9669 acrn-config: add the '"' character for launch script
1. Add the character of quotation marks for launch vm script.
2. Audio codec should put together with audio devcie and pass to
 vm , otherwise report an error message to webUI.

Tracked-On: #3937
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-29 08:38:25 +08:00
Victor Sun 6f7081f620 acrn-config: remove vm3 for industry scenario
The VM2 of INDUSTRY scenario need 2 vCPUs for performance, so there would
be no available pCPU for VM3, need to remove VM3 for this scenario.

Tracked-On: #3925

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-10-25 15:17:40 +08:00
Wei Liu feba836944 acrn-config: refine ttyS info of board file
The previous method to handle ttyS info has an assumption that PCI
serial devices are all mmio type, this caused incorrect BDF info in
board XML file.
This patch fix this issue by dropping serial device BDF info and
replace it with IO type.

Tracked-On: #3900
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-25 10:56:23 +08:00
Wei Liu b6a8052045 acrn-config: filter out the proper wifi/ethernet device
Filter out the wifi/ethernet device from webUI with below PCI device class coding rule:
ethernet: 0200/0280;
wifi: 0280/0d20/0d21/0d80;

Tracked-On: #3917
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-25 09:02:23 +08:00
Shuang Zheng defeb851bc acrn-config: fix the issue no error message in launch setting
fix the issue that there is no error message displayed in launch setting of WebUI.

Tracked-On: #3913
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2019-10-25 09:02:23 +08:00
Wei Liu d9f0d8dcf0 acrn-config: fix the wrong 'key' type returned to webUI
Fix the wrong 'key' type of error list returned to webUI for parsing.

 Tracked-On: #3913
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-25 09:02:23 +08:00
Wei Liu 9ea7a85ca5 acrn-config: set default package value for _S3 and _S5
Some BIOS does not support s3/s5, so there might be no _S3 or _S5
package in host ACPI table, previous code did not handle this, so
the build would be failed with the generated board file.
Set default s3/s5 package value to 0 for such case.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 15:13:51 +08:00
Wei Liu 24d3eaba27 acrn-config: skip git environment check when not do git commit
Check git environment only when '--enable_commit' option was set.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 15:13:51 +08:00
Wei Liu fbd8597fbf acrn-config: refine 'lpc' setting with console type
Refine 'lpc' setting for acrn-dm option.

Tracked-On: #3854
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 15:13:51 +08:00
Yuan Liu 73b8c91e06 Misc: lifemngr-daemon-on-UOS for windows
For cross-VM S5 notify via vUART, life_mngr service is running on UOS.
It is listening on COM2 to get SOS's commands.
The protocol is: SOS send "shutdown", UOS feedback "acked".

When SOS triggle shutdown, SOS can 1) check VM's status until UOS
stopped, 2) retry shutdown UOS normally with timeout.
So, no matter life_mngr server is running, SOS's shutdown procedure will
properly finish.

Tracked-On: #3564
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
2019-10-24 13:20:53 +08:00
Wei Liu 1c7bf9fd56 acrn-config: refine the vbootloader of vm
Refine the vbootloader type of vm,
The vbootloader type should be select from vsbl/ovmf/none in webUI item.

Tracked-On: #3879
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 11:42:27 +08:00
Wei Liu a71623595e acrn-config: add '--windows' option for WaaG vm
Add the '--windows' option to launch WaaG vm.

Tracked-On: #3880
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-24 11:40:17 +08:00
Wei Liu 009d835bba acrn-config: modify board info of block device info
As the blkid info contains 'UUID' information, which easy to lead to
confuse with the vm 'UUID'. So refine the format for block device.

v1-v2:
    1). align the style in BLOCK_DEVICE_INFO tag
    2). add 'mmcblk1p3' in BLOCK_DEVICE_INFO tag

v2-v3:
    1). correct the commit message.
    2). refine the api of handle_block_dev

Tracked-On: #3754
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-22 09:30:28 +08:00
Wei Liu 96dede43ad acrn-config: modify ipu/ipu_i2c device launch config of apl-up2
Correct the default settings of ipu/ipu_i2c device for apl-up2.

Tracked-On: #3863
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-22 08:58:04 +08:00
Wei Liu 001c929dd4 acrn-config: correct launch config info for audio/wifi defice of apl-mrb
The audio and Wifi device info in apl-mrb config xmls is wrong, fix it.

Tracked-On: #3863
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-22 08:58:04 +08:00
Wei Liu 2a647fa164 acrn-config: define vm name for Preempt-RT Linux in launch script
The vm name for Preempt-RT Linux is not defined in launch script,
causing Preempt RT linux launch failed.
This patch refine the vm name and define the vm name for Preempt-RT
Linux to fix such kinds of issues.

Tracked-On: #3852
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-22 08:57:47 +08:00
Wei Liu a2430f1313 acrn-config: refine board name with undline_name api
Sometimes character '-' or space need to be converted to '_' to make string format uniformed.
Add this common api to satisfy such requirment and refine the code for board name generating.

Tracked-On: #3852
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-22 08:57:47 +08:00
Wei Liu 95b9ba36b0 acrn-config: acrn-config: add white list to skip item check
Some acrn-dm arguments are not needed when launch some vm, but the
item check fucntion still has strict check on the arguments, which
result in the script generating failure.
This patch add whilte list to skip the check.

Tracked-On: #3852
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-22 08:57:47 +08:00
Yonghua Huang fc40ee4c83 vm-manager: fix improper return value check for "strtol()"
The return value of 'strtol()' is not checked properly
 in _get_vmname_pid() @acrn_vm_ops.c and parse_opt()@acnrd.c,
 the return type of 'strtol' is 'long int', but it is assigned
 to a variable with type of 'int' and compared to "LONG_MAX"
 and "LONG_MIN", which is always false.

 This patch is to fix above error case.

Tracked-On: #3859
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
2019-10-22 08:57:03 +08:00
Wei Liu 96b4a6dbff acrn-config: add 'boot_audio_option' while auido/audio_codec set
Fixed the issue that parameter of 'boot_audio_option' is lost when
audio/auido codec device is configured.

Tracked-On: #3853
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-21 16:49:35 +08:00
Wei Liu 1326eec4eb acrn-config: refine the tools for audio/audio_codec
There are 2 scenarios to pass through audio/audio_codec:
1. Only pass through audio device to vm.
2. Pass through audio and audio codec device to vm.
The improvement is to generate proper boot audio option for each
scenario.

Tracked-On: #3853
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-21 16:49:35 +08:00
Wei Liu 950e3aa224 acrn-config: refine parameters for media_pt function
some parameters for media_pt function are not needed any more,
remove these redundant parameters.

Tracked-On: #3853
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-21 16:49:35 +08:00
Wei Liu 73ac285ec3 acrn-config: add 'run_container' back to the launch script
'run_container' starts to run the container which contains the
clearlinux rootfs. store it in the same launch script with clearlinux.

Tracked-On: #3811
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-18 15:35:10 +08:00
Wei Liu 55e4f0aff9 acrn-config: remove '-V' option from launch config
Remove '-V' option of launch type while generating launch script.

Tracked-On: #3811
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-18 15:35:10 +08:00
Wei Liu aee3bc3622 acrn-config: enable item check for launch config tool
1. enable item check for acrn-dm args which set from webUI input.
2. remove 'cpu_num' tag from launch config xml.

v1-v2:
    1). add method to check 'cpu_num'/'mem_size' in config xml.

v2-v3:
    1). as 'vcpu_num' configured in scenario, the parameter for acrn-dm is no
longer needed, remove 'cpu_num' tag and its handler from launch config.
    2). add 'poweroff_channel' tag for generic config.

Tracked-On: #3811
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-18 15:35:10 +08:00
Victor Sun c74a197c24 acrn-config: modify SOS i915 plane setting for hybird xmls
Change i915.domain_plane_owners and i915.avail_planes_per_pipe for
hybrid scenario;because kvm based User vm will use PipeA.

Tracked-On: #3840
Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-10-16 21:14:13 +08:00
Shuang Zheng afb3608b81 acrn-config: add confirmation for commit of generated source in config app
add a confirmation interface to let user to commit changes into local tree
or not commit after generated source codes in config app.

Tracked-On: #3834
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2019-10-16 15:37:30 +08:00
Wei Liu 8eaee3b09b acrn-config: add "enable_commit" parameter for config tool
Config tool will generate files for board/scenaro/launch, some files are
part of souce code for specify board. Git add/commit these files should
be one optional of user experience. Add "--enable_commit" parameter to
enable git add/commit.

usage:
--enable_commit: flag of whether to do git commit the config file changes
to current git branch. Do commit with this flag and not do without the flag.

Tracked-On: #3834
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-16 15:37:30 +08:00
xiaojin2 780a53a175 tools: acrn-crashlog: refine crash complete code
This patch is to remove unused info in server.c

Tracked-On: #3787
Signed-off-by: xiaojin2 <xiaojing.liu@intel.com>
Reviewed-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: CHEN Gang <gang.c.chen@intel.com>
2019-10-16 10:41:46 +08:00
Wei Liu 89f53a409a acrn-config: supply optional passthrough device for vm
To match launch config xml, supply more optional passthrough device to
vm.

Tracked-On: #3812
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
2019-10-16 10:24:23 +08:00
Shuang Zheng 44c11ce6c4 acrn-config: fix the issue some select boxes disappear after edited
fix the issue: some select boxes disappear unexpectly after edited

Tracked-On: #3809
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2019-10-15 13:18:20 +08:00
Shuang Zheng 62ed91d303 acrn-config: update vcpu affinity in web UI
According to the new vcpu affinity configuration method, update vcpu
configuration in Web UI from multi-select box to seperated select box
which can dynamically add or delete vcpus with mapped pcpus.

Tracked-On: #3798
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2019-10-12 16:22:27 +08:00
Wei Liu c442f3f4d1 acrn-config: keep align with vcpu_affinity for vm config
The pcpu sharing for vm already enabled in master branch, acrn-config
tool for generating scenario config souce file should keep align with master branch.

1. Add 'vcpu_affinity' tag and its vaule in config xml.
2. Parse the 'vcpu_affinity' tag of value from config xml for generating vcpu_affinity.

v1-v2:
    1). apl-up2-n3350 has two PCPUs, set appropriate value for vcpu_affinity.

Tracked-On: #3798
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-12 16:22:27 +08:00
Wei Liu db909edda5 acrn-config: refine the data type for member of class
Unify the data type for scenario item.

1. Unified the scenario item, the type modified from list to dictionary.
2. remove some unused function.
3. add 'pci_dev_num'/'pci_devs' to hybrid xml for future support.

Tracked-On: #3798
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-12 16:22:27 +08:00
Wei Liu ee66a94ccf acrn-config: grab Processor CPU number from board information
The value of CONFIG_MAX_PCPU_NUM is stands for Processor CPU number and
it is grabed from board information.

Tracked-On: #3798
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-12 16:22:27 +08:00
Wei Liu bb1a8eea40 acrn-config: fix pci sub class name contain "-" and ' '
Current python code could handle pci sub class name contain "-" as
expected, but some space characters may still exist. This patch support
to parse similar strings which contain "-" and ' ' for pci sub class name.

Also, add the index number as suffix for the similar strings

Tracked-On: #3788
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-10-10 09:35:43 +08:00
fuyanX df5ef925bf Misc: life_mngr clear compile warning
As Makefile's strict check, clear compile warnings for life_mngr.

Tracked-On: #3564
Signed-off-by: fuyanX <yanx.fu@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
2019-10-08 11:39:22 +08:00
fuyanX 91366b876c Misc: lifemngr add Makefile
Add Makefile for life_mngr. life_mngr is a service on UOS.

Tracked-On: #3564
Signed-off-by: fuyanX <yanx.fu@intel.com>
Reviewed-by: VanCutsem, Geoffroy <geoffroy.vancutsem@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
2019-10-08 11:39:22 +08:00
Victor Sun 0906b25ca2 Makefile: build default acrn.efi with nuc6cayh
To be back compatible, the default acrn.efi should be built when
BOARD param is nuc6cayh, because apl-nuc was overridden to nuc6cayh
in acrn-hypervisor/Makefile;

Tracked-On: #3602

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-09-29 15:09:38 +08:00
Shuang Zheng 4f9c2f3a7a acrn-config: fix the issue config app failed to generate patch for a new board
fix the issue: WebUI could not generate configuration patch for a new imported board

Tracked-On: #3760
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2019-09-27 16:36:13 +08:00
Shuang Zheng bdf3a89e6d acrn-config: change source file format to unix
The file format of 2 source files is dos format with line endings
as CRLF, change to unix format with line endings as LF.

Tracked-On: #3760
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
2019-09-27 16:36:13 +08:00
Wei Liu 9ddcb3dde8 acrn-config: remove ethernet device from pass through config
align with sample launch script for Preempt-RT Linux, remove ethernet
device from config file.

v1-v2:
    1). correct desc for ethernet device

Tracked-On: #3751
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-09-27 15:12:14 +08:00
Victor Sun 9c46354311 acrn-config: remove hvlog support for generic board
hvlog is for debug purpose and its address is board specific,
so remove the param in sos cmdline.

If user want to support hvlog in his own board, then he can add
the param in sos cmdline manually.

Tracked-On: #3602

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-09-23 20:57:33 +08:00
Victor Sun 79d6dc1fa7 acrn-config: add apl-up2-n3350 config xmls
ATOM-N3350 only has two cores, so we only support SDC and
logical_partition scenario.

Tracked-On: #3602

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-09-23 20:57:33 +08:00
Victor Sun 25544e31b7 acrn-config: update board xml of apl-up2
Change default apl-up2 CPU support from ATOM-N3350 to ATOM-N4200.
For apl-up2 N3350 support, we will add another apl-up2-n3350 board xml.

Tracked-On: #3602

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-09-23 20:57:33 +08:00
Wei Liu 172d5ee6e5 acrn-config: update README for acrn-config
align the usage of acrn-config tool and their README

Tracked-On: #3602
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-09-23 20:55:09 +08:00
Wei Liu d35ca113d9 acrn-config: reserve 16M memory for hv start
Need to reserved 16M for HV debug usage like sbuf/ramoops before HV RAM START
to avoid possible conflict with HV memory.

Tracked-On: #3602
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-09-23 20:55:09 +08:00
Wei Liu 6d7592b7cb acrn-config: fix parameter error in launch script
1. fix duplicated '-s 1:0,lpc'
2. fix extra '-l'
3. fix wrong uuid parameter

v1-v2:
    1). remove ethernet pass through to keep align with sample script

Tracked-On: #3602
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-09-23 20:55:09 +08:00
Victor Sun 5d7d7cf910 acrn-config: add launch sample xmls for acrn-config
add launch sample xmls for acrn-config to generate launch scripts.

launch script will generated by acrn-config/launch_config tool,
acrn-config/launch_config need launch config xml as input.

Tracked-On: #3602
Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2019-09-20 14:39:48 +08:00
Wei Liu 86e73a4610 acrn-config: generate launch script file and apply to the souce file
1. generate launch script file and apply to the source file

usage: launch_cfg_gen.py [h]--board <board_info_file> --scenario <scenario_info_file>
		--launch <launch_info_file> --uosid <uosid id>
board_info_file :  file name of the board info
scenario_info_file :  file name of the scenario info
launch_info_file :  file name of the launch info
uosid :  the uos id which to launch:[0..max uos id]

sample:
    $ python3 launch_cfg_gen.py --board ../xmls/board-xmls/apl-mrb.xml
      --scenario ../xmls/config-xmls/apl-mrb/sdc.xml
      --launch ../xmls/launch_config/mrb_launch.xml --uosid 0

v1-v2:
    1). usage: '--vm' -> '--uosid'
    2). add 'uuid' option for acrn-dm
    3). support parse tag from 'rootfs' to 'rootfs_dev'
    4). support parse tag from 'hard_rtos' to 'Preempt-Rt Linux'
    5). support pasre tag from 'redirect_console' to 'console_type'
    6). add 'nvme' passthrough option
    7). modify uos_type to upper string in webUI
    8). support to generate launch file by uosid, this map to scenario
id

Tracked-On: #3602
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2019-09-20 14:39:48 +08:00
Wei Liu 911be1d3b6 acrn-config: modify rootfs tag in board information
1. grap 'ext4' rootfs, and store it as "BLOCK_DEVICE_INFO" tag
2. remove 'Tab' from app tools
3. add support to parse ' ' from scenario xml

v1-v2:
    1). modify the board info "ROOT_DEVICE_INFO" -> "BLOCK_DEVICE_INFO"

Tracked-On: #3602
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2019-09-20 14:39:48 +08:00
Andy ad9e61b23c Fix the last problem: check_name function, print info error
Tracked-On:#3675
Signed-off-by: Andy andyx.liu@intel.com
2019-09-19 08:44:45 +08:00
Victor Sun 0b65b8f05c Makefile: override .config with specified scenario
1. if SCENARIO=$(SCENARIO) is specified in make param, then override
the default CONFIG_$(SCENARIO) value in existed .config. This means
we don't need to modify the default SCENARIO config in Kconfig file
to build the hypervisor;

2. Some board name shortcuts like apl-nuc/kbl-nuc-i7 need to be converted
to official board name to make sure overrides working;

3. Previously make sbl-hypervisor did not load the defconfig so the
defconfig for boards are lost, this patch fix this issue;

4. remove SCENARIO param when make hypervisor, because SCENARIO could
be got from SCENARIO_NAME which parsed from .config;

Tracked-On: #3593

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-18 11:48:31 +08:00
Victor Sun e316e2c027 acrn-config: add memmap param for hvlog in xmls
Reserve memory for hv sbuf to avoid its possible overwriting on kernel memory,
need to update the kernel param in corresponding config-xmls;

Tracked-On: #3602

Signed-off-by: Victor Sun <victor.sun@intel.com>
2019-09-17 09:12:03 +08:00
fuyanX 2ea2716cd9 Misc: lifemngr-daemon-on-UOS
For cross-VM S5 notify via vUART, life_mngr service is running on UOS.
It is listening on /dev/ttyS1 to get SOS's commands.
The protocol is: SOS send "shutdown", UOS feedback "acked".

When SOS triggle shutdown, SOS can 1) check VM's status until UOS
stopped, 2) retry shutdown UOS normally with timeout.
So, no matter life_mngr server is running, SOS's shutdown procedure will
properly finish.

Tracked-On: #3564
Signed-off-by: fuyanX <yanx.fu@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
2019-09-16 09:39:54 +08:00
Wei Liu da416be6bc acrn-config: add xmls for acrn-config tools
1. add $(board) xmls which generate by acrn-config/target
acrn-config/target/board_parser.py will generate native board
information and store to $(board).xml

then, acrn-config/board_config/board_cfg_gen.py will use the xml to
generate hypervisor/arch/x86/configs/$(board)/ source file and apply to
the local acrn-hypervisor

2. add $(scenario) xmls for acrn-config/scenario_config to config scenario
acrn-config/scenario_config/scenario_cfg_gen.py will parse scenario xmls and
generate hypervisor/scenarios/$(scenario) source file and apply to the
local acrn-hypervisor

Tracked-On: #3602
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2019-09-16 09:34:37 +08:00
Wei Liu 28d1b909e6 acrn-config: generate a scenario patch and apply to acrn-hypervisor
1.the script will parse the the board information which already
generated, $(scenario).xml modified by user, generate scenario
vm configuration and apply to the acrn-hypervisor source code base.

2.parse cpu/memory/ttys/rootfs information from native os and store it to
the source code

3.implemnt scenario_config and it's usage

usage: scenario_cfg_gen.py --board <board_info_file> -scenario <scenario_info_file>
board_info_file :  file name of the board info
scenario_info_file :  file name of the scenario info

sample:
	$ python3 scenario_cfg_gen.py --board ../board-xmls/apl-mrb.xml
--scenario ../config-xmls/scenarios/sdc.xml

Also improvement board config generate usage:
sample:
	$ python3 board_cfg_gen.py --board ../board-xmls/apl-mrb.xml
--scenario ../config-xmls/scenarios/sdc.xml

V1-V2:
    1). parse board_setting.xml was removed as these configuration will be
stitch into scenario configuration
    2). parse console for different formats
    3). parse epc sections
    4). add logical partition rootfs
    5). support to parse clos, while webui set to None type
    6). support to parse bootargs, while webui set to nul
    7). convert '-' to '_' for pci sub class name while generating source file

Tracked-On: #3602
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2019-09-16 09:34:37 +08:00
Wei Liu b73f97aaba acrn-config: enhance the target config
1. add misc.py to get systemd ram and root device
2. add more specify comments for arguments of functions

v1-v2:
    typo: Parser -> Parse
    some grammar check

v2-v3:
    add the message for Cx state

Tracked-On: #3602
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-09-16 09:34:37 +08:00
Shuang Zheng 00da5a994e acrn-config: web UI app for acrn-config tool
The web UI application for ACRN VM configuration tool based on Flask web framework:
1. import board info xml which is generated by acrn-config/target on target boards; or select one
board from the imported list of UI.
2. load scenario settings or import scenario settings from local.
3. edit scenario settings from web UI.
4. export and save the edited scenario setting, the application will prompt error messages from UI
if there are illegal configured items.
5. generate board source code, generate scenario source code.
6. load launch settings or import launch settings from local.
7. edit launch settings from web UI.
8. export and save the edited launch setting; the application will prompt error messages from UI
if there are illegal configurable items
9. generate launch scripts based on current launch setting.

Tracked-On: #3602
Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
2019-09-11 13:43:35 +08:00
deb-intel 19e9c4ca9e
Merge pull request #3613 from gvancuts/acrnctl-force-arg
doc: add "-f/--force' optional arg to 'acrnctl' documentation
2019-09-09 19:55:30 -04:00
Tw 1547a4cb27 efi-stub: fix stack memory free issue
Because of this commit:

    commit 63e258bd01
    Author: Tianhua Sun <tianhuax.s.sun@intel.com>
    Date:   Wed Jul 17 14:33:47 2019 +0800

	efi-stub: update string operation in efi-stub

	Remove unsafe API in efi-stub
	1, use Strnlen instead of StrLen except the parameter
	   is a static string.
	2, strlen() only work on static strings.

	Tracked-On: #3276
	Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
	Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>

In the default case, bootloader_name will be point to a separate ro
section which hold the constant string, free this memory later will
cause undefined behavior (memory corruption, exception and so on).

Tracked-On: #3644
Signed-off-by: Tw <wei.tan@intel.com>
Reviewed-by: Jack Ren <jack.ren@intel.com>
2019-09-05 16:32:06 +08:00
Yin Fengwei adf3a59302 Makefile: Refine Makefile to generate both industry and sdc images
We are trying to add both industry and sdc images to CL build. To
maintain the build interface unchanged (no change from CL side), we
extend the build command to generate the different target images.

To identity different images, we use rule:
   $(HV_FILE).$(BOARD).$(FIRMWARE).$(SCENARIO)
as target image file name.

Tracked-On: #3593
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
2019-09-02 19:25:31 +08:00
Geoffroy Van Cutsem cc1dd6da86 doc: add "-f/--force' optional arg to 'acrnctl' documentation
Add the new and optional "-f/--force" flag to the 'acrnctl'
documentation.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-08-28 12:54:37 +02:00
fuyanX 83e887dbb3 memmap:reserve phys-addr for hvlog
acrn.conf:add memmap phys-addr 2M for hvlog,
not mapped by kernel.

Tracked-On: projectacrn/acrn-hypervisor#3533
Signed-off-by: YanX Fu <yanx.fu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
2019-08-05 18:27:38 +08:00
Wei Liu 18b4e3023a acrn-config: add README for scenario_config and launch_config
currently scenario config and launch config is not ready, leave these
two folders for futrue useage and make folder structure clear.

Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Shuang Zheng shuang.zheng@intel.com
Acked-by: Terry Zou <terry.zou@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-07-30 16:38:23 +08:00
Wei Liu a03b134190 acrn-config: generate a patch and apply to acrn-hypervisor
the script will parser the the board information which already generated on
target board, and apply to the acrn-hypervisor as a patch.

usage: board_cfg_gen.py --board <board_info_file>

sample:
	$ python3 board_cfg_gen.py --board ../target_board/board_info.xml

v1-v2:
1. allow to generate new board patch

v2-v3:
1. modify the description of generator tools
2. parser board_name.xml file
3. coding as PEP8 guildline

Tracked-On: #3480
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Shuang Zheng shuang.zheng@intel.com
Acked-by: Terry Zou <terry.zou@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-07-30 16:38:23 +08:00
Wei Liu 8adefe26ac acrn-config: generate board information on target board
These tools run on the target board and genearate board information.

usage: python3 board_parser.py <board_name> [--out board_info_file]

sample:
	$ sudo python3 board_parser.py apl-up2

v1-v2:
1. allow board parameter for new board

v2-v3:
1. add the usage descriptions for tools
2. add description of kernel cmd line for README
3. output informations to a xml type
4. coding as PEP8 guildline

Tracked-On: #3480
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Reviewed-by: Shuang Zheng shuang.zheng@intel.com
Acked-by: Terry Zou <terry.zou@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
2019-07-30 16:38:23 +08:00
yuhong.tao@intel.com 8b27daa778 tools: acrnctl add '--force' option to 'stop' cmd
Run 'acrnctl stop VM_NAME --force‘ to force stop VM

When run 'acrnctl stop VM_NAME', acrn-dm let guest OS to shutdown
itself. If something wrong with guest OS, it can't shutdown, we can
run 'acrnctl stop VM_NAME --force', thus acrn-dm directly set suspend
mode to VM_SUSPEND_POWEROFF and quit main loop.

Tracked-On: #3484
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
2019-07-30 13:27:16 +08:00
yuhong.tao@intel.com 59fd4202d3 tools: add force parameter to acrn VM stop operations
Add 'force' parameter to acrn_stop(), which will be write to request
message, the value of data.acrnd_stop.force. So we can tell DM to
force stop VM, instead of telling UOS to shutdown itself.

Tracked-On: #3484
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
2019-07-30 13:27:16 +08:00
Terry Zou a9c38a5cfb HV:Acrn-hypvervisor Root Directory Clean-up and create misc/ folder for Acrn daemons, services and tools.
This patch is to clean-up acrn-hypervisor root directory, targt only 5 folders under acrn-hypervisor:1.hypervisor,2.devicemodel,3.misc,4.doc,5.build

Tracked-On: #3482
Signed-off-by: Terry Zou <terry.zou@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2019-07-29 22:58:24 +08:00
Alek Du 2a656812df misc: totally remove misc folder
misc now has a new home: https://github.com/intel/ioc-cbc-tools.

The "Execstop" patch will be synced to new git tree soon.

ioc-cbc-tools was just added to Clear Linux, and will be added to
software-defined-cockpit bundle after this patch merged.

Merging this patch may cause some IOC releated feature block until we
get a new Clear Linux release. This is the switch window ...

Signed-off-by: Alek Du <alek.du@intel.com>
2018-08-10 10:40:49 +08:00
Tan Yew Wayne 8af90e0154 misc: Remove unnecessary ExecStop in systemd services
From systemd documentation: https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStop=
> If this option is not specified, the process is terminated by sending the signal specified in KillSignal= when service stop is requested.

https://www.freedesktop.org/software/systemd/man/systemd.kill.html#KillSignal=
> Defaults to SIGTERM.

Signed-off-by: Tan Yew Wayne <yew.wayne.tan@intel.com>
2018-08-09 08:58:12 +08:00
yuhong.tao@intel.com 9695d3bd15 tools: replace payload[0] of struct mngr_msg with an union
acrn-manager message structure has a flexible member
payload[0], that risks to out-of-boundary memory access,
and usage of uninitialized variable.
And the req/ack message pairs has various types, which
extend mngr_msg. mngr_send_msg() requires programmer cast
the type of input messages to struct mngr_msg, that is
inconvenient.
We replace payload[0] with an union, which contains all
payload data. So that type cast for mngr_send_msg() is no
longer needed. And we can avoid potential out-of-boundary
memory accessing and using of uninitialized variable

Acked-by: Yan Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-07-19 11:08:18 +08:00
Alek Du 4eae78cb71 cbc: fix the install issue when do make misc-install only
The install -D is misleading people since it only creates the leading
directories.

The problem was hidden due to we always call make install and the
destination folder was already created in previous install script.

Signed-off-by: Alek Du <alek.du@intel.com>
2018-07-03 15:32:11 +08:00
Yuan Liu 21b9ba8a84 misc: disable cbc_lifecycle service always restart by systemd
Due to cbc_lifecycle service already has its own retry mechanism,so change the
Restart type to "no".

This change is also indirectly avoid cbc_lifecycle always restart for the
non-IOC boards. Actually, there has one defect for current IOC CBC architecture
due to lack IOC hardware detection mechanism. The related guys are already aware
it and WIP.

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Alex Du <alek.du@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
2018-07-02 15:25:12 +08:00
Yuan Liu 7791934cc4 misc: fix cbc_attach blocks APL NUC boot for 20 seconds
This patch resolved systemd be blocking for 20 seconds due to waiting the
"READY=1" from cbc_attach. And cbc_attach will retry 60 sec at the worst case
which can be reproduced on non-IOC boards.

This is one temporary solution. The final solution need modify SBL to export IOC
ACPI device through ACPI table, and also Linux IOC CBC driver need trigger
uevent which should be the trigger of launching cbc_attach service.

This patch changes the service type to simple instead of notify due to systemd is
needn't wait cbc related services. And change Restart to no due to cbc_attach
already has retry mechanism.

These changes are also reasonable for the board integrated IOC component.
So they should be keep even the long term final solution implemented.

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Alex Du <alek.du@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
2018-06-29 16:41:50 +08:00
Yuan Liu 5e521e24e2 IOC mediator: Disable hardware flow control by default
This is one workaround patch to resolve read/write failed for /dev/cbc-lifecycle
and /dev/cbc-signals cdev nodes. It cause cbc_lifecycle service can't send
heartbeat to IOC firmware, also can't receive any signal data from IOC firmware.

This patch need to be revert once the IOC firmware or CBC driver fixed the root
cause.

The [-f] option means enable hardware flow control by set CRTSCTS attribute for
c_cflag of termios, without [-f] option will unset the attribute.

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Vineetha G Jaya Kumaran <vineetha.g.jaya.kumaran@intel.com>
Reviewed-by: Alex Du <alek.du@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-08 14:29:51 +08:00
Alek Du 5b49529739 cbc_lifecycle: fix a service typo
The service type was set twice and inconsistent.

Signed-off-by: Alek Du <alek.du@intel.com>
2018-06-08 12:07:12 +08:00
Alek Du cbb692d910 add cbc_lifecycle service systemd support
Now cbc_attach service installed by default and thus we can enable
cbc_lifecycle service too.

Signed-off-by: Alek Du <alek.du@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
2018-06-05 10:23:15 +08:00
Geoffroy Van Cutsem c4bd0db1ca cbc_lifecycle: fix building using custom output directory
The 'cbc_lifecycle' component fails to build when using a custom
output directory (e.g.: 'make O=build-test'). This patch fixes
this by replacing a hard-coded path with the variable that points
at the right location where to find its target dependencies.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2018-06-05 10:22:46 +08:00
Vineetha G Jaya Kumaran 8e45c663e4 misc: integrate cbc_attach service
cbc_attach is one SOS service that enable IOC CBC line discipline feature.
It started by systemd by default, and exit if failed to set the line
discipline that means the platform does not support IOC.

Signed-off-by: Vineetha G Jaya Kumaran <vineetha.g.jaya.kumaran@intel.com>
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Reviewed-by: Vineetha G Jaya Kumaran <vineetha.g.jaya.kumaran@intel.com>
Reviewed-by: Key Seong Lim <key.seong.lim@intel.com>
Reviewed-by: Alex Du <alek.du@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-01 10:22:52 +08:00
Yu Wang d04b1419b2 misc: Add Makefile for misc directory
This patch adds build architecture for misc directory and support cbc_lifecycle
build.

Signed-off-by: Yu Wang <yu1.wang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-01 10:22:52 +08:00
Alek Du c6d8e7fd73 ioc: add cbc_lifecycle service
The cbc_lifecycle service will listen on /dev/cbc-lifecycle tty port to
receive "wakeup reason" information from ioc controller as well as send
heartbeat to ioc to set different power cycle method.

The RTC funtionality is not implemented by current ioc firmware yet,
hence the service leaves it as an empty handler now.

Signed-off-by: Alek Du <alek.du@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
2018-05-31 16:09:05 +08:00