==============================================================================
      HOW TO BUILD AND LOAD THE SEP KERNEL DRIVER UNDER MPSS 2.x and 3.x (LINUX uOS)
==============================================================================

updated: 9/17/2014

This document describes the required software environment needed in order
to build and load the SEP kernel driver on the MPSS2.x snd MPSS3.x stack

Use this information to build and load the driver in case that the MPSS kernel
on your system is not one of the supported kernels listed in the Release Notes.

For supported MPSS kernel versions, pre-built drivers are provided. You can
directly go to 2) and 3) in the step 3 or 4 below.


1.  Basic Development Environment

    1) The system is installed with MPSS SW stack

    2) Include k1om build enviorment in your path:
       target = k1om
       PATH=/usr/linux-<target>-4.7/bin:$PATH
       In build script, it is set by default for k1om for KNC.

    3) Set kernel development environment
        KERNEL_SRC_DIR = kernel_development_evnironment
        For example:
              export KERNEL_SRC_DIR=<mpss_kernel_src_dir>/linux-2.6.38+mpss3.1.1
        In the build script, by default,  it is set as:
            KERNEL_SRC_DIR = /tmp/MPSS/mic_linux
            and /tmp/MPSS/mic_linux is a symbol link to the kernel build enviornment.
    4) Set kernel version
         KERNEL_VERSION can be got from 
                "cat ${KERNEL_SRC_DIR}/include/config/kernel.release"
             or 
                "sudo ssh mic0 "uname -r"
         In the build script, KERNEL_VERSION is set by default.

2.  Build driver
    Once the standard development tools and proper kernel development
    environment are installed, you can build and load the driver:

    1) build the driver:
       cd <mic_sepdk_dir>
       $ make clean
       
       For build with default setting: /tmp/MPSS/mic_linux is linked to the
       kernel build environment.
       $ ./build_mic_driver.sh        
     
       Or for build with specific KERNEL_SRC_DIR 
         ./build_mic_driver.sh  k1om  $KERNEL_SRC_DIR

       New kernel module will be careated as:
                 "sep3_<version>-k1om-<kernel_version>.ko"

3.  Install/Re-install SEP driver and service
    Please note, loading/unloading the SEP driver in MIC will cause 
    the SEP_service on the MIC card to stop. 
    1) Replace the sep kernel module in the installation package.
       $cp  <mic_sepdk_dir>/sep3_<version>-k1om-<kernel_version>.ko>   \
           <sep_install)i_dir>/bin/k1om
    2) uninstall the old driver if needed
       $cd <sep_install_dir>/bin/k1om
       uninstall driver from boot start
          $sudo ./sep_micboot_uninstall.sh   
          $sudo service mpss stop
    3) Restart the service:
       $cd <sep_install_dir>/bin/k1om
       install driver for boot start
          $sudo ./sep_micboot_install.sh  
       load driver 
          $sudo service mpss start

    With this approach, the new SEP driver will be loaded automatically every time 
    when mpss restart.
   
4.  Alternative: reload/unload the driver only
    You can manually unload/reload SEP driver and service.
    Please note, loading/unloading the SEP driver in MIC will cause the SEP_service 
    on the MIC card to stop. 
    1) Replace the sep kernel module in the installation package.
       $ cp  <mic_sepdk_dir>/sep3_<version>-k1om-<kernel_version>.ko> \
             <sep_install)i_dir>/bin/k1om
    2) unload  the old driver if needed
       $ cd <sep_install_dir>/bin/k1om
       $ sudo ./sep_mic_uninstall.sh    
    3) load the driver
       $ cd <path_to_sep_install>/bin/k1om
       $ sudo ./sep_mic_install.sh

    With this approach, the new SEP driver will be loaded to the card without 
    restart mpss service.  But every time start/stop mpss service, the new 
    driver needs to be installed again.

------------------------------------------------------------------------------

Disclaimer and Legal Information

The information in this document is subject to change without notice and
Intel Corporation assumes no responsibility or liability for any errors
or inaccuracies that may appear in this document or any software that
may be provided in association with this document. This document and the
software described in it are furnished under license and may only be
used or copied in accordance with the terms of the license. No license,
express or implied, by estoppel or otherwise, to any intellectual
property rights is granted by this document. The information in this
document is provided in connection with Intel products and should not be
construed as a commitment by Intel Corporation.

EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH
PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY
EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL
PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A
PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT,
COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. Intel products are not
intended for use in medical, life saving, life sustaining, critical
control or safety systems, or in nuclear facility applications.

Designers must not rely on the absence or characteristics of any
features or instructions marked "reserved" or "undefined." Intel
reserves these for future definition and shall have no responsibility
whatsoever for conflicts or incompatibilities arising from future
changes to them.

The software described in this document may contain software defects
which may cause the product to deviate from published specifications.
Current characterized software defects are available on request.

Intel, the Intel logo, Intel SpeedStep, Intel NetBurst, Intel
NetStructure, MMX, Intel386, Intel486, Celeron, Intel Centrino, Intel
Xeon, Intel XScale, Itanium, Pentium, Pentium II Xeon, Pentium III Xeon,
Pentium M, and VTune are trademarks or registered trademarks of Intel
Corporation or its subsidiaries in the United States and other countries.

*Other names and brands may be claimed as the property of others.

Copyright(c) 2008-2012, Intel Corporation.  All Rights Reserved.
