gpmc-lld: add to PDK
authorJacob Stiffler <j-stiffler@ti.com>
Fri, 1 Nov 2019 18:54:46 +0000 (14:54 -0400)
committerJacob Stiffler <j-stiffler@ti.com>
Fri, 1 Nov 2019 18:54:46 +0000 (14:54 -0400)
Development of gpmc-lld has been relocated here from:
* Repo: https://git.ti.com/keystone-rtos/gpmc-lld
* Branch: master
* Commit ID: 9169c04d80fae0a50734527e54ec4f4f53c3a1ef

Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
49 files changed:
packages/ti/drv/gpmc/.gitignore [new file with mode: 0644]
packages/ti/drv/gpmc/GPMC.h [new file with mode: 0755]
packages/ti/drv/gpmc/GPMCver.h.xdt [new file with mode: 0644]
packages/ti/drv/gpmc/Settings.xdc.xdt [new file with mode: 0755]
packages/ti/drv/gpmc/build/buildlib.xs [new file with mode: 0755]
packages/ti/drv/gpmc/build/makefile.mk [new file with mode: 0755]
packages/ti/drv/gpmc/build/makefile_indp.mk [new file with mode: 0755]
packages/ti/drv/gpmc/build/makefile_profile.mk [new file with mode: 0755]
packages/ti/drv/gpmc/build/makefile_profile_indp.mk [new file with mode: 0755]
packages/ti/drv/gpmc/config.bld [new file with mode: 0755]
packages/ti/drv/gpmc/config_mk.bld [new file with mode: 0755]
packages/ti/drv/gpmc/docs/Doxyfile [new file with mode: 0644]
packages/ti/drv/gpmc/docs/GPMC_LLD_SoftwareManifest.html [new file with mode: 0644]
packages/ti/drv/gpmc/docs/Module.xs [new file with mode: 0755]
packages/ti/drv/gpmc/docs/ReleaseNotes_GPMC_LLD.doc [new file with mode: 0755]
packages/ti/drv/gpmc/docs/ReleaseNotes_GPMC_LLD.pdf [new file with mode: 0755]
packages/ti/drv/gpmc/docs/doxyfile.xdt [new file with mode: 0644]
packages/ti/drv/gpmc/docs/tifooter.htm [new file with mode: 0644]
packages/ti/drv/gpmc/docs/tiheader.htm [new file with mode: 0644]
packages/ti/drv/gpmc/docs/tilogo.gif [new file with mode: 0644]
packages/ti/drv/gpmc/docs/titagline.gif [new file with mode: 0644]
packages/ti/drv/gpmc/example/Module.xs [new file with mode: 0755]
packages/ti/drv/gpmc/example/am335x/armv7/bios/GPMC_Test_icev2AM335x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/gpmc/example/am437x/armv7/bios/GPMC_Test_evmAM437x_armExampleProject.txt [new file with mode: 0644]
packages/ti/drv/gpmc/example/src/main_gpmc_flash_example.c [new file with mode: 0644]
packages/ti/drv/gpmc/gpmc_component.mk [new file with mode: 0755]
packages/ti/drv/gpmc/makefile [new file with mode: 0755]
packages/ti/drv/gpmc/package.bld [new file with mode: 0755]
packages/ti/drv/gpmc/package.xdc [new file with mode: 0755]
packages/ti/drv/gpmc/package.xs [new file with mode: 0755]
packages/ti/drv/gpmc/soc/GPMC_soc.h [new file with mode: 0755]
packages/ti/drv/gpmc/soc/Module.xs [new file with mode: 0755]
packages/ti/drv/gpmc/soc/am335x/GPMC_soc.c [new file with mode: 0755]
packages/ti/drv/gpmc/soc/am437x/GPMC_soc.c [new file with mode: 0755]
packages/ti/drv/gpmc/src/GPMC_drv.c [new file with mode: 0755]
packages/ti/drv/gpmc/src/GPMC_osal.h [new file with mode: 0644]
packages/ti/drv/gpmc/src/Module.xs [new file with mode: 0755]
packages/ti/drv/gpmc/src/V1/GPMC_v1.c [new file with mode: 0755]
packages/ti/drv/gpmc/src/V1/GPMC_v1.h [new file with mode: 0755]
packages/ti/drv/gpmc/src/src_files_common.mk [new file with mode: 0755]
packages/ti/drv/gpmc/test/Module.xs [new file with mode: 0644]
packages/ti/drv/gpmc/test/am335x/armv7/bios/GPMC_Test_icev2AM335x_armTestProject.txt [new file with mode: 0755]
packages/ti/drv/gpmc/test/am335x/armv7/bios/am335x_app_icev2am335x.cfg [new file with mode: 0755]
packages/ti/drv/gpmc/test/am437x/armv7/bios/GPMC_Test_evmAM437x_armTestProject.txt [new file with mode: 0755]
packages/ti/drv/gpmc/test/am437x/armv7/bios/gpmc_arm_evmam437x.cfg [new file with mode: 0755]
packages/ti/drv/gpmc/test/src/GPMC_board.h [new file with mode: 0755]
packages/ti/drv/gpmc/test/src/GPMC_log.c [new file with mode: 0755]
packages/ti/drv/gpmc/test/src/GPMC_log.h [new file with mode: 0755]
packages/ti/drv/gpmc/test/src/main_gpmc_flash_test.c [new file with mode: 0755]

diff --git a/packages/ti/drv/gpmc/.gitignore b/packages/ti/drv/gpmc/.gitignore
new file mode 100644 (file)
index 0000000..a48920d
--- /dev/null
@@ -0,0 +1,28 @@
+*.swp
+*~
+.dlls
+.executables
+.interfaces
+.libraries
+.xdcenv.mak
+Settings.h
+Settings.xdc
+build/c66/
+build/k2[heklg]/
+build/am57*/
+build/am335x/
+build/am437x/
+build/c66/
+build/m4/
+build/armv7/
+docs/Doxyfile
+docs/doxygen/
+test/*/*/bios/src
+GPMCver.h
+lib/
+package.mak
+package/
+packages/
+*.o
+*.dep
+
diff --git a/packages/ti/drv/gpmc/GPMC.h b/packages/ti/drv/gpmc/GPMC.h
new file mode 100755 (executable)
index 0000000..9282285
--- /dev/null
@@ -0,0 +1,368 @@
+/*
+ * Copyright (c) 2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/** ============================================================================
+ *  @file       GPMC.h
+ *
+ *  @brief      GPMC driver interface
+ *
+ *  The GPMC header file should be included in an application as follows:
+ *  @code
+ *  #include <ti/drv/gpmc/GPMC.h>
+ *  @endcode
+ *
+ *  ============================================================================
+ */
+
+#ifndef GPMC_H
+#define GPMC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <stddef.h>
+
+/*!
+ * Common GPMC_control command code reservation offset.
+ * GPMC driver implementations should offset command codes with GPMC_CMD_RESERVED
+ * growing positively
+ *
+ * Example implementation specific command codes:
+ * @code
+ * #define GPMCXYZ_COMMAND0         GPMC_CMD_RESERVED + 0
+ * #define GPMCXYZ_COMMAND1         GPMC_CMD_RESERVED + 1
+ * @endcode
+ */
+#define GPMC_CMD_RESERVED            (32U)
+
+/*!
+ * Common GPMC_control status code reservation offset.
+ * GPMC driver implementations should offset status codes with
+ * GPMC_STATUS_RESERVED growing negatively.
+ *
+ * Example implementation specific status codes:
+ * @code
+ * #define GPMCXYZ_STATUS_ERROR0    GPMC_STATUS_RESERVED - 0
+ * #define GPMCXYZ_STATUS_ERROR1    GPMC_STATUS_RESERVED - 1
+ * #define GPMCXYZ_STATUS_ERROR2    GPMC_STATUS_RESERVED - 2
+ * @endcode
+ */
+#define GPMC_STATUS_RESERVED        (-(32U))
+
+/*!
+ * \brief   Successful status code returned by GPMC_control().
+ *
+ * GPMC_control() returns GPMC_STATUS_SUCCESS if the control code was executed
+ * successfully.
+ */
+#define GPMC_STATUS_SUCCESS         (0U)
+
+/*!
+ * \brief   Generic error status code returned by GPMC_control().
+ *
+ * GPMC_control() returns GPMC_STATUS_ERROR if the control code was not executed
+ * successfully.
+ */
+#define GPMC_STATUS_ERROR          (-(1U))
+
+/*!
+ * \brief   An error status code returned by GPMC_control() for undefined
+ * command codes.
+ *
+ * GPMC_control() returns GPMC_STATUS_UNDEFINEDCMD if the control code is not
+ * recognized by the driver implementation.
+ */
+#define GPMC_STATUS_UNDEFINEDCMD   (-(2U))
+
+/*!
+ *  @brief    Wait forever define
+ */
+#define GPMC_WAIT_FOREVER (~(0U))
+
+/*!
+ *  @brief    Maximum GPMC config count
+ */
+#define GPMC_MAX_CONFIG_CNT        (2U)
+/*!
+ *  @brief      A handle that is returned from a GPMC_open() call.
+ */
+typedef struct GPMC_Config_s      *GPMC_Handle;
+
+/*!
+ *  @brief      Type of the GPMC transaction.
+ */
+typedef enum GPMC_TransactionType_e {
+    GPMC_TRANSACTION_TYPE_READ = 0,  /*!< Read transaction */
+    GPMC_TRANSACTION_TYPE_WRITE      /*!< Write transaction */
+} GPMC_TransactionType;
+
+/*!
+ *  @brief      Status codes that are set by the GPMC driver.
+ */
+typedef enum GPMC_TransactionStatus_s {
+    GPMC_TRANSFER_COMPLETED = 0,
+    GPMC_TRANSFER_STARTED,
+    GPMC_TRANSFER_CANCELED,
+    GPMC_TRANSFER_FAILED,
+    GPMC_TRANSFER_CSN_DEASSERT
+
+} GPMC_TransactionStatus;
+
+/*!
+ *  @brief
+ *  A ::GPMC_Transaction data structure is used with GPMC_transfer().
+ */
+typedef struct GPMC_Transaction_s {
+    /* User input (write-only) fields */
+       GPMC_TransactionType   transType; /*!< transaction type */
+    uint32_t               offset;    /*!< offset address of the memory device */
+    uint32_t               count;     /*!< Number of bytes for this transaction */
+    void                  *txBuf;     /*!< void * to a buffer with data to be transmitted */
+    void                  *rxBuf;     /*!< void * to a buffer to receive data */
+    void                  *arg;       /*!< Argument to be passed to the callback function */
+
+    /* User output (read-only) fields */
+    GPMC_TransactionStatus status;     /*!< Status code set by GPMC_transfer */
+
+} GPMC_Transaction;
+
+/*!
+ *  @brief      The definition of a callback function used by the GPMC driver
+ *              when used in ::GPMC_MODE_CALLBACK
+ *
+ *  @param      GPMC_Handle          GPMC_Handle
+ *  @param      GPMC_Transaction*    GPMC_Transaction*
+ */
+typedef void (*GPMC_CallbackFxn)(GPMC_Handle handle,
+                                 GPMC_Transaction * transaction);
+
+/*!
+ *  @brief
+ *
+ *  GPMC transfer mode determines the whether the GPMC controller operates
+ *  synchronously or asynchronously. In ::GPMC_MODE_BLOCKING mode GPMC_transfer()
+ *  blocks code execution until the GPMC transaction has completed. In
+ *  ::GPMC_MODE_CALLBACK GPMC_transfer() does not block code execution and instead
+ *  calls a ::GPMC_CallbackFxn callback function when the transaction has
+ *  completed.
+ */
+typedef enum GPMC_TransferMode_s {
+    /*!
+     * GPMC_transfer() blocks execution. This mode can only be used when called
+     * within a Task context
+     */
+    GPMC_MODE_BLOCKING,
+    /*!
+     * GPMC_transfer() does not block code execution and will call a
+     * ::GPMC_CallbackFxn. This mode can be used in a Task, Swi, or Hwi context.
+     */
+    GPMC_MODE_CALLBACK
+
+} GPMC_TransferMode;
+
+/*!
+ *  @brief GPMC Parameters
+ *
+ *  GPMC Parameters are used to with the GPMC_open() call. Default values for
+ *  these parameters are set using GPMC_Params_init().
+ *
+ *  @sa         GPMC_Params_init()
+ */
+typedef struct GPMC_Params_s {
+    GPMC_TransferMode    transferMode;        /*!< Blocking or Callback mode */
+    uint32_t             transferTimeout;     /*!< Transfer timeout in system
+                                                 ticks (Not supported with all
+                                                 implementations */
+    GPMC_CallbackFxn     transferCallbackFxn; /*!< Callback function pointer */
+
+} GPMC_Params;
+
+/*!
+ *  @brief      A function pointer to a driver specific implementation of
+ *              GPMC_init().
+ */
+typedef void (*GPMC_InitFxn)(GPMC_Handle handle);
+
+/*!
+ *  @brief      A function pointer to a driver specific implementation of
+ *              GPMC_open().
+ */
+typedef GPMC_Handle (*GPMC_OpenFxn)(GPMC_Handle handle,
+                                    const GPMC_Params *params);
+
+/*!
+ *  @brief      A function pointer to a driver specific implementation of
+ *              GPMC_close().
+ */
+typedef void (*GPMC_CloseFxn)(GPMC_Handle handle);
+
+/*!
+ *  @brief      A function pointer to a driver specific implementation of
+ *              GPMC_transfer().
+ */
+typedef bool (*GPMC_TransferFxn)(GPMC_Handle handle,
+                                 GPMC_Transaction *transaction);
+
+/*!
+ *  @brief      A function pointer to a driver specific implementation of
+ *              GPMC_control().
+ */
+typedef int32_t (*GPMC_ControlFxn)(GPMC_Handle handle,
+                                   uint32_t cmd,
+                                   void *arg);
+
+
+/*!
+ *  @brief      The definition of a GPMC function table that contains the
+ *              required set of functions to control a specific GPMC driver
+ *              implementation.
+ */
+typedef struct GPMC_FxnTable_s {
+    /*! Function to initialize the given data object */
+    GPMC_InitFxn             initFxn;
+
+    /*! Function to open the specified peripheral */
+    GPMC_OpenFxn             openFxn;
+
+    /*! Function to close the specified peripheral */
+    GPMC_CloseFxn            closeFxn;
+
+    /*! Function to initiate a GPMC data transfer */
+    GPMC_TransferFxn         transferFxn;
+
+    /*! Function to implementation specific control function */
+    GPMC_ControlFxn          controlFxn;
+
+} GPMC_FxnTable;
+
+/*!
+ *  @brief GPMC Global configuration
+ *
+ *  The GPMC_Config structure contains a set of pointers used to characterize
+ *  the GPMC driver implementation.
+ *
+ *  This structure needs to be defined before calling GPMC_init() and it must
+ *  not be changed thereafter.
+ *
+ *  @sa     GPMC_init()
+ */
+typedef struct GPMC_Config_s {
+    /*! Pointer to a table of driver-specific implementations of GPMC APIs */
+    GPMC_FxnTable const *fxnTablePtr;
+
+    /*! Pointer to a driver specific data object */
+    void                *object;
+
+    /*! Pointer to a driver specific hardware attributes structure */
+    void const          *hwAttrs;
+} GPMC_Config;
+
+
+typedef GPMC_Config GPMC_config_list[GPMC_MAX_CONFIG_CNT];
+
+
+/*!
+ *  @brief  Function to close a GPMC peripheral specified by the GPMC handle
+ *
+ *  @pre    GPMC_open() has to be called first.
+ *
+ *  @param  handle A GPMC handle returned from GPMC_open()
+ *
+ *  @sa     GPMC_open()
+ */
+extern void GPMC_close(GPMC_Handle handle);
+
+
+/*!
+ *  @brief  This function initializes the GPMC module.
+ *
+ *  @pre    The GPMC_config structure must exist and be persistent before this
+ *          function can be called. This function must also be called before
+ *          any other GPMC driver APIs. This function call does not modify any
+ *          peripheral registers.
+ */
+extern void GPMC_init(void);
+
+/*!
+ *  @brief  This function opens a given GPMC peripheral.
+ *
+ *  @pre    GPMC controller has been initialized using GPMC_init()
+ *
+ *  @sa     GPMC_init()
+ *  @sa     GPMC_close()
+ */
+extern GPMC_Handle GPMC_open(uint32_t index, GPMC_Params *params);
+
+/*!
+ *  @brief  Function to initialize the GPMC_Params struct to its defaults
+ *
+ */
+extern void GPMC_Params_init(GPMC_Params *params);
+
+/*!
+ *  @brief  Function to perform GPMC transactions
+ *
+ *  @return true if started successfully; else false
+ *
+ *  @sa     GPMC_open
+ *  @sa     GPMC_transferCancel
+ */
+extern bool GPMC_transfer(GPMC_Handle handle, GPMC_Transaction *transaction);
+
+/*!
+ *  @brief  Function performs implementation specific features on a given
+ *          GPMC_Handle.
+ *
+ *  @pre    GPMC_open() has to be called first.
+ *
+ *  @param  handle      A GPMC handle returned from GPMC_open()
+ *
+ *  @param  cmd         A command value defined by the driver specific
+ *                      implementation
+ *
+ *  @param  arg         An optional R/W (read/write) argument that is
+ *                      accompanied with cmd
+ *
+ *  @return Implementation specific return codes. Negative values indicate
+ *          unsuccessful operations.
+ *
+ *  @sa     GPMC_open()
+ */
+extern int32_t GPMC_control(GPMC_Handle handle, uint32_t cmd, void *arg);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GPMC_H */
diff --git a/packages/ti/drv/gpmc/GPMCver.h.xdt b/packages/ti/drv/gpmc/GPMCver.h.xdt
new file mode 100644 (file)
index 0000000..224095c
--- /dev/null
@@ -0,0 +1,100 @@
+%%{
+/*!
+ *  This template implements the GPMCver.h
+ */
+  /* Versioning */
+  var ver = this;
+  var ver1 = [01,00,00,03];
+  var ver2 = [01,00,00,03];
+
+  for each(i=0;i<ver.length;i++)
+  {
+      if(String(ver[i]).length < 2)
+      {
+        ver1[i]="0"+ver[i];
+      }
+      else
+      {
+        ver1[i] = ver[i];
+      }
+
+      ver2[i] = Number(ver[i]).toString(16).toUpperCase();
+
+      if(String(ver2[i]).length < 2)
+      {
+        ver2[i]="0"+ver2[i];
+      }
+  }
+
+  var versionStr = "\""+"gpmc Driver Revision: "+ver1[0]+"."+ver1[1]+"."+ver1[2]+"."+ver1[3]+"\"";
+  var versionID = "(0x"+ver2[0]+ver2[1]+ver2[2]+ver2[3]+")";
+
+%%}
+#ifndef _GPMCVER_H
+#define _GPMCVER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ============================================================= */
+/**
+ *   @file  GPMCver.h
+ *
+ *   path  ti/drv/gpmc/GPMCver.h
+ *
+ *   @brief  gpmc Driver Version Definitions
+ *
+ *  ============================================================
+ *  Copyright (c) Texas Instruments Incorporated 2016 - 2018
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+/**
+ * @brief   This is the gpmc Driver Version. Versions numbers are encoded in the following
+ * format:
+ *  0xAABBCCDD -> Arch (AA); API Changes (BB); Major (CC); Minor (DD)
+ */
+#define GPMC_DRV_VERSION_ID                     `versionID`
+
+/**
+ * @brief   This is the version string which describes the GPMC driver along with the
+ * date and build information.
+ */
+#define GPMC_DRV_VERSION_STR                    `versionStr`
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif  /* _GPMCVER_H */
diff --git a/packages/ti/drv/gpmc/Settings.xdc.xdt b/packages/ti/drv/gpmc/Settings.xdc.xdt
new file mode 100755 (executable)
index 0000000..5a4185a
--- /dev/null
@@ -0,0 +1,55 @@
+
+%%{
+/*!
+ *  This template implements the Settings.xdc
+ */
+  /* Versioning */
+  var ver = this;
+  for each(i=0;i<ver.length;i++)
+  {
+      if(String(ver[i]).length < 2)
+      {
+        ver[i]="0"+ver[i];
+      }
+  }
+
+  var packageVersion = "\""+ver[0]+"."+ver[1]+"."+ver[2]+"."+ver[3]+"\"";
+
+%%}
+
+module Settings
+{
+    config string gpmcVersionString = `packageVersion`;
+    /*! This variable is to control the SoC type selection.
+     * By default this variable is set to NULL.
+     *
+     * To use LLD for the selected device, add the following lines to config
+     * file and set the deviceType correctly:
+     *
+     *      var gpmcSettings = xdc.useModule ('ti.drv.gpmc.Settings');
+     *      gpmcSettings.socType = "am437x";
+     *
+     */
+    metaonly config string socType = "";
+
+    /*! This flag is used to indicate whether or not the benchmarking code
+     * (defined in the profilingHooks class) will be used in the project.
+     * Note that a separate library has been compiled and will be used
+     * ($NAME).profiling.a($SUFFIX). This is set in the *.cfg file.
+     */
+    config Bool enableProfiling = false;
+
+    /*! This variable is to control the device library type selection.
+     * By default this variable is set to release.
+     * 
+     * To use CSL to use the debug/release library, add the following lines to config
+     * file and set the library profile accordingly:
+     * 
+     *      var GpmcSettings = xdc.useModule ('ti.Gpmc.Settings');
+     *      GpmcSettings.libProfile = "debug";
+     * 
+     */
+    metaonly config string libProfile = "release";     
+
+}
+
diff --git a/packages/ti/drv/gpmc/build/buildlib.xs b/packages/ti/drv/gpmc/build/buildlib.xs
new file mode 100755 (executable)
index 0000000..d7c52b7
--- /dev/null
@@ -0,0 +1,625 @@
+/******************************************************************************
+ * FILE PURPOSE: Build Library Utilities
+ ******************************************************************************
+ * FILE NAME: buildlib.xs
+ *
+ * DESCRIPTION:
+ *  This file contains common routines that are used by the various LLD
+ *  components.
+ *
+ * Copyright (C) 2014-2015, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/**************************************************************************
+ * FUNCTION NAME : listAllFiles
+ **************************************************************************
+ * DESCRIPTION   :
+ *  Utility function which lists all files with a specific extension
+ *  present in a directory and any directory inside it.
+ **************************************************************************/
+function listAllFiles(ext, dir, recurse)
+{
+    var srcFile = [];
+    var d;
+
+    /* If recurse parameter is not specified we default to recursive search. */
+    if (recurse == null)
+        recurse = true;
+
+    if (dir == undefined)
+          d = ".";
+    else
+      d = dir;
+
+    /* Get access to the current directory. */
+    var file = new java.io.File(d);
+
+    /* Check if the file exists and it is a directory. */
+    if (file.exists() && file.isDirectory())
+    {
+        /* Get a list of all files in the specific directory. */
+        var fileList = file.listFiles();
+        for (var i = 0; i < fileList.length; i++)
+        {
+            /* Dont add the generated directory 'package' and any of its files
+             * to the list here. */
+            if (fileList[i].getName().matches("package") == false)
+            {
+                /* Check if the detected file is a directory */
+                if (fileList[i].isDirectory())
+                {
+                    /* We will recurse into the subdirectory only if required to do so. */
+                    if (recurse == true)
+                    {
+                        /* Generate the directory Name in which we will recurse. */
+                        var directoryName = d + "/" + fileList[i].getName();
+
+                        /* Get a list of all files in this directory */
+                        var fileListing = listAllFiles (ext, directoryName, recurse);
+                        if (fileListing != null)
+                        {
+                            /* Return a list of all file names in the directory. */
+                            for (var j = 0 ; j < fileListing.length; j++)
+                                srcFile[srcFile.length++] = fileListing[j];
+                        }
+                    }
+                }
+                else
+                {
+                    /* This was a file. Check if the file name matches the extension */
+                    if (fileList[i].getName().endsWith(ext) == true)
+                        srcFile[srcFile.length++] = d + "/" + fileList[i].getName();
+                }
+            }
+        }
+
+        return srcFile;
+    }
+    return null;
+}
+
+
+function createMake(makefile)
+{
+    /* Create the main make file */
+    var fileModule = xdc.module('xdc.services.io.File');
+    if(makefile==undefined)
+    {
+      try{
+          makefile = fileModule.open("makefile", "w");
+         } catch (ex)
+         {
+           print("makefile cannot be written to. Please check Writing Permissions.");
+           java.lang.System.exit(1);
+         }
+
+      Pkg.makePrologue += "\ninclude makefile\n";
+
+      Pkg.makeEpilogue += "\nclean::\n\t-$(RM)  makefile\n";
+      makefile.writeLine("#*******************************************************************************");
+      makefile.writeLine("#* FILE PURPOSE: Top level makefile for Creating Component Libraries");
+      makefile.writeLine("#*******************************************************************************");
+      makefile.writeLine("#* FILE NAME: makefile");
+      makefile.writeLine("#*");
+      makefile.writeLine("#* DESCRIPTION: Defines Compiler tools paths, libraries , Build Options ");
+      makefile.writeLine("#*");
+      makefile.writeLine("#*");
+      makefile.writeLine("#*******************************************************************************");
+      makefile.writeLine("#*");
+      makefile.writeLine("# (Mandatory) Specify where various tools are installed.");
+
+      var file = xdc.module('xdc.services.io.File');
+
+
+      makefile.writeLine("\n# Output for prebuilt generated libraries");
+      makefile.writeLine("export LIBDIR ?= ./lib");
+      /* use sectti from path */
+      makefile.writeLine("export SECTTI ?= sectti");
+
+      /* Create INCDIR from XDCPATH */
+
+      /* copy the environment array from the current environment */
+      var env   = java.lang.System.getenv();
+      var getxdcpath=String(java.lang.System.getenv("XDCPATH"));
+      getxdcpath= getxdcpath.replace(/\\/g,"/");
+      var keys  = env.keySet().toArray();
+      var key;
+      var stat={};
+      var env_j=[];
+      var listxdcpath = new Array();
+      for (var i = 0; i < keys.length; i++) {
+           key = String(keys[i]);
+           if((key.match("INSTALL_PATH")) || (key.match("INSTALLDIR")))
+           {
+             var keyPath=String(env.get(key));
+             keyPath=keyPath.replace(/\\/g,"/");
+             var file = xdc.module('xdc.services.io.File');
+             keyPath=file.getDOSPath(keyPath);
+             if(getxdcpath.toString().match(keyPath))
+             {
+                 listxdcpath.push({keyname: key,keypath: keyPath});
+                 while(getxdcpath.toString().match(keyPath))
+                 {
+                   getxdcpath=getxdcpath.toString().replace(keyPath,"$("+key+")");
+                 }
+             }
+           }
+
+     }
+       var pkgroot="..";
+       for (var i = Pkg.name.split('.').length; i > 1; i--) {
+              pkgroot+="/..";
+          }
+
+      makefile.writeLine("\n# ROOT Directory");
+      makefile.writeLine("export ROOTDIR := "+pkgroot);
+
+      makefile.writeLine("\n# INCLUDE Directory");
+      makefile.writeLine("export INCDIR := "+getxdcpath+";$(ROOTDIR)");
+
+      makefile.writeLine("\n# Common Macros used in make");
+      makefile.writeLine("\nifndef RM");
+      makefile.writeLine("export RM = rm -f");
+      makefile.writeLine("endif");
+
+      makefile.writeLine("\nifndef CP");
+      makefile.writeLine("export CP = cp -p");
+      makefile.writeLine("endif");
+
+      makefile.writeLine("\nexport MKDIR = mkdir -p");
+
+      makefile.writeLine("\nifndef RMDIR");
+      makefile.writeLine("export RMDIR = rm -rf");
+      makefile.writeLine("endif");
+
+      makefile.writeLine("\nifndef SED");
+      makefile.writeLine("export SED = sed");
+      makefile.writeLine("endif");
+
+      makefile.writeLine("\nifndef MAKE");
+      makefile.writeLine("export MAKE = make");
+      makefile.writeLine("endif");
+
+      makefile.writeLine("\n# PHONY Targets");
+      makefile.writeLine(".PHONY: all clean cleanall ");
+
+      makefile.writeLine("\n# FORCE Targets");
+      makefile.writeLine("FORCE: ");
+
+      makefile.writeLine("\n# all rule");
+      makefile.writeLine("all: .executables");
+      makefile.writeLine(".executables: .libraries");
+      makefile.writeLine(".libraries:");
+
+      makefile.writeLine("\n# Clean Rule");
+      makefile.writeLine("clean:: clean_package");
+      makefile.writeLine("# Clean Top Level Object Directory ");
+      makefile.writeLine("clean_package :\n\t$(RMDIR) $(LIBDIR)/*/");
+      makefile.writeLine("\t$(RMDIR) package/cfg");
+   }
+   else
+   {
+     try{
+          makefile = fileModule.open("makefile", "a");
+         } catch (ex)
+         {
+           print("makefile cannot be written to. Please check Writing Permissions.");
+           java.lang.System.exit(1);
+         }
+
+    }
+
+ return makefile;
+}
+
+function createLibMake(device, objExtDir, makelibname,targetname, objectPath, useProfiling)
+{
+   var tooldir;
+   var cmdprefix;
+   var targetDir;
+   var stringname=String(targetname).replace("(xdc.bld.ITarget.Module)","");
+   var benchSuffix = "";
+
+   if (useProfiling == true) {
+     benchSuffix = "_bench";
+   }
+
+   switch(stringname)
+   {
+    case String(C66LE):
+      tooldir="C6X_GEN_INSTALL_PATH";
+      cmdprefix="";
+      targetDir="c66/release";
+      targetname=C66LE;
+      break;
+    case String(C66BE):
+      tooldir="C6X_GEN_INSTALL_PATH";
+      cmdprefix="";
+      targetDir="c66/release";
+      targetname=C66BE;
+      break;
+    case String(A15LE):
+      tooldir="TOOLCHAIN_PATH_A15";
+      cmdprefix="CROSS_TOOL_PRFX";
+      targetDir="a15/release";
+      targetname=A15LE;
+      break;
+    case String(A9LE):
+      tooldir="TOOLCHAIN_PATH_A9";
+      cmdprefix="CROSS_TOOL_PRFX";
+      targetDir="a9/release";
+      targetname=A9LE;
+      break;
+    case String(A8LE):
+      tooldir="TOOLCHAIN_PATH_A8";
+      cmdprefix="CROSS_TOOL_PRFX";
+      targetDir="a8/release";
+      targetname=A8LE;
+      break;
+    case String(M4LE):
+      tooldir="TOOLCHAIN_PATH_M4";
+      cmdprefix="";
+      targetDir="m4/release";
+      targetname=M4LE;
+      break;
+   }
+
+    var fileModule = xdc.module('xdc.services.io.File');
+    try{
+     var dstFile = new java.io.File(makelibname);
+     dstFile.getParentFile().mkdirs();
+     libmakefile = fileModule.open(makelibname, "w");
+     /* Add to Archive list */
+    } catch (ex)
+    {
+     print(makelibname+" cannot be written to. Please check Writing Permissions.");
+     java.lang.System.exit(1);
+    }
+    libmakefile.writeLine("#*******************************************************************************");
+    libmakefile.writeLine("#* FILE PURPOSE: Lower level makefile for Creating Component Libraries");
+    libmakefile.writeLine("#*******************************************************************************");
+    libmakefile.writeLine("#* FILE NAME: "+makelibname);
+    libmakefile.writeLine("#*");
+    libmakefile.writeLine("#* DESCRIPTION: Defines Source Files, Compilers flags and build rules");
+    libmakefile.writeLine("#*");
+    libmakefile.writeLine("#*");
+    libmakefile.writeLine("#*******************************************************************************");
+    libmakefile.writeLine("#");
+    libmakefile.writeLine("");
+    libmakefile.writeLine("#");
+    libmakefile.writeLine("# Macro definitions referenced below");
+    libmakefile.writeLine("#");
+    libmakefile.writeLine("empty =");
+    libmakefile.writeLine("space =$(empty) $(empty)");
+
+    if ((targetname.name == "A15F") || (targetname.name == "A9F") || (targetname.name == "A8F"))
+    {
+
+        if(stringname.match("gnu.targets"))
+        {
+            libmakefile.writeLine("CC = $("+tooldir+")/bin/$("+cmdprefix+")gcc");
+            libmakefile.writeLine("AC = $("+tooldir+")/bin/$("+cmdprefix+")as");
+            libmakefile.writeLine("ARIN = $("+tooldir+")/bin/$("+cmdprefix+")ar");
+            libmakefile.writeLine("LD = $("+tooldir+")/bin/$("+cmdprefix+")gcc");
+        }
+        else
+        {
+            print("Error: Non-GNU targets are not currently supported ");
+            java.lang.System.exit(1);
+
+        }
+
+        libmakefile.writeLine("INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\\$(space),$(INCDIR)))) -I$("+tooldir+")/include");
+        libmakefile.writeLine("OBJEXT = o"+targetname.suffix);
+        libmakefile.writeLine("AOBJEXT = s"+targetname.suffix);
+        if (useProfiling == true){
+            libmakefile.writeLine("CFLAGS_INTERNAL = " +targetname.ccOpts.prefix+" "+targetname.cc.opts+" -finstrument-functions -gdwarf-3 -g -D_ENABLE_BM");
+        }else{
+            libmakefile.writeLine("CFLAGS_INTERNAL = " +targetname.ccOpts.prefix+" "+targetname.cc.opts);
+        }
+        libmakefile.writeLine("ASFLAGS_INTERNAL = " +targetname.asmOpts.prefix+" "+targetname.asm.opts);
+        libmakefile.writeLine("ARFLAGS_INTERNAL = " +targetname.ar.opts);
+        libmakefile.writeLine("LNKFLAGS_INTERNAL = " +targetname.lnk.opts);
+        libmakefile.writeLine("INTERNALDEFS = -MD -MF $@.dep");
+        libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map");  /* TBD */
+        libmakefile.writeLine("OBJDIR =  ./obj/obj_" +targetname.suffix +"/" + device.toString() + "/" + targetDir +"/obj" + "/" + objExtDir + benchSuffix); 
+
+    }
+    else
+    {
+
+        if(stringname.match("ti.targets"))
+        {
+
+            var rtslibtemp = targetname.lnkOpts.suffix.toString().split("/");
+            var rtslib;
+            for(n=0;n<rtslibtemp.length;n++)
+            {
+                if(rtslibtemp[n].match(".lib"))
+                {
+                    rtslib=rtslibtemp[n];
+                }
+            }
+
+            libmakefile.writeLine("CC = $("+tooldir+")/bin/"+targetname.cc.cmd);
+            libmakefile.writeLine("AC = $("+tooldir+")/bin/"+targetname.asm.cmd);
+            libmakefile.writeLine("ARIN = $("+tooldir+")/bin/"+targetname.ar.cmd);
+            libmakefile.writeLine("LD = $("+tooldir+")/bin/"+targetname.lnk.cmd);
+            libmakefile.writeLine("RTSLIB = -l $("+tooldir+")/lib/"+rtslib);
+        }
+        else
+        {
+            print("Error: Non-TI targets are not currently supported ");
+            java.lang.System.exit(1);
+
+        }
+
+        libmakefile.writeLine("INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\\$(space),$(INCDIR)))) -I$("+tooldir+")/include");
+        libmakefile.writeLine("OBJEXT = o"+targetname.suffix);
+        libmakefile.writeLine("AOBJEXT = s"+targetname.suffix);
+        if (useProfiling == true){
+            libmakefile.writeLine("CFLAGS_INTERNAL = " +targetname.ccOpts.prefix+" "+targetname.cc.opts+" --entry_parm=address --exit_hook=ti_utils_exit --exit_parm=address --entry_hook=ti_utils_entry -g -D_ENABLE_BM");
+        }else{
+            libmakefile.writeLine("CFLAGS_INTERNAL = " +targetname.ccOpts.prefix+" "+targetname.cc.opts);
+        }
+        libmakefile.writeLine("ASFLAGS_INTERNAL = " +targetname.asmOpts.prefix+" "+targetname.asm.opts);
+        libmakefile.writeLine("ARFLAGS_INTERNAL = " +targetname.ar.opts);
+        libmakefile.writeLine("LNKFLAGS_INTERNAL = " +targetname.lnk.opts);
+        /* libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -Dxdc_target_types__=ti/targets/std.h -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");*/
+        libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+"  -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");
+        libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map");
+        libmakefile.writeLine("OBJDIR =  ./obj/obj_" +targetname.suffix +"/" + device.toString() + "/" + targetDir +"/obj" + "/" + objExtDir + benchSuffix); 
+    }
+
+ return libmakefile;
+
+}
+
+function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, targetName, objDir)
+{
+  var  sourcestring = (srcString + fileExt).toString().toUpperCase();
+  var  compileflagstring = sourcestring + "FLAGS";
+  var  objectliststring = sourcestring + "OBJS";
+  /* List all the source files */
+  makefilename.writeLine("\n#List the "+srcString+" Files");
+  makefilename.writeLine(sourcestring + "= \\");
+  for(var i=0;i<srcfiles.length-1;i++)
+  {
+    makefilename.writeLine("    "+srcfiles[i]+"\\");
+  }
+    makefilename.writeLine("    "+srcfiles[i]+"\n");
+
+ /* Flags for the source files */
+ makefilename.writeLine("# FLAGS for the "+srcString+" Files");
+ var compileflags="";
+ if(fileExt == "asm" && flags.aopts != undefined)
+ {
+   compileflags+=" "+flags.aopts;
+ }
+ else if((fileExt == "c" || fileExt == "sa")&& flags.copts != undefined)
+ {
+   compileflags+=" "+flags.copts;
+ }
+
+ if(flags.incs != undefined)
+ {
+   compileflags+=" "+flags.incs;
+ }
+
+
+ makefilename.writeLine(compileflagstring+" = "+compileflags +" \n");
+ makefilename.writeLine("# Make Rule for the "+srcString+" Files");
+
+ makefilename.writeLine(objectliststring +" = $(patsubst %."+fileExt+", "+objDir+"/%.$(OBJEXT), $(" + sourcestring + "))");
+ makefilename.writeLine("\n$("+objectliststring+"): "+objDir+"/%.$(OBJEXT): %."+fileExt);
+ if(fileExt == "c")
+ {
+   makefilename.writeLine("\t-@echo cl"+targetName.suffix +" $< ...");
+ }
+ else
+ {
+   makefilename.writeLine("\t-@echo asm"+targetName.suffix +" $< ...");
+ }
+ makefilename.writeLine("\tif [ ! -d $(@D) ]; then $(MKDIR) $(@D) ; fi;");
+
+ if(fileExt == "c")
+ {
+   if ((targetName.name == "A15F") || (targetName.name == "A9F") || (targetName.name == "A8F"))
+   {
+    makefilename.writeLine("\t$(RM) $@.dep");
+    makefilename.writeLine("\t$(CC) $(CFLAGS_INTERNAL) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) $< -o $@");
+   /*
+    TBD
+   */
+   }
+   else
+   {
+    makefilename.writeLine("\t$(RM) $@.dep");
+    makefilename.writeLine("\t$(CC) $(CFLAGS_INTERNAL) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) -fc $< ");
+    makefilename.writeLine("\t-@$(CP) $@.dep $@.pp; \\");
+    makefilename.writeLine("         $(SED) -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\\\$$//' \\");
+    makefilename.writeLine("             -e '/^$$/ d' -e 's/$$/ :/' < $@.pp >> $@.dep; \\");
+    makefilename.writeLine("         $(RM) $@.pp ");
+   }
+ }
+ else if(fileExt == "asm")
+ {
+   makefilename.writeLine("\t$(AC) $(ASFLAGS_INTERNAL) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) -fa $< ");
+ }
+ else if(fileExt == "sa")
+ {
+   makefilename.writeLine("\t$(AC) $(ASFLAGS_INTERNAL) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) $< ");
+ }
+
+ makefilename.writeLine("\n#Create Empty rule for dependency");
+ makefilename.writeLine("$("+objectliststring+"):"+makefilename.$private.fd);
+ makefilename.writeLine(makefilename.$private.fd+":");
+ makefilename.writeLine("\n#Include Depedency for "+srcString+" Files");
+ makefilename.writeLine("ifneq (clean,$(MAKECMDGOALS))");
+ makefilename.writeLine(" -include $("+objectliststring+":%.$(OBJEXT)=%.$(OBJEXT).dep)");
+ makefilename.writeLine("endif");
+
+}
+
+/**************************************************************************
+ * FUNCTION NAME : buildLibrary
+ **************************************************************************
+ * DESCRIPTION   :
+ *  Utility function which will build a specific library
+ **************************************************************************/
+var makefilelocal;
+function buildLibrary (socName, isDmaSoc, isSoc, libOptions, libName, target, libFiles, useProfiling)
+{
+    var targetDir;
+    var objExtDir;
+
+    if (useProfiling == true)
+    {
+        libName += ".profiling"
+    }
+
+    if (target.name == "A15F")
+    {
+        targetDir = "a15/release";
+    }
+    else if (target.name == "A9F")
+    {
+        targetDir = "a9/release";
+    }
+    else if (target.name == "A8F")
+    {
+        targetDir = "a8/release";
+    }
+    else if (target.name == "M4")
+    {
+        targetDir = "m4/release";
+    }
+    else
+    {
+        targetDir = "c66/release";
+    }
+
+    /* Derive the operating system and soc names */
+    if (isSoc == "true") {
+        var libNameExp = libName;
+        targetDir = socName+"/"+targetDir;
+        objExtDir = "soc";
+    }
+    else  {
+        var libNameExp = libName;
+        objExtDir = "all";
+    }
+
+    var lldFullLibraryPath = "./lib/" + targetDir +"/" + libNameExp;
+    var lldFullBuildPath = "./build/" + targetDir +"/" + libNameExp;
+    var lldFullLibraryPathMake = "$(LIBDIR)/" + targetDir +"/" + libNameExp;
+
+    /* Create Main make file in the root of package folder */
+    makefilelocal = createMake(makefilelocal);
+
+    /* Write the rule to make library in main makefile */
+    lib = lldFullBuildPath+".a"+target.suffix;
+    libMake = lldFullLibraryPathMake+".a"+target.suffix;
+    var objectPath= "./package/"+lldFullBuildPath;
+
+    makefilelocal.writeLine("\n\n# Make rule to create "+libMake+" library");
+    makefilelocal.writeLine(".libraries: "+ libMake);
+    makefilelocal.writeLine(libMake+": FORCE\n\t$(MAKE) -f "+lib+".mk $@");
+
+    /* Create Library make file in the lib folder */
+    var makefilelib= createLibMake(socName, objExtDir, lib+".mk",target,objectPath,useProfiling);
+
+    /* Rule to clean library in main makefile */
+    makefilelocal.writeLine("# Rule to clean "+libMake+" library");
+    makefilelocal.writeLine("clean ::\n\t$(RM) "+ libMake);
+    librule="\n\n"+libMake+" :";
+
+    /* Add files to be compiled */
+    /* Separate out the C and assembly files */
+    var cfiles= new Array();
+    var afiles= new Array();
+    var safiles= new Array();
+    for each(var srcFile in libFiles)
+    {
+        var srcFile=String(srcFile);
+        var dot = srcFile.lastIndexOf(".");
+        var extension = srcFile.substr(dot,srcFile.length);
+        if(extension == ".c")
+        {
+            cfiles.push(srcFile);
+        }
+        else if(extension == ".sa")
+        {
+            safiles.push(srcFile);
+        }
+        else if(extension == ".asm")
+        {
+            afiles.push(srcFile);
+        }
+        else
+        {
+            print("ERROR: Unsupported file extension");
+            java.lang.System.exit(1);
+        }
+    }
+    if(cfiles.length > 0)
+    {
+      makeAddObjects("COMMONSRC",makefilelib,cfiles,libOptions,"c",target, "$(OBJDIR)");
+      librule += " $(COMMONSRCCOBJS)";
+    }
+    if(afiles.length > 0)
+    {
+      makeAddObjects("COMMONSRC",makefilelib,afiles,libOptions,"asm",target, "$(OBJDIR)");
+      librule += " $(COMMONSRCASMOBJS)";
+    }
+    if(safiles.length > 0)
+    {
+      makeAddObjects("COMMONSRC",makefilelib,safiles,libOptions,"sa",target, "$(OBJDIR)");
+      librule += " $(COMMONSRCSAOBJS)";
+    }
+
+    makefilelib.writeLine(librule);
+    makefilelib.writeLine("\t@echo archiving $? into $@ ...");
+    makefilelib.writeLine("\tif [ ! -d $(LIBDIR)/"+targetDir+" ]; then $(MKDIR) $(LIBDIR)/"+targetDir+" ; fi;");
+    makefilelib.writeLine("\t$(ARIN) $(ARFLAGS_INTERNAL) $@ $?");
+    makefilelib.close();
+
+    /* Create the Epilogue; which executes after all the builds are completed.
+     * This is used to generate the benchmark information for the built library.
+     * Also add the benchmarking information file to the package. */
+    /* Put the temp file in object directory since javascript doesn't have a built in tmpname,
+     * and don't want --jobs=# with # > 1 to result in collisions */
+    var libFullName = lldFullLibraryPath + ".a" + target.suffix;
+    var tempFile = libFullName + ".xml";
+    Pkg.makeEpilogue += ".libraries: " + libFullName +  "_size.txt\n";
+    Pkg.makeEpilogue += libFullName +  "_size.txt: " + libFullName + "\n";
+    if ( java.lang.String(target.name).contains('66') )
+    {
+        Pkg.makeEpilogue += "\n\t $(C6X_GEN_INSTALL_PATH)/bin/ofd6x -x " + libFullName + " > " + tempFile;
+        Pkg.makeEpilogue += "\n\t $(SECTTI) " + tempFile + " > " + libFullName +  "_size.txt";
+        Pkg.makeEpilogue += "\n\t $(RM) " + tempFile + "\n\n";
+    }
+    else if (target.name == "M4")
+    {
+        Pkg.makeEpilogue += "\n\t $(TOOLCHAIN_PATH_M4)/bin/armofd -x " + libFullName + " > " + tempFile;
+        Pkg.makeEpilogue += "\n\t $(SECTTI) " + tempFile + " > " + libFullName +  "_size.txt";
+        Pkg.makeEpilogue += "\n\t $(RM) " + tempFile + "\n\n";
+    }
+    else
+    {
+        Pkg.makeEpilogue += "\n\t $(TOOLCHAIN_PATH_A15)/bin/$(CROSS_TOOL_PRFX)size " + libFullName + " > " + libFullName + "_size.txt";
+    }
+    Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix + "_size.txt";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullBuildPath + ".a" + target.suffix + ".mk";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix;
+
+    /* We need to clean after ourselves; extend the 'clean' target to take care of this. */
+    Pkg.makeEpilogue += "\nclean::\n";
+    Pkg.makeEpilogue += "\t$(RM) " + lldFullBuildPath + ".a" + target.suffix + "_size.txt\n";
+    Pkg.makeEpilogue += "\t$(RMDIR) " + "$(LIBDIR)/" + targetDir + "/ \n\n";
+
+    return lib;
+}
+
+
+
diff --git a/packages/ti/drv/gpmc/build/makefile.mk b/packages/ti/drv/gpmc/build/makefile.mk
new file mode 100755 (executable)
index 0000000..9dec006
--- /dev/null
@@ -0,0 +1,35 @@
+#
+# This file is the makefile for building GPMC RTOS library.
+#
+#   Copyright (c) Texas Instruments Incorporated 2015
+#
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+include $(PDK_GPMC_COMP_PATH)/src/src_files_common.mk
+
+MODULE_NAME = gpmc
+
+SRCDIR += soc/$(SOC)
+INCDIR += soc
+# Common source files across all platforms and cores
+SRCS_COMMON += GPMC_soc.c
+
+# List all the external components/interfaces, whose interface header files
+#  need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = pdk edma
+
+PACKAGE_SRCS_COMMON += soc/$(SOC)
+
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS)
+
+# Include common make files
+ifeq ($(MAKERULEDIR), )
+#Makerule path not defined, define this and assume relative path from ROOTDIR
+  MAKERULEDIR := $(ROOTDIR)/ti/build/makerules
+  export MAKERULEDIR
+endif
+include $(MAKERULEDIR)/common.mk
+
+# OBJs and libraries are built by using rule defined in rules_<target>.mk
+#     and need not be explicitly specified here
+
+# Nothing beyond this point
diff --git a/packages/ti/drv/gpmc/build/makefile_indp.mk b/packages/ti/drv/gpmc/build/makefile_indp.mk
new file mode 100755 (executable)
index 0000000..62f40f1
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# This file is the makefile for building GPMC RTOS library.
+#
+#   Copyright (c) Texas Instruments Incorporated 2016
+#
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+include $(PDK_GPMC_COMP_PATH)/src/src_files_common.mk
+
+MODULE_NAME = gpmc_indp
+
+# List all the external components/interfaces, whose interface header files
+#  need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = pdk edma
+
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS)
+
+# Include common make files
+ifeq ($(MAKERULEDIR), )
+#Makerule path not defined, define this and assume relative path from ROOTDIR
+  MAKERULEDIR := $(ROOTDIR)/ti/build/makerules
+  export MAKERULEDIR
+endif
+include $(MAKERULEDIR)/common.mk
+
+# OBJs and libraries are built by using rule defined in rules_<target>.mk
+#     and need not be explicitly specified here
+
+# Nothing beyond this point
diff --git a/packages/ti/drv/gpmc/build/makefile_profile.mk b/packages/ti/drv/gpmc/build/makefile_profile.mk
new file mode 100755 (executable)
index 0000000..62e1fdb
--- /dev/null
@@ -0,0 +1,39 @@
+#
+# This file is the makefile for building GPMC RTOS library.
+#
+#   Copyright (c) Texas Instruments Incorporated 2016
+#
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+include $(PDK_GPMC_COMP_PATH)/src/src_files_common.mk
+
+MODULE_NAME = gpmc_profile
+
+SRCDIR += soc/$(SOC)
+INCDIR += soc
+# Common source files across all platforms and cores
+SRCS_COMMON += GPMC_soc.c
+
+# List all the external components/interfaces, whose interface header files
+#  need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = pdk edma
+
+PACKAGE_SRCS_COMMON += soc/$(SOC)
+
+ifeq ($(CORE),$(filter $(CORE), a15_0 a9host a8host))
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) -finstrument-functions -gdwarf-3 -g -D_ENABLE_BM
+else
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) --entry_parm=address --exit_hook=ti_utils_exit --exit_parm=address --entry_hook=ti_utils_entry -g -D_ENABLE_BM
+endif
+
+# Include common make files
+ifeq ($(MAKERULEDIR), )
+#Makerule path not defined, define this and assume relative path from ROOTDIR
+  MAKERULEDIR := $(ROOTDIR)/ti/build/makerules
+  export MAKERULEDIR
+endif
+include $(MAKERULEDIR)/common.mk
+
+# OBJs and libraries are built by using rule defined in rules_<target>.mk
+#     and need not be explicitly specified here
+
+# Nothing beyond this point
diff --git a/packages/ti/drv/gpmc/build/makefile_profile_indp.mk b/packages/ti/drv/gpmc/build/makefile_profile_indp.mk
new file mode 100755 (executable)
index 0000000..9720374
--- /dev/null
@@ -0,0 +1,32 @@
+#
+# This file is the makefile for building GPMC RTOS library.
+#
+#   Copyright (c) Texas Instruments Incorporated 2016
+#
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+include $(PDK_GPMC_COMP_PATH)/src/src_files_common.mk
+
+MODULE_NAME = gpmc_profile_indp
+
+# List all the external components/interfaces, whose interface header files
+#  need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = pdk edma
+
+ifeq ($(CORE),$(filter $(CORE), a15_0 a9host a8host))
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) -finstrument-functions -gdwarf-3 -g -D_ENABLE_BM
+else
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) --entry_parm=address --exit_hook=ti_utils_exit --exit_parm=address --entry_hook=ti_utils_entry -g -D_ENABLE_BM
+endif
+
+# Include common make files
+ifeq ($(MAKERULEDIR), )
+#Makerule path not defined, define this and assume relative path from ROOTDIR
+  MAKERULEDIR := $(ROOTDIR)/ti/build/makerules
+  export MAKERULEDIR
+endif
+include $(MAKERULEDIR)/common.mk
+
+# OBJs and libraries are built by using rule defined in rules_<target>.mk
+#     and need not be explicitly specified here
+
+# Nothing beyond this point
diff --git a/packages/ti/drv/gpmc/config.bld b/packages/ti/drv/gpmc/config.bld
new file mode 100755 (executable)
index 0000000..321716b
--- /dev/null
@@ -0,0 +1,200 @@
+/******************************************************************************
+ * FILE PURPOSE: Build configuration Script for the spi Driver
+ ******************************************************************************
+ * FILE NAME: config.bld
+ *
+ * DESCRIPTION:
+ *  This file contains the build configuration script for the spi driver
+ *  and is responsible for configuration of the paths for the various
+ *  tools required to build the driver.
+ *
+ * Copyright (C) 2016, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* Get the Tools Base directory from the Environment Variable. */
+var c66ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
+var m4ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_M4");
+var a15ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A15");
+var a9ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A9");
+var a8ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A8");
+
+/* Get the extended debug flags for C66x,
+ * did not change the name for backwards compatibilty */
+var extDbgFlags = java.lang.System.getenv("EXTDBGFLAGS");
+
+/* Get the extended debug flags for A15 */
+var extDbgFlags_a15 = java.lang.System.getenv("EXTDBGFLAGS_A15");
+
+/* Get the extended debug flags for A8 */
+var extDbgFlags_a8 = java.lang.System.getenv("EXTDBGFLAGS_A8");
+
+/* Get the extended debug flags for A9 */
+var extDbgFlags_a9 = java.lang.System.getenv("EXTDBGFLAGS_A9");
+
+/* Get the extended debug flags for M4 */
+var extDbgFlags_m4 = java.lang.System.getenv("EXTDBGFLAGS_M4");
+/* Get the base directory for the gpmc Socket Driver Package */
+var driverPath = new java.io.File(".//").getPath();
+
+/* Include Path */
+var lldIncludePath = " -I" + driverPath + "/src" + " -I" + driverPath;
+
+/* Configure the gpmc Socket Release Version Information */
+/* 3 steps: remove SPACE and TAB, convert to string and split to make array */
+var driverReleaseVersion = (""+Pkg.version.replace(/\s/g, "")).split(',');
+
+/* Print the Compiler Options */
+var pOpts = 1;
+
+/* C66 ELF compiler configuration for Little Endian Mode. */
+var C66LE           = xdc.useModule('ti.targets.elf.C66');
+C66LE.rootDir       = c66ToolsBaseDir;
+C66LE.ccOpts.prefix = "-mo -o3 -q -k -eo.o";
+if(extDbgFlags)
+    C66LE.ccOpts.prefix = C66LE.ccOpts.prefix + " " + extDbgFlags;
+
+/* C66 ELF compiler configuration for Big Endian Mode. */
+var C66BE           = xdc.useModule('ti.targets.elf.C66_big_endian');
+C66BE.rootDir       = c66ToolsBaseDir;
+C66BE.ccOpts.prefix = "-mo -o3 -q -k -eo.o -DBIGENDIAN";
+if(extDbgFlags)
+    C66BE.ccOpts.prefix = C66BE.ccOpts.prefix + " " + extDbgFlags;
+
+/* ARMv7 A15 compiler configuration */
+var A15LE            = xdc.useModule('gnu.targets.arm.A15F');
+A15LE.rootDir        = a15ToolsBaseDir;
+A15LE.ccOpts.prefix  = "-mno-unaligned-access -c -mtune=cortex-a15 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
+if(extDbgFlags_a15)
+    A15LE.ccOpts.prefix = A15LE.ccOpts.prefix + " " + extDbgFlags_a15;
+
+/* ARMv7 A9 compiler configuration */
+var A9LE            = xdc.useModule('gnu.targets.arm.A9F');
+A9LE.rootDir        = a9ToolsBaseDir;
+A9LE.ccOpts.prefix  = "-mno-unaligned-access -c -mtune=cortex-a9 -marm -DDRA7xx -DSOC_AM437x -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
+if(extDbgFlags_a9)
+    A9LE.ccOpts.prefix = A9LE.ccOpts.prefix + " " + extDbgFlags_a9;
+
+/* ARMv7 A8 compiler configuration */
+var A8LE            = xdc.useModule('gnu.targets.arm.A8F');
+A8LE.rootDir        = a8ToolsBaseDir;
+A8LE.ccOpts.prefix  = "-mno-unaligned-access -c -mtune=cortex-a8 -marm -DDRA7xx -DSOC_AM335x -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
+if(extDbgFlags_a8)
+    A8LE.ccOpts.prefix = A8LE.ccOpts.prefix + " " + extDbgFlags_a8;
+
+/* M4 ELF compiler configuration for Little Endian Mode. */
+var M4LE            = xdc.useModule('ti.targets.arm.elf.M4');
+M4LE.rootDir        = m4ToolsBaseDir;
+M4LE.ccOpts.prefix  = "-o4 -qq -pdsw255 -DMAKEFILE_BUILD";
+if(extDbgFlags_m4)
+    M4LE.ccOpts.prefix = M4LE.ccOpts.prefix + " " + extDbgFlags_m4;
+
+/* soc name (am?) is inserted between first an second element of this
+   list to construct device file name for each device */
+var deviceConstruct = [ "soc/", "/GPMC_soc.c" ];
+
+
+/* Create the SoC List  */
+var socs = {
+    /* device independent libraries */
+    all :
+    {
+        /* Build this library */
+        build: "true",
+        /* SoC lib enabled */
+        socDevLib: "false",
+        /* Library options */
+        copts: "",
+        /* target lists, kept blank now, would be updated based on argument lists */
+        targets: []
+    },
+
+    am437x :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains am437x */
+        build: "false",
+        /* SoC lib enabled */
+        socDevLib: "true",
+        /* Library options */
+        copts: " -DSOC_AM437x",
+        /* target list */
+        targets: [ A9LE ]
+   },
+
+    am335x :
+    {
+        /* this variable would be reinitialized to true, if XDCARGS contains am335x */
+        build: "false",
+        /* SoC lib enabled */
+        socDevLib: "true",
+        /* Library options */
+        copts: " -DSOC_AM335x",
+        /* target list */
+        targets: [ A8LE ]
+   }
+};
+
+/**************************************************************************
+ * FUNCTION NAME : merge
+ **************************************************************************
+ * DESCRIPTION   :
+ *  The function is used to merge two arrarys
+ **************************************************************************/
+function merge() {
+    var args = arguments;
+    var hash = {};
+    var arr = [];
+    for (var i = 0; i < args.length; i++) {
+       for (var j = 0; j < args[i].length; j++) {
+         if (hash[args[i][j]] !== true) {
+           arr[arr.length] = args[i][j];
+           hash[args[i][j]] = true;
+         }
+       }
+     }
+    return arr;
+}
+
+/* Grab input from XDCARGS */
+var buildArguments  = [];
+
+/* Construct the build arguments */
+for (var tmp=0; arguments[tmp] != undefined; tmp++)
+{
+
+    /* If no arguments are provided, override for building all */
+    if ( ( arguments.length == 1) && (arguments[tmp].equals("./config.bld")) )
+        buildArguments[buildArguments.length++] = "all";
+    else
+        buildArguments[buildArguments.length++] = arguments[tmp];
+}
+
+/* Build targets on this build */
+var build_targets = [];
+var soc_names = Object.keys(socs);
+
+for (var i=0; i < buildArguments.length; i++ ) {
+    /* Build it for all targets */
+    if (buildArguments[i] == "all") {
+        for (var j = 0; j < soc_names.length; j++)  {
+            build_targets = merge (build_targets.slice(0), socs[soc_names[j]].targets.slice(0));
+            /* Set build to "true" for that SoC */
+            socs[soc_names[j]].build = "true";
+        }
+    }
+    else {
+        /* Skip the first argument, which is ./config.bld to get to next SoCs */
+        if (i == 0) continue;
+        /* Set that build to true if it is found in supported build socs */
+        for (j = 0; j < soc_names.length; j++) {
+            if (buildArguments[i] == soc_names[j]) {
+                socs[buildArguments[i]].build = "true";
+                build_targets = merge (build_targets.slice(0), socs[buildArguments[i]].targets.slice(0));
+                break;
+            }
+        }
+    }
+}
+
+/* Update the Build target generated list */
+socs["all"].targets = build_targets;
+Build.targets   = build_targets;
diff --git a/packages/ti/drv/gpmc/config_mk.bld b/packages/ti/drv/gpmc/config_mk.bld
new file mode 100755 (executable)
index 0000000..18e6e46
--- /dev/null
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * FILE PURPOSE: Build configuration Script for the gpmc Driver
+ ******************************************************************************
+ * FILE NAME: config.bld
+ *
+ * DESCRIPTION:
+ *  This file contains the build configuration script for the gpmc driver
+ *  and is responsible for configuration of the paths for the various
+ *  tools required to build the driver.
+ *
+ * Copyright (C) 2014-2016, Texas Instruments, Inc.
+ *****************************************************************************/
+/* Get the Tools Base directory from the Environment Variable. */
+var c66ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
+var m4ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_M4");
+var a15ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A15");
+var a9ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A9");
+var a8ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A8");
+
+
+/* Get the base directory for the gpmc Socket Driver Package */
+var driverPath = new java.io.File(".//").getPath();
+
+/* Include Path */
+var lldIncludePath = " -I" + driverPath + "/src" + " -I" + driverPath;
+
+/* Configure the gpmc Socket Release Version Information */
+/* 3 steps: remove SPACE and TAB, convert to string and split to make array */
+var driverReleaseVersion = (""+Pkg.version.replace(/\s/g, "")).split(',');
+
+/* Do not print the compiler options */
+var pOpts = 0;
+
+/* List of all devices that needs to be build via XDC
+ * As the build happens through makefile, there is nothing to build via XDC
+ * using the below for packaging infrastructure
+ */
+var socs = [];
+var devices = [];
+var build_devices = [];
+Build.targets = []
+
diff --git a/packages/ti/drv/gpmc/docs/Doxyfile b/packages/ti/drv/gpmc/docs/Doxyfile
new file mode 100644 (file)
index 0000000..a8008ff
--- /dev/null
@@ -0,0 +1,293 @@
+
+# Doxyfile 1.5.6
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING      = UTF-8
+PROJECT_NAME           = "GPMC Low Level Driver"
+PROJECT_NUMBER         = 1.0.0.0
+OUTPUT_DIRECTORY       = ./docs/doxygen
+CREATE_SUBDIRS         = NO
+OUTPUT_LANGUAGE        = English
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+STRIP_FROM_INC_PATH    = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = NO
+QT_AUTOBRIEF           = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = YES
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 8
+ALIASES                = 
+OPTIMIZE_OUTPUT_FOR_C  = YES
+OPTIMIZE_OUTPUT_JAVA   = NO
+OPTIMIZE_FOR_FORTRAN   = NO
+OPTIMIZE_OUTPUT_VHDL   = NO
+BUILTIN_STL_SUPPORT    = NO
+CPP_CLI_SUPPORT        = NO
+SIP_SUPPORT            = NO
+IDL_PROPERTY_SUPPORT   = YES
+DISTRIBUTE_GROUP_DOC   = NO
+SUBGROUPING            = YES
+TYPEDEF_HIDES_STRUCT   = NO
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = NO
+EXTRACT_PRIVATE        = NO
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = NO
+EXTRACT_ANON_NSPACES   = NO
+HIDE_UNDOC_MEMBERS     = YES
+HIDE_UNDOC_CLASSES     = YES
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = NO
+CASE_SENSE_NAMES       = NO
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+SORT_BRIEF_DOCS        = NO
+SORT_GROUP_NAMES       = NO
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+SHOW_DIRECTORIES       = NO
+SHOW_FILES             = YES
+SHOW_NAMESPACES        = YES
+FILE_VERSION_FILTER    = 
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = 
+INPUT_ENCODING         = UTF-8
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cxx \
+                         *.cpp \
+                         *.c++ \
+                         *.d \
+                         *.java \
+                         *.ii \
+                         *.ixx \
+                         *.ipp \
+                         *.i++ \
+                         *.inl \
+                         *.h \
+                         *.hh \
+                         *.hxx \
+                         *.hpp \
+                         *.h++ \
+                         *.idl \
+                         *.odl \
+                         *.cs \
+                         *.php \
+                         *.php3 \
+                         *.inc \
+                         *.m \
+                         *.mm \
+                         *.dox \
+                         *.py \
+                         *.f90 \
+                         *.f \
+                         *.vhd \
+                         *.vhdl
+RECURSIVE              = YES
+EXCLUDE                = YES \
+                         ./example \
+                         ./test \
+                         ./package \
+                         ./packages
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = cslr_*.h
+EXCLUDE_SYMBOLS        = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = *
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_PATTERNS        = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = NO
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION    = NO
+REFERENCES_LINK_SOURCE = YES
+USE_HTAGS              = NO
+VERBATIM_HEADERS       = NO
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = NO
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = ./docs/tiheader.htm
+HTML_FOOTER            = ./docs/tifooter.htm
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = YES
+GENERATE_DOCSET        = NO
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+HTML_DYNAMIC_SECTIONS  = NO
+CHM_FILE               = ..\..\gpmclldDocs.chm
+HHC_LOCATION           = hhc.exe
+GENERATE_CHI           = NO
+CHM_INDEX_ENCODING     = 
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NONE
+TREEVIEW_WIDTH         = 250
+FORMULA_FONTSIZE       = 10
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = YES
+USE_PDFLATEX           = YES
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = NO
+MSCGEN_PATH            = 
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = NO
+DOT_FONTNAME           = FreeSans
+DOT_FONTPATH           = 
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+GROUP_GRAPHS           = YES
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = NO
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+CALLER_GRAPH           = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+DOT_GRAPH_MAX_NODES    = 50
+MAX_DOT_GRAPH_DEPTH    = 1000
+DOT_TRANSPARENT        = YES
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
+
+
diff --git a/packages/ti/drv/gpmc/docs/GPMC_LLD_SoftwareManifest.html b/packages/ti/drv/gpmc/docs/GPMC_LLD_SoftwareManifest.html
new file mode 100644 (file)
index 0000000..ad015f2
--- /dev/null
@@ -0,0 +1,328 @@
+<!--\r\r
+Texas Instruments Manifest Format 2.0\r\r
+-->\r\r
+\r\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r\r
+<html>\r\r
+\r\r
+<head>\r\r
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />\r\r
+<!-- @Start Style -->\r\r
+<!-- Default style in case someone doesnt have Internet Access -->\r\r
+<style type="text/css" id="internalStyle">\r\r
+       body, div, p {\r\r
+               font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;\r\r
+               font-size: 13px;\r\r
+               line-height: 1.3;\r\r
+       }\r\r
+       body {\r\r
+               margin: 20px;   \r\r
+       }\r\r
+       h1 {\r\r
+               font-size: 150%;\r\r
+       }\r\r
+       h2 {\r\r
+               font-size: 120%;\r\r
+       }\r\r
+       h3 {\r\r
+               font-size: 100%;\r\r
+       }\r\r
+       img {\r\r
+               border: 0px;\r\r
+               vertical-align: middle;\r\r
+       }\r\r
+       table, th, td, tr {\r\r
+               border: 1px solid black;        \r\r
+               font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;\r\r
+               font-size: 13px;\r\r
+               line-height: 1.3;\r\r
+               empty-cells: show;  \r\r
+               padding: 5px;\r\r
+       }\r\r
+       table {\r\r
+               border-collapse: collapse; \r\r
+               width: 100%;\r\r
+       }\r\r
+       tr {\r\r
+               page-break-inside: avoid;\r\r
+       }\r\r
+       #TIlogoLeft {\r\r
+               background-color: black; \r\r
+               padding: 0;\r\r
+               width: 20%;\r\r
+       }\r\r
+       #TIlogoRight {\r\r
+               background-color: red; \r\r
+               padding: 0;\r\r
+       }\r\r
+       #ProductName {\r\r
+               text-align: center;\r\r
+       }\r\r
+       #ReleaseDate {\r\r
+               text-align: center;\r\r
+       }\r\r
+       .LogoSection {\r\r
+               margin: 0;\r\r
+               padding: 0;\r\r
+       }\r\r
+       .HeaderSection {\r\r
+               margin: 25px 0 25px 0;\r\r
+               padding: 0;\r\r
+       }\r\r
+       .LegendSection {\r\r
+               margin: 25px 0 25px 0;\r\r
+       }\r\r
+       .ExportSection {\r\r
+               margin: 25px 0 25px 0;\r\r
+       }\r\r
+       .DisclaimerSection {\r\r
+               margin: 25px 0 25px 0;  \r\r
+       }\r\r
+       .CreditSection {\r\r
+               margin: 25px 0 25px 0;  \r\r
+       }\r\r
+       .LicenseSection {\r\r
+               margin: 25px 0 25px 0;  \r\r
+       }\r\r
+       .ManifestTable {\r\r
+               margin: 25px 0 25px 0;  \r\r
+       }\r\r
+</style> \r\r
+<!-- Override style from TI if they have Internet Access -->\r\r
+<link type="text/css" rel="stylesheet" href="timanifeststyle.css">\r\r
+<!-- @End Style -->\r\r
+<title>Texas Instruments Manifest</title>\r\r
+</head>\r\r
+\r\r
+<body><!-- Logo display, will need to fix up the URLs, this is just for testing.. Image alternate display not wporking well yet -->\r\r
+<div class="LogoSection">\r\r
+<table>\r\r
+  <tbody>\r\r
+    <tr>\r\r
+      <td id="TIlogoLeft">\r\r
+        <a href="http://www.ti.com/">\r\r
+          <!-- img src="tilogo.gif" alt="Texas Instruments Incorporated" -->\r\r
+                 <img alt="" src="data:image/gif;base64,R0lGODlh3gA2AKIAAAAAAP///7u7u29vbz8/PwYGBujo6BgYGCH5BAAAAAAALAAAAADeADYAAAP/CLrc/jDKSau9OOvNu/9gKI5kaZ5oqq5s675wLM90bd94ru987//AoHBILBqPyKRyyWw6n9CodHorDALYLIHKJVqz2q44eAUHtoDB4DBu48rgLQErcNtnX7NhMDcICIB3gix5ZmtqAAZZew8EAo+QkQIDNVZqiIM1cHGKZ4YPAmaiAWw0c1gFmZqjB3SbZ6kNe6WhsAeOlDV0qjSFAXUAp7lwuREFtVsFgMvLB7fNAM+BCs+lDLd8BNYOuxfV22PL0RiWlwO1u3kDqejAEsjR6GB86FsHoYwA6gxWnVgGEegUuIelWJk6jswAGlXQ36J1xBSoQwfulIEDr/6l+VeK/+AehrAGOHRnAWRBbbWegckXAV6wk4AeRQtDQBEaBYsYlMl2hUCsBt0iKgilT9EfAlfO7SmzdKkrkQUT/fqZSECqLCSlntH375IAA1tqGUilLIBSNVnU+NmJNBRVChlF1QwAdlRWBy5P3QymwCLBYhs73cTHYBq3X33nDQ2wcWuBgef0FRD4GK3jU3VCZZUJAIw1OGg0P+4bFiubOWoOsEP1+KvZn3wurDbZ6lfcuw3yYkFjRSeYzRe7ARAbW0K3PmGIMi0OFDG1Mmha+RnufAHn3xL9ha6uTZ/rXagZ1GKAtTsHeWb+FEQvHILuX4+mLzj2j2r4TrFesTwMbE5Cuv8JzbTSGuRV1xgfUJFC3WbA0JWFalcItpgf8YU2yT/qATaedent5cBb8zk0DzIitgfKbonRFV9Wp2xl3UXq5Ccibp05598BnRigiAIJmrZAexkJQIuBwzX4CB3SQbeYQkPVAUco63DI2HzsAdYAiAvEZdYlaVQ5wXs3+bQAjovEUoBRR9LVAFLaPXCcY/KMqVRasQB5kiJgLcYgTkJiuCWKC2ZpIY/z/LRhYefkBAGW1HTyRy2UjObLHxSAOZ948EUVGCSC3SLZbB7iZKOLc2GRRgMH/VhdHnJwFCgD8iEGx0VKvpqbO+hoaCppEg3UiTES1CTkhNaQ+Qs4LQGql07/lET4mIQ6SvTSVGZ9Bmhz/bkYzK+PFKtpje6wumRm1wrLZzSdQASoZvyswdmSuk7p616HfkjBTxZBQucFgqXCFKdn1NpiUlQJhs8kteBWG0AbATbXS2tBlaeoVkmJRova4KkGPmhMFdiSYmq8cbTRYhrlkiHaNufJ9mIgVqEXnAOJM5JE4sgjudQ8bF82x+cKBP4Iiedecyjgx2/WtMNjjhcL9h+S4xq9RYJgsbeeUbmdrPTSQbPccsyijEXOfI8xyuinVJH1wdkS/MQ2Bc5Iq08DyHYwGglvPyCilbz0fa8GLV7r9+Btb7CJ14Qnzg8HpdKoOOF5Py752JNXvrblNphzEHnmnF/a+ecTbA465qKPXnnppkuOeuqKr8465K+z7nrsfc9Ouyq23z5I7rrfwXvvbhSQAAA7" />\r\r
+        </a>\r\r
+      </td>\r\r
+      <td id="TILogoRight">\r\r
+        <!-- img src="titagline.gif" alt="Technology for Innovators(tm)"-->\r\r
+               <img alt="" src="data:image/gif;base64,R0lGODlhOgEaALMAAP8AAP////92dv+3t/+Njf/W1v/t7f8hIf/19f+jo//Hx/8/P/9cXP/j4//6+v/+/iH5BAAAAAAALAAAAAA6ARoAAAT/EMhJq7046827/2AojmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgsGo/IpHLJbDqft0NDMCBQodis1jcADBKE7nYcCpjPgU5AQBKkVYOHAeRudqtXsh60/vRHdSoBBCGBNAkLe4o4f2psgG8pjR6GM5OLmDB/DA0GBoQADAgICRIBBQUOYgwGCg2kEgudBgUHAIGcBg0MsZ0NCnMGYgsBtqEGAbCynrW3AQONgcIFBgiErK6wAAfUtLbCscWiowoAyLDczLZu0AIJCAYOoJn0G38ObAwPEvLEts/O1vUhsA8AAjGonEmA9W6hGAVpEjiQoKBAhT8HJSRkVyEQQAAJ//a5YeMPQIFyACqCnJjSIgFCB4oB+HOSokWOAB6wIWCxnk8MfYh5QsYg5sVHfQLVMSqhztJIxWIaC6QzJy8KfZgqrNT0zR+nUNl8fSMvZ6IDwJCJRfoI7IR4Cub9nDsha6RwR02xUZpGq1utUWUq9FKgYV6/abgOHjt45tquEgY0SDDHoJg+fxhXolKNrmfH/EoR5EdAKmjQfB1qvPmGIQIJ3g4gC2egVF7LqxtP8Ng2cViTKFUCIGbNFKEEmB/VbDlYdqLRn+du8oTg6jjbmfe+CbTM2+BcuySgbQVtQoOCt7s3U8wbsqGs3ZppZLnylwFe8Uql825ogANPckUnYDoOCogxQGXADajggjcw4AA8DSSyTQASMmjhhTQscBWGHHbo4YcghijiiCSWaOKJKKao4oostugiFBEAADs=" />\r\r
+      </td>\r\r
+    </tr>\r\r
+  </tbody>\r\r
+</table>\r\r
+</div><div class="HeaderSection">\r\r
+<h1 id="ProductName">\r\r
+<!-- @Start Product -->\r\r
+GPMC LLD Manifest\r\r
+<!-- @End Product -->\r\r
+</h1>\r\r
+\r\r
+<h2 id="ReleaseDate">\r\r
+<!-- @Start Date -->\r\r
+06-22-2016\r\r
+<!-- @End Date -->\r\r
+</h2>\r\r
+\r\r
+\r\r
+<h2 id="SRASID">\r\r
+<!-- @Start Date -->\r\r
+Manifest ID - SRAS00003008\r\r
+<!-- @End Date -->\r\r
+</h2>\r\r
+</div><div class="LegendSection">\r\r
+<h2>Legend</h2>\r\r
+<p>(explanation of the fields in the Manifest Table below)</p>\r\r
+<table>\r\r
+<tbody>\r\r
+<tr>\r\r
+<td>\r\r
+<b>Software Name </b>\r\r
+</td>\r\r
+<td>\r\r
+The name of the application or file\r\r
+</td>\r\r
+</tr>\r\r
+<tr>\r\r
+<td>\r\r
+<b>Version</b>\r\r
+</td>\r\r
+<td>\r\r
+Version of the application or file\r\r
+</td>\r\r
+</tr>\r\r
+<tr>\r\r
+<td>\r\r
+<b>License Type</b>\r\r
+</td>\r\r
+<td>\r\r
+Type of license(s) under which TI will be providing\r\r
+software to the licensee (e.g. BSD-3-Clause, GPL-2.0, TI TSPA License, TI\r\r
+Commercial License). The license could be under Commercial terms or Open Source. See Open Source Reference License Disclaimer in\r\r
+the Disclaimers Section. Whenever possible, TI will use an <a href="http://spdx.org/licenses/"> SPDX Short Identifier </a> for an Open Source\r\r
+License. TI Commercial license terms are not usually included in the manifest and are conveyed through a variety \r\r
+of means such as a clickwrap license upon install, \r\r
+a signed license agreement and so forth.\r\r
+</td>\r\r
+</tr>\r\r
+<tr>\r\r
+<td>\r\r
+<b>Location</b>\r\r
+</td>\r\r
+<td>\r\r
+The directory name and path on the media or a specific file where the Software is located. Typically fully qualified path names \r\r
+are not used and instead the relevant top level directory of the application is given. \r\r
+A notation often used in the manifests is [as installed]/directory/*. Note that the asterisk implies that all\r\r
+files under that directory are licensed as the License Type field denotes. Any exceptions to this will \r\r
+generally be denoted as [as installed]/directory/* except as noted below which means as shown in subsequent rows of \r\r
+the manifest.\r\r
+</td>\r\r
+</tr>\r\r
+<tr>\r\r
+<td>\r\r
+<b>Delivered As</b>\r\r
+</td>\r\r
+<td>\r\r
+This field will either be &#8220;Source&#8221;, &#8220;Binary&#8221; or &#8220;Source\r\r
+and Binary&#8221; and is the primary form the content of the Software is delivered\r\r
+in. If the Software is delivered in an archive format, this field\r\r
+applies to the contents of the archive. If the word Limited is used\r\r
+with Source, as in &#8220;Limited Source&#8221; or &#8220;Limited Source and Binary&#8221; then\r\r
+only portions of the Source for the application are provided.\r\r
+</td>\r\r
+</tr>\r\r
+<tr>\r\r
+<td>\r\r
+<b>Modified by TI</b>\r\r
+</td>\r\r
+<td>\r\r
+This field will either be &#8220;Yes&#8221; or &#8220;No&#8221;. A &#8220;Yes&#8221; means\r\r
+TI has made changes to the Software. A &#8220;No&#8221; means TI has not made any\r\r
+changes. Note: This field is not applicable for Software &#8220;Obtained\r\r
+from&#8221; TI.\r\r
+</td>\r\r
+</tr>\r\r
+<tr>\r\r
+<td>\r\r
+<b>Obtained from</b>\r\r
+</td>\r\r
+<td>\r\r
+This field specifies from where or from whom TI obtained\r\r
+the Software. It may be a URL to an Open Source site, a 3<sup>rd</sup>\r\r
+party licensor, or TI. See Links Disclaimer in the Disclaimers\r\r
+Section.\r\r
+</td>\r\r
+</tr>\r\r
+</tbody>\r\r
+</table>\r\r
+</div><div class="DisclaimerSection">\r\r
+<h2>Disclaimers</h2>\r\r
+<h3>Export Control Classification Number (ECCN)</h3>\r\r
+<p>Any use of ECCNs listed in the Manifest is at the user&#8217;s risk\r\r
+and without recourse to TI. Your\r\r
+company, as the exporter of record, is responsible for determining the\r\r
+correct classification of any item at\r\r
+the time of export. Any export classification by TI of Software is for\r\r
+TI&#8217;s internal use only and shall not be construed as a representation\r\r
+or warranty\r\r
+regarding the proper export classification for such Software or whether\r\r
+an export\r\r
+license or other documentation is required for exporting such Software</p>\r\r
+<h3>Links in the Manifest</h3>\r\r
+<p>Any\r\r
+links appearing on this Manifest\r\r
+(for example in the &#8220;Obtained from&#8221; field) were verified at the time\r\r
+the Manifest was created. TI makes no guarantee that any listed links\r\r
+will\r\r
+remain active in the future.</p>\r\r
+<h3>Open Source License References</h3>\r\r
+<p>Your company is responsible for confirming the\r\r
+applicable license terms for any open source Software\r\r
+listed in this Manifest that was not &#8220;Obtained from&#8221; TI. Any open\r\r
+source license\r\r
+specified in this Manifest for Software that was\r\r
+not &#8220;Obtained from&#8221; TI is for TI&#8217;s internal use only and shall not be\r\r
+construed as a representation or warranty regarding the proper open\r\r
+source license terms\r\r
+for such Software.</p>\r\r
+</div><div class="ExportSection">\r\r
+<h2>Export Information</h2>\r\r
+<p>ECCN for Software included in this release:</p>\r\r
+Publicly Available  - Open Source or TI TSPA License\r\r
+</div><div class="ManifestTable">\r\r
+<!-- h2>Manifest Table</h2 -->\r\r
\r
+ <table> \r
+ <tbody> \r
\r
+ <h2> \r
+  GPMC LLD Manifest Table \r
+ </h2> \r
\r
+  \r
+ <p> \r
\r
+ See the Legend above for a description of these columns. \r
\r
+ </p> \r
+  \r
+ <table id="targetpackages" name="targetpackages"> \r
+ <thead>  \r
+       <tr> \r
+               <td><b>Software Name</b></td> \r
+               <td><b>Version</b></td> \r
+               <td><b>License Type</b></td> \r
+               <td><b>Delivered As</b></td> \r
+               <td><b>Modified by TI</b></td> \r
+               <td></td> \r
+               <td></td> \r
+       </tr> \r
+ </thead>  \r
\r
\r
+ <tbody> \r
+       <tr> \r
+               <td id="name" name="name" rowspan="2"> \r
+ GPMC LLD \r
+ </td> \r
+               <td id="version" name="version" rowspan="2"> \r
+ 01.00.00 \r
+ </td> \r
+               <td id="license" name="license" rowspan="2"> \r
+ BSD-3-Clause \r
+ </td> \r
+               <td id="delivered" name="delivered" rowspan="2"> \r
+ Source and Binary \r
+ </td> \r
+               <td id="modified" name="modified" rowspan="2"> \r
+ N/A \r
+ </td> \r
+               <td><b>Location</b></td> \r
+               <td id="location" name="location"> \r
+ packages/ti/drv/gpmc \r
+ </td> \r
+       </tr> \r
+       <tr> \r
+               <td><b>Obtained from</b></td> \r
+               <td id="obtained" name="obtained"> \r
+ Texas Instruments Incorporated \r
+ </td> \r
+       </tr> \r
\r
+ </tbody> \r
+ </table> \r
+  \r
+ </p> \r
+ </p> \r
+ <p> \r
+\r\r
+</div><div class="CreditSection">\r\r
+<h2>Credits</h2>\r\r
+<BR> <BR><BR><BR><BR>\r\r
+</div><div class="LicenseSection">\r\r
+<h2>Licenses</h2>\r\r
+<BR><h3><b> GPMC LLD Licenses </b></h3><BR> <BR><BR><BR>/* Copyright (c) 2013 Texas Instruments Inc - http://www.ti.com */<BR><BR>/*<BR>*  Redistribution and use in source and binary forms, with or without<BR>*  modification, are permitted provided that the following conditions<BR>*  are met:<BR>*<BR>*    Redistributions of source code must retain the above copyright<BR>*    notice, this list of conditions and the following disclaimer.<BR>*<BR>*    Redistributions in binary form must reproduce the above copyright<BR>*    notice, this list of conditions and the following disclaimer in the<BR>*    documentation and/or other materials provided with the<BR>*    distribution.<BR>*<BR>*    Neither the name of Texas Instruments Incorporated nor the names of<BR>*    its contributors may be used to endorse or promote products derived<BR>*    from this software without specific prior written permission.<BR>*<BR>*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS<BR>*  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT<BR>*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR<BR>*  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT<BR>*  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,<BR>*  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT<BR>*  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,<BR>*  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY<BR>*  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT<BR>*  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE<BR>*  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<BR>*<BR>*/<BR><BR><BR>\r\r
+</div>\r\r
+\r\r
+</body></html>
\ No newline at end of file
diff --git a/packages/ti/drv/gpmc/docs/Module.xs b/packages/ti/drv/gpmc/docs/Module.xs
new file mode 100755 (executable)
index 0000000..1aecd4d
--- /dev/null
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * FILE PURPOSE: GPMC Driver DOCS Module specification file.
+ ******************************************************************************
+ * FILE NAME: module.xs
+ *
+ * DESCRIPTION: 
+ *  This file contains the module specification for the GPMC Driver Documentation .
+ *
+ * Copyright (C) 2008, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* Load the library utility. */
+var libUtility = xdc.loadCapsule ("../build/buildlib.xs");
+
+/**************************************************************************
+ * FUNCTION NAME : modBuild
+ **************************************************************************
+ * DESCRIPTION   :
+ *  The function is used to build the LLD documentation and add it to the
+ *  package.
+ **************************************************************************/
+function modBuild() 
+{
+    /* Create the actual PROLOGUE Section for the Documentation.*/
+    Pkg.makePrologue += "release: gpmc_document_generation\n";
+    Pkg.makePrologue += "gpmc_document_generation:\n";
+    Pkg.makePrologue += "\t @echo ----------------------------\n";
+    Pkg.makePrologue += "\t @echo Generating GPMC Driver Documentation\n";
+    Pkg.makePrologue += "\t doxygen docs/Doxyfile\n";
+    Pkg.makePrologue += "\t @echo GPMC Driver Documentation Generated \n";
+    Pkg.makePrologue += "\t @echo ----------------------------\n";
+
+    /* Add the documentation file to the package. */
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/tifooter.htm";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/tiheader.htm";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/tilogo.gif";
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/titagline.gif";
+
+    /* Add the GPMC Software Manifest to the package */
+/*    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/GPMC_LLD_SoftwareManifest.html"; */
+
+    /* Add the HTML documentation to the package */
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxygen";
+
+    /* Add the release notes to the package */
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/ReleaseNotes_GPMC_LLD.pdf";
+
+    /* Add the software manefest to the package */
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/GPMC_LLD_SoftwareManifest.html";
+
+    /* Generate the ECLIPSE Plugin Generation: Only for SETUP Releases. */
+    if (driverInstallType == "SETUP")
+    {
+        Pkg.makePrologue += "all: eclipse_plugin_generation\n";
+        Pkg.makePrologue += "eclipse_plugin_generation:\n";
+        Pkg.makePrologue += "\t @echo ----------------------------\n";
+        Pkg.makePrologue += "\t @echo GPMC Eclipse Plugin Generation\n";
+        Pkg.makePrologue += "\t xs xdc.tools.eclipsePluginGen -o . -x ./eclipseDocs/sample.xml -c ./eclipseDocs/toc_cdoc_sample.xml\n";
+        Pkg.makePrologue += "\t @echo GPMC Eclipse Plugin Generated \n";
+        Pkg.makePrologue += "\t @echo ----------------------------\n";
+    }
+}
+
diff --git a/packages/ti/drv/gpmc/docs/ReleaseNotes_GPMC_LLD.doc b/packages/ti/drv/gpmc/docs/ReleaseNotes_GPMC_LLD.doc
new file mode 100755 (executable)
index 0000000..2951d57
Binary files /dev/null and b/packages/ti/drv/gpmc/docs/ReleaseNotes_GPMC_LLD.doc differ
diff --git a/packages/ti/drv/gpmc/docs/ReleaseNotes_GPMC_LLD.pdf b/packages/ti/drv/gpmc/docs/ReleaseNotes_GPMC_LLD.pdf
new file mode 100755 (executable)
index 0000000..89e8e3d
Binary files /dev/null and b/packages/ti/drv/gpmc/docs/ReleaseNotes_GPMC_LLD.pdf differ
diff --git a/packages/ti/drv/gpmc/docs/doxyfile.xdt b/packages/ti/drv/gpmc/docs/doxyfile.xdt
new file mode 100644 (file)
index 0000000..ef78d1c
--- /dev/null
@@ -0,0 +1,302 @@
+%%{
+/*!
+ *  This template implements the Doxyfile
+ */  
+  /* Versioning */
+  var ver = this;
+  var packageVersion = ver[0]+"."+ver[1]+"."+ver[2]+"."+ver[3];
+
+%%}
+
+# Doxyfile 1.5.6
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING      = UTF-8
+PROJECT_NAME           = "GPMC Low Level Driver"
+PROJECT_NUMBER         = `packageVersion`
+OUTPUT_DIRECTORY       = ./docs/doxygen
+CREATE_SUBDIRS         = NO
+OUTPUT_LANGUAGE        = English
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+STRIP_FROM_INC_PATH    = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = NO
+QT_AUTOBRIEF           = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = YES
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 8
+ALIASES                = 
+OPTIMIZE_OUTPUT_FOR_C  = YES
+OPTIMIZE_OUTPUT_JAVA   = NO
+OPTIMIZE_FOR_FORTRAN   = NO
+OPTIMIZE_OUTPUT_VHDL   = NO
+BUILTIN_STL_SUPPORT    = NO
+CPP_CLI_SUPPORT        = NO
+SIP_SUPPORT            = NO
+IDL_PROPERTY_SUPPORT   = YES
+DISTRIBUTE_GROUP_DOC   = NO
+SUBGROUPING            = YES
+TYPEDEF_HIDES_STRUCT   = NO
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = NO
+EXTRACT_PRIVATE        = NO
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = NO
+EXTRACT_ANON_NSPACES   = NO
+HIDE_UNDOC_MEMBERS     = YES
+HIDE_UNDOC_CLASSES     = YES
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = NO
+CASE_SENSE_NAMES       = NO
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+SORT_BRIEF_DOCS        = NO
+SORT_GROUP_NAMES       = NO
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+SHOW_DIRECTORIES       = NO
+SHOW_FILES             = YES
+SHOW_NAMESPACES        = YES
+FILE_VERSION_FILTER    = 
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = 
+INPUT_ENCODING         = UTF-8
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cxx \
+                         *.cpp \
+                         *.c++ \
+                         *.d \
+                         *.java \
+                         *.ii \
+                         *.ixx \
+                         *.ipp \
+                         *.i++ \
+                         *.inl \
+                         *.h \
+                         *.hh \
+                         *.hxx \
+                         *.hpp \
+                         *.h++ \
+                         *.idl \
+                         *.odl \
+                         *.cs \
+                         *.php \
+                         *.php3 \
+                         *.inc \
+                         *.m \
+                         *.mm \
+                         *.dox \
+                         *.py \
+                         *.f90 \
+                         *.f \
+                         *.vhd \
+                         *.vhdl
+RECURSIVE              = YES
+EXCLUDE                = YES \
+                         ./example \
+                         ./test \
+                         ./package \
+                         ./packages
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = cslr_*.h
+EXCLUDE_SYMBOLS        = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = *
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_PATTERNS        = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = NO
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION    = NO
+REFERENCES_LINK_SOURCE = YES
+USE_HTAGS              = NO
+VERBATIM_HEADERS       = NO
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = NO
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = ./docs/tiheader.htm
+HTML_FOOTER            = ./docs/tifooter.htm
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = YES
+GENERATE_DOCSET        = NO
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+HTML_DYNAMIC_SECTIONS  = NO
+CHM_FILE               = ..\..\gpmclldDocs.chm
+HHC_LOCATION           = hhc.exe
+GENERATE_CHI           = NO
+CHM_INDEX_ENCODING     = 
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NONE
+TREEVIEW_WIDTH         = 250
+FORMULA_FONTSIZE       = 10
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = YES
+USE_PDFLATEX           = YES
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = NO
+MSCGEN_PATH            = 
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = NO
+DOT_FONTNAME           = FreeSans
+DOT_FONTPATH           = 
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+GROUP_GRAPHS           = YES
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = NO
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+CALLER_GRAPH           = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+DOT_GRAPH_MAX_NODES    = 50
+MAX_DOT_GRAPH_DEPTH    = 1000
+DOT_TRANSPARENT        = YES
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
+
+
diff --git a/packages/ti/drv/gpmc/docs/tifooter.htm b/packages/ti/drv/gpmc/docs/tifooter.htm
new file mode 100644 (file)
index 0000000..4bdf9c9
--- /dev/null
@@ -0,0 +1,4 @@
+<hr size="1"><small>
+Copyright  $year, Texas Instruments Incorporated</small>
+</body>
+</html>
diff --git a/packages/ti/drv/gpmc/docs/tiheader.htm b/packages/ti/drv/gpmc/docs/tiheader.htm
new file mode 100644 (file)
index 0000000..3c61efe
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>$title</title>
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css">
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css">
+</head><body>
+<table width=100%>
+<tr>
+  <td bgcolor="black" width="1"><a href="http://www.ti.com"><img border=0 src="../../tilogo.gif"></a></td>
+  <td bgcolor="red"><img src="../../titagline.gif"></td>
+</tr>
+</table>
diff --git a/packages/ti/drv/gpmc/docs/tilogo.gif b/packages/ti/drv/gpmc/docs/tilogo.gif
new file mode 100644 (file)
index 0000000..f2fab2d
Binary files /dev/null and b/packages/ti/drv/gpmc/docs/tilogo.gif differ
diff --git a/packages/ti/drv/gpmc/docs/titagline.gif b/packages/ti/drv/gpmc/docs/titagline.gif
new file mode 100644 (file)
index 0000000..743a024
Binary files /dev/null and b/packages/ti/drv/gpmc/docs/titagline.gif differ
diff --git a/packages/ti/drv/gpmc/example/Module.xs b/packages/ti/drv/gpmc/example/Module.xs
new file mode 100755 (executable)
index 0000000..5c2a457
--- /dev/null
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * FILE PURPOSE: GPMC LLD example files.
+ ******************************************************************************
+ * FILE NAME: module.xs
+ *
+ * DESCRIPTION:
+ *  This file contains the module specification for GPMC LLD example files.
+ *
+ * Copyright (C) 2009, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* Load the library utility. */
+var libUtility = xdc.loadCapsule ("../build/buildlib.xs");
+
+/**************************************************************************
+ * FUNCTION NAME : modBuild
+ **************************************************************************
+ * DESCRIPTION   :
+ *  The function is used to add all the source files in the example
+ *  directory into the package.
+ **************************************************************************/
+function modBuild()
+{
+    /* Add all the .c files to the release package. */
+    var exampleFiles = libUtility.listAllFiles (".c", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+
+    /* Add all the .h files to the release package. */
+    var exampleFiles = libUtility.listAllFiles (".h", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+
+    /* Add all the .cmd files to the release package. */
+    var exampleFiles = libUtility.listAllFiles (".cmd", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+
+    /* Add all the .cfg files to the release package. */
+    var exampleFiles = libUtility.listAllFiles (".cfg", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+
+    /* Add all the make files to the release package. */
+    var exampleFiles = libUtility.listAllFiles ("makefile", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+    /* Add the .txt to the package */
+    var exampleFiles = libUtility.listAllFiles (".txt", "example", true);
+    for (var k = 0 ; k < exampleFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = exampleFiles[k];
+
+    /* Add all the .mk files to the release package. */
+    var mkFiles = libUtility.listAllFiles (".mk", "example", true);
+    for (var k = 0 ; k < mkFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = mkFiles[k];
+
+}
diff --git a/packages/ti/drv/gpmc/example/am335x/armv7/bios/GPMC_Test_icev2AM335x_armExampleProject.txt b/packages/ti/drv/gpmc/example/am335x/armv7/bios/GPMC_Test_icev2AM335x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..9c99f73
--- /dev/null
@@ -0,0 +1,6 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpmc/example/src/main_gpmc_flash_example.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpmc/test/src/GPMC_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpmc/test/am335x/armv7/bios/am335x_app_icev2am335x.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -DUART_V1 -DSOC_AM335x -DICEV2_AM335X -g -gstrict-dwarf -gdwarf-3 -finstrument-functions -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/drv/gpmc -I${PDK_INSTALL_PATH} -I${EDMA3LLD_BIOS6_INSTALLDIR}/packages "  -rtsc.enableRtsc
+-ccs.setLinkerOptions " -lgcc -lrdimon -lm -lnosys -nostartfiles -static -Wl,--gc-sections -L$(BIOS_INSTALL_PATH)/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu "
+
diff --git a/packages/ti/drv/gpmc/example/am437x/armv7/bios/GPMC_Test_evmAM437x_armExampleProject.txt b/packages/ti/drv/gpmc/example/am437x/armv7/bios/GPMC_Test_evmAM437x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..dfd0945
--- /dev/null
@@ -0,0 +1,6 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpmc/example/src/main_gpmc_flash_example.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpmc/test/src/GPMC_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpmc/test/am437x/armv7/bios/gpmc_arm_evmam437x.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a9 -mtune=cortex-a9 -march=armv7-a -marm -mfloat-abi=hard -DSOC_AM437x -DEVM_AM437X -g -gstrict-dwarf -gdwarf-3 -finstrument-functions -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/drv/gpmc -I${PDK_INSTALL_PATH} -I${EDMA3LLD_BIOS6_INSTALLDIR}/packages "  -rtsc.enableRtsc
+-ccs.setLinkerOptions " -lrdimon -lgcc -lm -lnosys -nostartfiles -static -Wl,--gc-sections -L$(BIOS_INSTALL_PATH)/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu "
+
diff --git a/packages/ti/drv/gpmc/example/src/main_gpmc_flash_example.c b/packages/ti/drv/gpmc/example/src/main_gpmc_flash_example.c
new file mode 100644 (file)
index 0000000..7e7b4ff
--- /dev/null
@@ -0,0 +1,165 @@
+/**
+ *  \file   main_gpmc_flash_example.c
+ *
+ *  \brief  Example application main file. This application will write and read
+ *          the data to/from GPMC NOR/NAND flash through Board flash interface.
+ *
+ */
+
+/*
+ * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+/* XDCtools Header files */
+#include <xdc/std.h>
+#include <xdc/cfg/global.h>
+#include <xdc/runtime/System.h>
+
+/* BIOS Header files */
+#include <ti/sysbios/BIOS.h>
+
+/* GPMC Header files */
+#include <ti/drv/gpmc/GPMC.h>
+#include <ti/drv/gpmc/soc/GPMC_soc.h>
+#include <ti/drv/gpmc/test/src/GPMC_board.h>
+#include <ti/drv/gpmc/test/src/GPMC_log.h>
+
+/* Board Header files */
+#include <ti/board/board.h>
+#include <ti/board/src/flash/include/board_flash.h>
+
+/**********************************************************************
+ ************************** Macros ************************************
+ **********************************************************************/
+
+/**********************************************************************
+ ************************** Internal functions ************************
+ **********************************************************************/
+
+/**********************************************************************
+ ************************** Global Variables **************************
+ **********************************************************************/
+
+/* Buffer containing the received data */
+uint8_t rxBuf[TEST_DATA_LEN];
+
+/*
+ *  ======== test function ========
+ */
+void gpmc_test(UArg arg0, UArg arg1)
+{
+    Board_flashHandle boardHandle;
+    Board_FlashInfo *flashInfo;
+    uint32_t blockNum, pageNum;
+    bool testPassed = true;
+
+    /* Open the Board flash device with GPMC port instance
+       and use the default GPMC configurations */
+    boardHandle = Board_flashOpen(BOARD_FLASH_ID,
+                                  BOARD_GPMC_INSTANCE, NULL);
+
+    if (!boardHandle)
+    {
+        GPMC_log("\n Board_flashOpen failed. \n");
+        testPassed = false;
+        goto err;
+    }
+    else
+    {
+        flashInfo = (Board_FlashInfo *)boardHandle;
+        GPMC_log("\n GPMC flash device ID: 0x%x, manufacturer ID: 0x%x \n",
+                flashInfo->device_id, flashInfo->manufacturer_id);
+    }
+
+    /* Reset receive buffer */
+    if (Board_flashRead(boardHandle, TEST_ADDR_OFFSET, rxBuf,
+                        TEST_DATA_LEN, NULL))
+    {
+        GPMC_log("\n Board_flashRead failed. \n");
+        testPassed = false;
+        goto err;
+    }
+    GPMC_log("\n GPMC flash read test passed. \n");
+
+err:
+    if (boardHandle)
+    {
+        Board_flashClose(boardHandle);
+    }
+
+    if(true == testPassed)
+    {
+        GPMC_log("\n All tests have passed. \n");
+    }
+    else
+    {
+        GPMC_log("\n Some tests have failed. \n");
+    }
+
+    while(1);
+}
+
+void GPMC_initConfig(void)
+{
+    GPMC_v1_HwAttrs gpmc_cfg;
+
+    /* Get the default UART init configurations */
+    GPMC_socGetInitCfg(BOARD_GPMC_INSTANCE, &gpmc_cfg);
+
+    /* Modify the default UART configurations if necessary */
+
+    /* Set the default UART init configurations */
+    GPMC_socSetInitCfg(BOARD_GPMC_INSTANCE, &gpmc_cfg);
+}
+
+/*
+ *  ======== main ========
+ */
+int main(void)
+{
+    /* Call board init functions */
+    Board_initCfg boardCfg;
+
+    boardCfg = BOARD_INIT_PINMUX_CONFIG |
+        BOARD_INIT_MODULE_CLOCK |
+        BOARD_INIT_UART_STDIO;
+    Board_init(boardCfg);
+
+    GPMC_initConfig();
+
+    /* Start BIOS */
+    BIOS_start();
+    return (0);
+}
diff --git a/packages/ti/drv/gpmc/gpmc_component.mk b/packages/ti/drv/gpmc/gpmc_component.mk
new file mode 100755 (executable)
index 0000000..82d1c40
--- /dev/null
@@ -0,0 +1,181 @@
+#*******************************************************************************
+#                                                                              *
+# Copyright (c) 2016 Texas Instruments Incorporated - http://www.ti.com/       *
+#                        ALL RIGHTS RESERVED                                   *
+#                                                                              *
+#*******************************************************************************
+
+# File: gpmc_component.mk
+#       This file is component include make file of GPMC library.
+# List of variables set in this file and their purpose:
+# <mod>_RELPATH        - This is the relative path of the module, typically from
+#                        top-level directory of the package
+# <mod>_PATH           - This is the absolute path of the module. It derives from
+#                        absolute path of the top-level directory (set in env.mk)
+#                        and relative path set above
+# <mod>_INCLUDE        - This is the path that has interface header files of the
+#                        module. This can be multiple directories (space separated)
+# <mod>_PKG_LIST       - Names of the modules (and sub-modules) that are a part
+#                        part of this module, including itself.
+# <mod>_BOARD_DEPENDENCY - "yes": means the code for this module depends on
+#                             platform and the compiled obj/lib has to be kept
+#                             under <platform> directory
+#                             "no" or "" or if this variable is not defined: means
+#                             this module has no platform dependent code and hence
+#                             the obj/libs are not kept under <platform> dir.
+# <mod>_CORE_DEPENDENCY     - "yes": means the code for this module depends on
+#                             core and the compiled obj/lib has to be kept
+#                             under <core> directory
+#                             "no" or "" or if this variable is not defined: means
+#                             this module has no core dependent code and hence
+#                             the obj/libs are not kept under <core> dir.
+# <mod>_APP_STAGE_FILES     - List of source files that belongs to the module
+#                             <mod>, but that needs to be compiled at application
+#                             build stage (in the context of the app). This is
+#                             primarily for link time configurations or if the
+#                             source file is dependent on options/defines that are
+#                             application dependent. This can be left blank or
+#                             not defined at all, in which case, it means there
+#                             no source files in the module <mod> that are required
+#                             to be compiled in the application build stage.
+#
+ifeq ($(gpmc_component_make_include), )
+
+# under other list
+drvgpmc_BOARDLIST       = icev2AM335x evmAM437x
+drvgpmc_SOCLIST         = am437x am335x
+drvgpmc_am437x_CORELIST = a9host
+drvgpmc_am335x_CORELIST = a8host
+
+############################
+# gpmc package
+# List of components included under gpmc lib
+# The components included here are built and will be part of gpmc lib
+############################
+gpmc_LIB_LIST = gpmc gpmc_dma gpmc_profile gpmc_dma_profile gpmc_indp gpmc_profile_indp
+drvgpmc_LIB_LIST = $(gpmc_LIB_LIST)
+
+############################
+# gpmc examples
+# List of examples under gpmc
+# All the tests mentioned in list are built when test target is called
+# List below all examples for allowed values
+############################
+gpmc_EXAMPLE_LIST = 
+drvgpmc_EXAMPLE_LIST = $(gpmc_EXAMPLE_LIST)
+
+#
+# GPMC Modules
+#
+
+# GPMC LIB
+gpmc_COMP_LIST = gpmc
+gpmc_RELPATH = ti/drv/gpmc
+gpmc_PATH = $(PDK_GPMC_COMP_PATH)
+gpmc_LIBNAME = ti.drv.gpmc
+export gpmc_LIBNAME
+gpmc_LIBPATH = $(gpmc_PATH)/lib
+export gpmc_LIBPATH
+gpmc_OBJPATH = $(gpmc_RELPATH)/gpmc
+export gpmc_OBJPATH
+gpmc_MAKEFILE = -f build/makefile.mk
+export gpmc_MAKEFILE
+gpmc_BOARD_DEPENDENCY = no
+gpmc_CORE_DEPENDENCY = no
+gpmc_SOC_DEPENDENCY = yes
+export gpmc_COMP_LIST
+export gpmc_BOARD_DEPENDENCY
+export gpmc_CORE_DEPENDENCY
+export gpmc_SOC_DEPENDENCY
+gpmc_PKG_LIST = gpmc
+gpmc_INCLUDE = $(gpmc_PATH)
+gpmc_SOCLIST = am437x am335x
+export gpmc_SOCLIST
+gpmc_$(SOC)_CORELIST = $(drvgpmc_$(SOC)_CORELIST)
+export gpmc_$(SOC)_CORELIST
+
+# GPMC LIB DEVICE INDEPENDENT
+gpmc_indp_COMP_LIST = gpmc_indp
+gpmc_indp_RELPATH = ti/drv/gpmc
+gpmc_indp_PATH = $(PDK_GPMC_COMP_PATH)
+gpmc_indp_LIBNAME = ti.drv.gpmc
+export gpmc_indp_LIBNAME
+gpmc_indp_LIBPATH = $(gpmc_indp_PATH)/lib
+export gpmc_indp_LIBPATH
+gpmc_indp_OBJPATH = $(gpmc_indp_RELPATH)/gpmc_indp
+export gpmc_indp_OBJPATH
+gpmc_indp_MAKEFILE = -f build/makefile_indp.mk
+export gpmc_indp_MAKEFILE
+gpmc_indp_BOARD_DEPENDENCY = no
+gpmc_indp_CORE_DEPENDENCY = no
+gpmc_indp_SOC_DEPENDENCY = no
+export gpmc_indp_COMP_LIST
+export gpmc_indp_BOARD_DEPENDENCY
+export gpmc_indp_CORE_DEPENDENCY
+export gpmc_indp_SOC_DEPENDENCY
+gpmc_indp_PKG_LIST = gpmc_indp
+gpmc_indp_INCLUDE = $(gpmc_indp_PATH)
+gpmc_indp_SOCLIST = am437x am335x
+export gpmc_indp_SOCLIST
+gpmc_indp_$(SOC)_CORELIST = $(drvgpmc_$(SOC)_CORELIST)
+export gpmc_indp_$(SOC)_CORELIST
+
+# GPMC PROFILING SOC LIB
+gpmc_profile_COMP_LIST = gpmc_profile
+gpmc_profile_RELPATH = ti/drv/gpmc
+gpmc_profile_PATH = $(PDK_GPMC_COMP_PATH)
+gpmc_profile_LIBNAME = ti.drv.gpmc.profiling
+export gpmc_profile_LIBNAME
+gpmc_profile_LIBPATH = $(gpmc_profile_PATH)/lib
+export gpmc_profile_LIBPATH
+gpmc_profile_OBJPATH = $(gpmc_profile_RELPATH)/gpmc_profile
+export gpmc_profile_OBJPATH
+gpmc_profile_MAKEFILE = -f build/makefile_profile.mk
+export gpmc_profile_MAKEFILE
+gpmc_profile_BOARD_DEPENDENCY = no
+gpmc_profile_CORE_DEPENDENCY = no
+gpmc_profile_SOC_DEPENDENCY = yes
+export gpmc_profile_COMP_LIST
+export gpmc_profile_BOARD_DEPENDENCY
+export gpmc_profile_CORE_DEPENDENCY
+export gpmc_profile_SOC_DEPENDENCY
+gpmc_profile_PKG_LIST = gpmc_profile
+gpmc_profile_INCLUDE = $(gpmc_profile_PATH)
+gpmc_profile_SOCLIST = am572x am571x k2h k2k k2l k2e k2g c6678 c6657 am437x am335x
+export gpmc_profile_SOCLIST
+gpmc_profile_$(SOC)_CORELIST = $(drvgpmc_$(SOC)_CORELIST)
+export gpmc_profile_$(SOC)_CORELIST
+
+# GPMC PROFILING SOC INDEPENDENT LIB
+gpmc_profile_indp_COMP_LIST = gpmc_profile_indp
+gpmc_profile_indp_RELPATH = ti/drv/gpmc
+gpmc_profile_indp_PATH = $(PDK_GPMC_COMP_PATH)
+gpmc_profile_indp_LIBNAME = ti.drv.gpmc.profiling
+export gpmc_profile_indp_LIBNAME
+gpmc_profile_indp_LIBPATH = $(gpmc_profile_indp_PATH)/lib
+export gpmc_profile_indp_LIBPATH
+gpmc_profile_indp_OBJPATH = $(gpmc_profile_indp_RELPATH)/gpmc_profile_indp
+export gpmc_profile_indp_OBJPATH
+gpmc_profile_indp_MAKEFILE = -f build/makefile_profile_indp.mk
+export gpmc_profile_indp_MAKEFILE
+gpmc_profile_indp_BOARD_DEPENDENCY = no
+gpmc_profile_indp_CORE_DEPENDENCY = no
+gpmc_profile_indp_SOC_DEPENDENCY = no
+export gpmc_profile_indp_COMP_LIST
+export gpmc_profile_indp_BOARD_DEPENDENCY
+export gpmc_profile_indp_CORE_DEPENDENCY
+export gpmc_profile_indp_SOC_DEPENDENCY
+gpmc_profile_indp_PKG_LIST = gpmc_profile_indp
+gpmc_profile_indp_INCLUDE = $(gpmc_profile_indp_PATH)
+gpmc_profile_indp_SOCLIST = am572x am571x k2h k2k k2l k2e k2g c6678 c6657 am437x am335x
+export gpmc_profile_indp_SOCLIST
+gpmc_profile_indp_$(SOC)_CORELIST = $(drvgpmc_$(SOC)_CORELIST)
+export gpmc_profile_indp_$(SOC)_CORELIST
+
+export drvgpmc_LIB_LIST
+export gpmc_LIB_LIST
+export gpmc_EXAMPLE_LIST
+export drvgpmc_EXAMPLE_LIST
+
+gpmc_component_make_include := 1
+endif
diff --git a/packages/ti/drv/gpmc/makefile b/packages/ti/drv/gpmc/makefile
new file mode 100755 (executable)
index 0000000..15317d4
--- /dev/null
@@ -0,0 +1,178 @@
+#
+# This file is the makefile for building GPMC RTOS library.
+#
+#   Copyright (c) Texas Instruments Incorporated 2016
+#
+ifeq ($(RULES_MAKE), )
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+else
+include $(RULES_MAKE)
+endif
+
+COMP = drvgpmc
+
+XDC = $(XDC_INSTALL_PATH)/xdc
+
+# check if we need to limit the Build to limitted SOCS
+ifdef LIMIT_BOARDS
+  BOARD_LIST_ALL = $(filter $(LIMIT_BOARDS), $($(COMP)_BOARDLIST))
+else
+  BOARD_LIST_ALL = $($(COMP)_BOARDLIST)
+endif
+
+# check if we need to limit the Build to limitted SOCS
+ifdef LIMIT_SOCS
+  SOC_LIST_ALL = $(filter $(LIMIT_SOCS), $($(COMP)_SOCLIST))
+else
+  SOC_LIST_ALL = $($(COMP)_SOCLIST)
+endif
+
+# check if we need to limit the build to limitted cores
+ifdef LIMIT_CORES
+  CORE_LIST_ALL = $(filter $(LIMIT_CORES), $($(COMP)_$(SOC)_CORELIST))
+else
+  CORE_LIST_ALL = $($(COMP)_$(SOC)_CORELIST)
+endif
+
+lib_SOC_LIST_ALL = $(addsuffix _lib, $(SOC_LIST_ALL))
+lib_CORE_LIST_ALL = $(addsuffix _lib, $(CORE_LIST_ALL))
+lib_LIB_ENDIAN_LIST = $(addsuffix _lib, $(LIB_ENDIAN_LIST))
+lib_SOC_LIST_ALL_CLEAN = $(addsuffix _lclean, $(SOC_LIST_ALL))
+lib_CORE_LIST_ALL_CLEAN = $(addsuffix _lclean, $(CORE_LIST_ALL))
+lib_LIB_ENDIAN_LIST_CLEAN = $(addsuffix _lclean, $(LIB_ENDIAN_LIST))
+
+app_BOARD_LIST_ALL = $(addsuffix _app, $(BOARD_LIST_ALL))
+app_CORE_LIST_ALL = $(addsuffix _app, $(CORE_LIST_ALL))
+app_LIB_ENDIAN_LIST = $(addsuffix _app, $(LIB_ENDIAN_LIST))
+app_BOARD_LIST_ALL_CLEAN = $(addsuffix _aclean, $(BOARD_LIST_ALL))
+app_CORE_LIST_ALL_CLEAN = $(addsuffix _aclean, $(CORE_LIST_ALL))
+app_LIB_ENDIAN_LIST_CLEAN = $(addsuffix _aclean, $(LIB_ENDIAN_LIST))
+
+comp_PKG_LIST_ALL = $($(COMP)_EXAMPLE_LIST) $($(COMP)_LIB_LIST)
+comp_LIB_LIST_CLEAN = $(addsuffix _clean, $($(COMP)_LIB_LIST))
+comp_EXAMPLE_LIST_CLEAN = $(addsuffix _clean, $($(COMP)_EXAMPLE_LIST))
+comp_PKG_LIST_ALL_CLEAN = $(addsuffix _clean, $(comp_PKG_LIST_ALL))
+comp_PKG_LIST_PACKAGE = $(addsuffix _package, $(comp_PKG_LIST_ALL))
+
+.PHONY : apps appcores app_clean clean_appcores \
+         lib libcores lib_allendians lib_clean clean_libcores clean_lib_allendians  \
+         all comp_libs comp_libs_clean examples examples_clean clean package $(comp_PKG_LIST_ALL) \
+                doxygen release tar lib lib_clean $(lib_CORE_LIST_ALL_CLEAN) $(lib_LIB_ENDIAN_LIST_CLEAN) \
+                $(lib_SOC_LIST_ALL) $(lib_CORE_LIST_ALL) $(lib_LIB_ENDIAN_LIST) $(lib_SOC_LIST_ALL_CLEAN) \
+                $(app_BOARD_LIST_ALLapp_SOC_LIST_ALL) $(app_CORE_LIST_ALL) $(app_BOARD_LIST_ALL_CLEAN) $(app_CORE_LIST_ALL_CLEAN)
+                
+
+all: lib 
+
+clean: lib_clean
+
+$(lib_SOC_LIST_ALL):
+       $(MAKE) libcores SOC=$(subst _lib,,$@)
+
+$(lib_CORE_LIST_ALL):
+       $(MAKE) lib_allendians CORE=$(subst _lib,,$@) BUILD_PROFILE_$(subst _lib,,$@)=$(BUILD_PROFILE)
+
+$(lib_LIB_ENDIAN_LIST):
+       $(MAKE) comp_libs ENDIAN=$(subst _lib,,$@)
+
+$(lib_SOC_LIST_ALL_CLEAN):
+       $(MAKE) clean_libcores SOC=$(subst _lclean,,$@)
+
+$(lib_CORE_LIST_ALL_CLEAN):
+       $(MAKE) clean_lib_allendians CORE=$(subst _lclean,,$@) BUILD_PROFILE_$(subst _lclean,,$@)=$(BUILD_PROFILE)
+
+$(lib_LIB_ENDIAN_LIST_CLEAN):
+       $(MAKE) comp_libs_clean ENDIAN=$(subst _lclean,,$@)
+
+$(app_BOARD_LIST_ALL):
+       $(MAKE) appcores BOARD=$(subst _app,,$@)
+
+$(app_CORE_LIST_ALL):
+       $(MAKE) examples CORE=$(subst _app,,$@) BUILD_PROFILE_$(subst _app,,$@)=$(BUILD_PROFILE);
+
+$(app_BOARD_LIST_ALL_CLEAN):
+       $(MAKE) clean_appcores BOARD=$(subst _aclean,,$@)
+       
+$(app_CORE_LIST_ALL_CLEAN):
+       $(MAKE) examples_clean CORE=$(subst _aclean,,$@) BUILD_PROFILE_$(subst _aclean,,$@)=$(BUILD_PROFILE)
+
+xdc_meta:
+       $(XDC) XDCBUILDCFG=config_mk.bld
+
+xdc_meta_clean:
+       $(XDC) clean XDCBUILDCFG=config_mk.bld
+
+doxygen:
+       $(ECHO) Creating Doxygen API guide ...
+       @doxygen docs/Doxyfile
+       
+clean_doxygen:
+       $(ECHO) cleaned Doxygen API guide ...
+       $(RM) -rf docs/doxygen
+
+tar: lib xdc_meta doxygen
+       $(ECHO) Creating the Release Tar ball for $(COMP)...
+       $(XDC) clean   XDCBUILDCFG=config_mk.bld        
+       $(XDC) release XDCBUILDCFG=config_mk.bld
+       $(ECHO) please check $(COMP)/packages folder for the release tarball
+       
+lib: $(lib_SOC_LIST_ALL)
+
+libcores: $(lib_CORE_LIST_ALL)
+
+lib_allendians: $(lib_LIB_ENDIAN_LIST)
+
+lib_clean: $(lib_SOC_LIST_ALL_CLEAN)
+
+clean_libcores:$(lib_CORE_LIST_ALL_CLEAN)
+
+clean_lib_allendians: $(lib_LIB_ENDIAN_LIST_CLEAN)
+
+apps: $(app_BOARD_LIST_ALL)
+
+appcores: $(app_CORE_LIST_ALL)
+
+app_clean: $(app_BOARD_LIST_ALL_CLEAN)
+
+clean_appcores: $(app_CORE_LIST_ALL_CLEAN)
+       
+comp_all: lib_allendians examples
+
+comp_clean: clean_lib_allendians examples_clean
+
+comp_libs: $($(COMP)_LIB_LIST)
+
+comp_libs_clean: $(comp_LIB_LIST_CLEAN)
+
+examples: $($(COMP)_EXAMPLE_LIST)
+
+examples_clean: $(comp_EXAMPLE_LIST_CLEAN)
+
+package: $(comp_PKG_LIST_PACKAGE)
+
+release: all tar
+
+#=================================================================
+#COMP libs and tests
+$(comp_PKG_LIST_ALL):
+       $(if $(filter $(SOC), $(subst emptyreplacement,,$($@_SOCLIST))),\
+           $(if $(filter $(CORE), $(subst emptyreplacement,,$($@_$(SOC)_CORELIST))),\
+               $(if $(filter yes, $(subst emptyreplacement,,$($@_XDC_CONFIGURO))),\
+                   $(MAKE) -C $($@_PATH) $($@_MAKEFILE) xdc_configuro,),),)
+       $(if $(filter $(SOC), $(subst emptyreplacement,,$($@_SOCLIST))),\
+           $(if $(filter $(CORE), $(subst emptyreplacement,,$($@_$(SOC)_CORELIST))),\
+               $(MAKE) -C $($@_PATH) $($@_MAKEFILE),$(ECHO) Nothing to be done for $(SOC) $(CORE) $@),$(ECHO) Nothing to be done for $(SOC) $@)
+
+$(comp_PKG_LIST_ALL_CLEAN):
+       $(if $(filter $(SOC), $(subst emptyreplacement,,$($(subst _clean,,$@)_SOCLIST))),\
+               $(MAKE) -C $($(subst _clean,,$@)_PATH) $($(subst _clean,,$@)_MAKEFILE) clean,)
+
+$(comp_PKG_LIST_PACKAGE):
+       $(if $(filter $(SOC), $(subst emptyreplacement,,$($(subst _package,,$@)_SOCLIST))),\
+               $(MAKE) -C $($(subst _package,,$@)_PATH) $($(subst _package,,$@)_MAKEFILE) package,$(ECHO) Nothing to be done for $(SOC) $(subst _package,,$@))
+
+#Below is used only for checking c++ build errors during development, not to be used for any other purpose
+cplusplus_build:
+       $(MAKE) all BUILD_PROFILE=debug CPLUSPLUS_BUILD=yes
+
+# Nothing beyond this point
diff --git a/packages/ti/drv/gpmc/package.bld b/packages/ti/drv/gpmc/package.bld
new file mode 100755 (executable)
index 0000000..01e82fb
--- /dev/null
@@ -0,0 +1,127 @@
+/******************************************************************************
+ * FILE PURPOSE: Build description for the gpmc Driver
+ ******************************************************************************
+ * FILE NAME: package.bld
+ *
+ * DESCRIPTION:
+ *  This file contains the build specification and description for the gpmc driver
+ *
+ *  The file takes the following parameters from the command line through the
+ *  XDCARGS variable.
+ *      XDCARGS[0] = Driver Install Type
+ *      Valid Values are "TAR" or "SETUP"
+ *      DEFAULT is "SETUP"
+ *
+ *  Example for a valid command:
+ *      xdc XDCARGS="SETUP" release
+ *
+ * Copyright (C) 2016, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* List of all subdirectories that combine to make the gpmc Socket Driver Package. */
+var subDirectories = [ "src", "docs", "test", "example", "soc" ];
+
+var driverInstallType;
+
+/* Determine if we need to create the InstallJammer Application or not?
+ * gpmc LLD Deliverables be either of the following formats:
+ *  - TAR Ball Package
+ *  - Setup Executable
+ * DEFAULT is a SETUP Executable. */
+
+if ((arguments[0] != "TAR") && (arguments[0] != "SETUP"))
+    driverInstallType = "TAR";
+else
+    driverInstallType = arguments[0];
+
+/* Irrespective of the InstallType we always create a TAR Ball Package as a part
+ * of the RTSC Build. Here we determine the name of the TAR Ball Package
+ *  Format is as follows:
+ *      gpmc_<version> */
+var gpmcRTSCFileName = "gpmc" + "_" +
+                      driverReleaseVersion[0] + "_" +  driverReleaseVersion[1] + "_" +
+                      driverReleaseVersion[2]  + "_" + driverReleaseVersion[3];
+
+/******************************************************************
+ ************************ Release Banner **************************
+ ******************************************************************/
+
+print ("************* gpmc Socket Driver Build Information *************");
+print ("gpmc Socket Driver Install       : " + driverInstallType);
+print ("gpmc Socket Driver LLD Version   : " + driverReleaseVersion);
+print ("C66 Tools Directory             : " + c66ToolsBaseDir);
+print ("M4 Tools Directory              : " + m4ToolsBaseDir);
+print ("A15 Tools Directory             : " + a15ToolsBaseDir);
+print ("RTSC File Name                  : " + gpmcRTSCFileName);
+print ("gpmc Socket Driver LLD Path      : " + driverPath);
+if (pOpts == 1) 
+{
+    print ("CC LE opts                      : " + C66LE.ccOpts.prefix);
+    print ("CC BE opts                      : " + C66BE.ccOpts.prefix);
+    print ("M4 LE opts                      : " + M4LE.ccOpts.prefix);
+    print ("A15 basic opts                  : " + A15LE.ccOpts.prefix);
+}
+print ("****************************************************************");
+
+/* Create the release package for the gpmc LLD */
+Pkg.defaultRelease = Pkg.addRelease (gpmcRTSCFileName, {prefix: "./packages/"});
+
+/* Moving forward we need to set the Archiver of the package to be ZIP. This is currently
+ * not supported in the XDC tools being used. Currenly builds need to be done with the
+ * following options:-
+ *   xdc MK_FIXLISTOPTS=-t release
+ * ZIP is a better option as it works natively with INSTALL Jammer and we can remove the
+ * uncompression into a temporary directory. XDC Tools with xdc-rXX support the ZIP archiver. */
+//Pkg.attrs = {archiver : "zip"};
+
+/* Cycle through all the sub-directories and build all the files */
+for (var i = 0; i < subDirectories.length; i++)
+{
+    /* Load the capsule in the sub directory. */
+    var caps = xdc.loadCapsule (subDirectories[i]+"/Module.xs");
+
+    print ("Building directory " + subDirectories[i]);
+
+    /* Build the capsule. */
+    caps.modBuild();
+
+    /* Package the module.xs files for building via package */
+    Pkg.otherFiles[Pkg.otherFiles.length++] = subDirectories[i]+"/Module.xs";
+}
+
+/* Package the remaining files */
+Pkg.otherFiles[Pkg.otherFiles.length++] = "config.bld";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "config_mk.bld";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "package.bld";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xdc";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xs";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "GPMC.h";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "GPMCver.h";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "GPMCver.h.xdt";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxyfile.xdt";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile.mk";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_profile.mk";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_indp.mk";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_profile_indp.mk";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "src/src_files_common.mk";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "gpmc_component.mk";
+Pkg.otherFiles[Pkg.otherFiles.length++] = "./lib";
+
+/* Generate Users Manual Doxyfile */
+var tplt = xdc.loadTemplate("./docs/doxyfile.xdt");
+tplt.genFile("./docs/Doxyfile",driverReleaseVersion);
+
+/* Generate Settings.xdc */
+var tplt = xdc.loadTemplate("./Settings.xdc.xdt");
+tplt.genFile("./Settings.xdc",driverReleaseVersion);
+
+/* Generate paver.h */
+var tplt = xdc.loadTemplate("./GPMCver.h.xdt");
+tplt.genFile("./GPMCver.h",driverReleaseVersion);
+
+
diff --git a/packages/ti/drv/gpmc/package.xdc b/packages/ti/drv/gpmc/package.xdc
new file mode 100755 (executable)
index 0000000..d0726bb
--- /dev/null
@@ -0,0 +1,16 @@
+/******************************************************************************
+ * FILE PURPOSE: Package specification file
+ ******************************************************************************
+ * FILE NAME: package.xdc
+ *
+ * DESCRIPTION:
+ *  This file contains the package specification for the gpmc Driver
+ *
+ * Copyright (C) 2016 - 2018, Texas Instruments, Inc.
+ *****************************************************************************/
+
+
+package ti.drv.gpmc[1, 0, 0, 3] {
+    module Settings;
+}
+
diff --git a/packages/ti/drv/gpmc/package.xs b/packages/ti/drv/gpmc/package.xs
new file mode 100755 (executable)
index 0000000..eacae1f
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ *  ======== package.xs ========
+ *
+ */
+
+
+/*
+ *  ======== Package.getLibs ========
+ *  This function is called when a program's configuration files are
+ *  being generated and it returns the name of a library appropriate
+ *  for the program's configuration.
+ */
+
+function getLibs(prog)
+{
+    var suffix = prog.build.target.suffix;
+    var name = "";
+    var socType = this.Settings.socType;
+    var profilingTag = "";
+
+    socType = socType.toLowerCase();
+    /* Replace the last charecter in SoC am#### to am###x */
+    if (socType.substring(0, 2) == "am")
+    {
+        socType = socType.substring(0, socType.length - 1);
+        socType = socType.concat("x");
+    }
+
+    if (this.Settings.enableProfiling == true)
+    {
+        profilingTag = ".profiling"
+    }
+    name = this.$name + profilingTag + ".a" + suffix;
+
+    /* Read LIBDIR variable */
+    var lib = java.lang.System.getenv("LIBDIR");
+
+    /* If NULL, default to "lib" folder */
+    if (lib == null)
+    {
+        lib = "./lib";
+    } else {
+        print ("\tSystem environment LIBDIR variable defined : " + lib);
+    }
+
+    var socTypes = [
+                     'am571x',
+                     'am572x',
+                     'am335x',
+                     'am437x',
+                     'k2h',
+                     'k2k',
+                     'k2e',
+                     'k2l',
+                     'k2g',
+                     'c6678',
+                     'c6657'
+                   ];
+
+    /* Get the SOC */
+    for each (var soc in socTypes)
+    {
+        if (socType.equals(soc))
+        {
+            lib = lib + "/" + soc;
+            name = this.$name + profilingTag + ".a" + suffix;   
+            break;
+        }
+    }
+
+    /* Get target folder, if applicable */
+    if ( java.lang.String(suffix).contains('66') )
+        lib = lib + "/c66";
+    else if (java.lang.String(suffix).contains('a15') )
+        lib = lib + "/a15";
+    else if (java.lang.String(suffix).contains('m4') )
+        lib = lib + "/m4";
+    else if (java.lang.String(suffix).contains('a9') )
+        lib = lib + "/a9";
+    else if (java.lang.String(suffix).contains('a8') )
+        lib = lib + "/a8";        
+    else
+        throw new Error("\tUnknown target for: " + this.packageBase + lib);
+
+    var libProfiles = ["debug", "release"];
+    /* get the configured library profile */
+    for each(var profile in libProfiles)
+    {
+        if (this.Settings.libProfile.equals(profile))
+        {
+            lib = lib + "/" + profile;
+            break;
+        }
+    }  
+
+    /* Get library name with path */
+    lib = lib + "/" + name;
+    if (java.io.File(this.packageBase + lib).exists()) {
+       print ("\tLinking with library " + this.$name + ":" + lib);
+       return lib;
+    }
+
+    /* Could not find any library, throw exception */
+    throw new Error("\tLibrary not found: " + this.packageBase + lib);
+}
+
+function init() {
+xdc.loadPackage("ti.osal");
+xdc.loadPackage("ti.csl");
+}
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+}
diff --git a/packages/ti/drv/gpmc/soc/GPMC_soc.h b/packages/ti/drv/gpmc/soc/GPMC_soc.h
new file mode 100755 (executable)
index 0000000..f107f6a
--- /dev/null
@@ -0,0 +1,48 @@
+/**
+ * @file   GPMC_soc.h
+ *
+ * @brief  GPMC SoC level driver
+ */
+/*
+ * Copyright (c) 2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <ti/drv/gpmc/GPMC.h>
+#if defined(SOC_AM437x) || defined(SOC_AM335x) || defined(SOC_K2G)
+#include <ti/drv/gpmc/src/V1/GPMC_v1.h>
+#endif
+
+/* GPMC SoC level API */
+#if defined(SOC_AM437x) || defined(SOC_AM335x) || defined(SOC_K2G)
+extern int32_t GPMC_socGetInitCfg(uint32_t index, GPMC_v1_HwAttrs *cfg);
+extern int32_t GPMC_socSetInitCfg(uint32_t index, const GPMC_v1_HwAttrs *cfg);
+#endif
+
diff --git a/packages/ti/drv/gpmc/soc/Module.xs b/packages/ti/drv/gpmc/soc/Module.xs
new file mode 100755 (executable)
index 0000000..e6c0967
--- /dev/null
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * FILE PURPOSE: gpmc LLD soc files.
+ ******************************************************************************
+ * FILE NAME: module.xs
+ *
+ * DESCRIPTION:
+ *  This file contains the module specification for gpmc LLD soc files.
+ *
+ * Copyright (C) 2009, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* Load the library utility. */
+var libUtility = xdc.loadCapsule ("../build/buildlib.xs");
+
+/**************************************************************************
+ * FUNCTION NAME : modBuild
+ **************************************************************************
+ * DESCRIPTION   :
+ *  The function is used to add all the source files in the soc
+ *  directory into the package.
+ **************************************************************************/
+function modBuild()
+{
+    /* Add all the .c files to the release package. */
+    var configFiles = libUtility.listAllFiles (".c", "soc", true);
+    for (var k = 0 ; k < configFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = configFiles[k];
+
+    /* Add all the .h files to the release package. */
+    var configFiles = libUtility.listAllFiles (".h", "soc", true);
+    for (var k = 0 ; k < configFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = configFiles[k];
+
+    /* Add all the .mk files to the release package. */
+    var mkFiles  = libUtility.listAllFiles (".mk", "soc", true);
+    for (var k = 0 ; k < mkFiles .length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = mkFiles [k];
+
+
+}
diff --git a/packages/ti/drv/gpmc/soc/am335x/GPMC_soc.c b/packages/ti/drv/gpmc/soc/am335x/GPMC_soc.c
new file mode 100755 (executable)
index 0000000..567b9df
--- /dev/null
@@ -0,0 +1,170 @@
+/**
+ *  \file   GPMC_soc.c
+ *
+ *  \brief  AM335x device specific hardware attributes.
+ *
+ */
+
+/*
+ * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <ti/csl/soc.h>
+#include <ti/drv/gpmc/GPMC.h>
+#include <ti/drv/gpmc/soc/GPMC_soc.h>
+
+#define CSL_GPMC_CNT        (1U)
+
+#define CSL_GPMC_REG        (0x50000000U)
+#define CSL_ELM_REG         (0x48080000U)
+
+/* GPMC configuration structure */
+GPMC_v1_HwAttrs GPMCInitCfg[CSL_GPMC_CNT + 1] =
+{
+    {
+        CSL_GPMC_REG,                 /* gpmcBaseAddr */
+        GPMC_DEVICETYPE_NORLIKE,      /* devType */
+        GPMC_DEVICESIZE_16BITS,       /* devSize */
+        GPMC_MUXADDDATA_ADMUX,        /* addrDataMux */
+        GPMC_TIMEPARAGRANULARITY_X1,  /* timeLatency */
+        0,                            /* chipSel */
+        0x8000000U,                   /* chipSelBaseAddr */
+               GPMC_CS_SIZE_16MB,            /* chipSelAddrSize */
+        132 + 32,                     /* intrNum */
+        0,                            /* eventId */
+        INVALID_INTC_MUX_NUM,         /* intcMuxNum */
+        -1,                           /* intcMuxInEvent */
+        -1,                           /* intcMuxOutEvent */
+        false,                        /* intrEnable */
+        0,                            /* waitPinNum */
+        GPMC_WAIT_PIN_POLARITY_LOW,   /* waitPinPol */
+        {
+            0U,                       /* csOnTime */
+            30U,                      /* csRdOffTime */
+            30U,                      /* csWrOffTime */
+            1U,                       /* advOnTime */
+            3U,                       /* advRdOffTime */
+            3U,                       /* advWrOffTime */
+            0U,                       /* advAadMuxOnTime */
+            0U,                       /* advAadMuxRdOffTime */
+            0U,                       /* advAadMuxWrOffTime */
+            13U,                      /* weOnTime */
+            28U,                      /* weOffTime */
+            5U,                       /* oeOnTime */
+            28U,                      /* oeOffTime */
+            0U,                       /* oeAadMuxOnTime */
+            0U,                       /* oeAadMuxOffTime */
+            0U,                       /* pageBurstAccessTime */
+            24U,                      /* rdAccessTime */
+            13U,                      /* wrAccessTime */
+            31U,                      /* rdCycleTime */
+            31U,                      /* wrCycleTime */
+            7U,                       /* wrDataOnMuxBusTime */
+            5U,                       /* cycle2CycleDelay */
+            GPMC_CYCLE2CYCLESAMECSEN_C2CDELAY, /* cycleDelaySameChipSel */
+            GPMC_CYCLE2CYCLEDIFFCSEN_NOC2CDELAY, /* cycleDelayDiffChipSel */
+            0U                        /* busTurnAroundTime */
+        },
+        CSL_ELM_REG,                  /* elmBaseAddr */
+        GPMC_NAND_ECC_ALGO_BCH_8BIT   /* eccAlgo */
+    },
+};
+
+
+/* GPMC objects */
+GPMC_v1_Object GPMCObjects[CSL_GPMC_CNT + 1];
+
+
+/* GPMC configuration structure */
+const GPMC_config_list GPMC_config = {
+    {
+        &GPMC_FxnTable_v1,
+        &GPMCObjects[0],
+        &GPMCInitCfg[0]
+    },
+    {
+        NULL,
+        NULL,
+        NULL
+    }
+};
+
+/**
+ * \brief  This API gets the SoC level of GPMC intial configuration
+ *
+ * \param  index     GPMC instance index.
+ * \param  cfg       Pointer to GPMC SOC initial config.
+ *
+ * \return 0 success: -1: error
+ *
+ */
+int32_t GPMC_socGetInitCfg(uint32_t index, GPMC_v1_HwAttrs *cfg)
+{
+    int32_t ret = 0;
+
+    if (index < CSL_GPMC_CNT)
+    {
+        *cfg = GPMCInitCfg[index];
+    }
+    else
+    {
+        ret = -1;
+    }
+
+    return ret;
+}
+
+/**
+ * \brief  This API sets the SoC level of GPMC intial configuration
+ *
+ * \param  index     GPMC instance index.
+ * \param  cfg       Pointer to GPMC SOC initial config.
+ *
+ * \return           0 success: -1: error
+ *
+ */
+int32_t GPMC_socSetInitCfg(uint32_t index, const GPMC_v1_HwAttrs *cfg)
+{
+    int32_t ret = 0;
+
+    if (index < CSL_GPMC_CNT)
+    {
+        GPMCInitCfg[index] = *cfg;
+    }
+    else
+    {
+        ret = -1;
+    }
+
+    return ret;
+}
+
diff --git a/packages/ti/drv/gpmc/soc/am437x/GPMC_soc.c b/packages/ti/drv/gpmc/soc/am437x/GPMC_soc.c
new file mode 100755 (executable)
index 0000000..204630d
--- /dev/null
@@ -0,0 +1,170 @@
+/**
+ *  \file   GPMC_soc.c
+ *
+ *  \brief  AM437x device specific hardware attributes.
+ *
+ */
+
+/*
+ * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <ti/csl/soc.h>
+#include <ti/drv/gpmc/GPMC.h>
+#include <ti/drv/gpmc/soc/GPMC_soc.h>
+
+#define CSL_GPMC_CNT        (1U)
+
+#define CSL_GPMC_REG        (0x50000000U)
+#define CSL_ELM_REG         (0x48080000U)
+
+/* GPMC configuration structure */
+GPMC_v1_HwAttrs GPMCInitCfg[CSL_GPMC_CNT + 1] =
+{
+    {
+        CSL_GPMC_REG,                 /* gpmcBaseAddr */
+        GPMC_DEVICETYPE_NANDLIKE,     /* devType */
+        GPMC_DEVICESIZE_8BITS,        /* devSize */
+        GPMC_MUXADDDATA_NOMUX,        /* addrDataMux */
+        GPMC_TIMEPARAGRANULARITY_X2,  /* timeLatency */
+        0,                            /* chipSel */
+        0x10000000U,                  /* chipSelBaseAddr */
+        GPMC_CS_SIZE_256MB,           /* chipSelAddrSize */
+        132 + 32,                     /* intrNum */
+        0,                            /* eventId */
+        INVALID_INTC_MUX_NUM,         /* intcMuxNum */
+        -1,                           /* intcMuxInEvent */
+        -1,                           /* intcMuxOutEvent */
+        false,                        /* intrEnable */
+        0,                            /* waitPinNum */
+        GPMC_WAIT_PIN_POLARITY_LOW,   /* waitPinPol */
+        {
+            0U,                       /* csOnTime */
+            7U,                       /* csRdOffTime */
+            7U,                       /* csWrOffTime */
+            0U,                       /* advOnTime */
+            0U,                       /* advRdOffTime */
+            7U,                       /* advWrOffTime */
+            0U,                       /* advAadMuxOnTime */
+            0U,                       /* advAadMuxRdOffTime */
+            0U,                       /* advAadMuxWrOffTime */
+            0U,                       /* weOnTime */
+            5U,                       /* weOffTime */
+            0U,                       /* oeOnTime */
+            5U,                       /* oeOffTime */
+            5U,                       /* oeAadMuxOnTime */
+            0U,                       /* oeAadMuxOffTime */
+            0U,                       /* pageBurstAccessTime */
+            6U,                       /* rdAccessTime */
+            6U,                       /* wrAccessTime */
+            7U,                       /* rdCycleTime */
+            7U,                       /* wrCycleTime */
+            7U,                       /* wrDataOnMuxBusTime */
+            0U,                       /* cycle2CycleDelay */
+            GPMC_CYCLE2CYCLESAMECSEN_NOC2CDELAY, /* cycleDelaySameChipSel */
+            GPMC_CYCLE2CYCLEDIFFCSEN_NOC2CDELAY, /* cycleDelayDiffChipSel */
+            0U                        /* busTurnAroundTime */
+        },
+        CSL_ELM_REG,                  /* elmBaseAddr */
+        GPMC_NAND_ECC_ALGO_BCH_8BIT   /* eccAlgo */
+    },
+};
+
+
+/* GPMC objects */
+GPMC_v1_Object GPMCObjects[CSL_GPMC_CNT + 1];
+
+
+/* GPMC configuration structure */
+const GPMC_config_list GPMC_config = {
+    {
+        &GPMC_FxnTable_v1,
+        &GPMCObjects[0],
+        &GPMCInitCfg[0]
+    },
+    {
+        NULL,
+        NULL,
+        NULL
+    }
+};
+
+/**
+ * \brief  This API gets the SoC level of GPMC intial configuration
+ *
+ * \param  index     GPMC instance index.
+ * \param  cfg       Pointer to GPMC SOC initial config.
+ *
+ * \return 0 success: -1: error
+ *
+ */
+int32_t GPMC_socGetInitCfg(uint32_t index, GPMC_v1_HwAttrs *cfg)
+{
+    int32_t ret = 0;
+
+    if (index < CSL_GPMC_CNT)
+    {
+        *cfg = GPMCInitCfg[index];
+    }
+    else
+    {
+        ret = -1;
+    }
+
+    return ret;
+}
+
+/**
+ * \brief  This API sets the SoC level of GPMC intial configuration
+ *
+ * \param  index     GPMC instance index.
+ * \param  cfg       Pointer to GPMC SOC initial config.
+ *
+ * \return           0 success: -1: error
+ *
+ */
+int32_t GPMC_socSetInitCfg(uint32_t index, const GPMC_v1_HwAttrs *cfg)
+{
+    int32_t ret = 0;
+
+    if (index < CSL_GPMC_CNT)
+    {
+        GPMCInitCfg[index] = *cfg;
+    }
+    else
+    {
+        ret = -1;
+    }
+
+    return ret;
+}
+
diff --git a/packages/ti/drv/gpmc/src/GPMC_drv.c b/packages/ti/drv/gpmc/src/GPMC_drv.c
new file mode 100755 (executable)
index 0000000..c7d9ce8
--- /dev/null
@@ -0,0 +1,129 @@
+/**
+ *  \file   GPMC_drv.c
+ *
+ *  \brief  GPMC Driver high level APIs.
+ *
+ *   This file contains the driver APIs for GPMC.
+ */
+
+/*
+ * Copyright (C) 2014-2015 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <ti/drv/gpmc/GPMC.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <ti/drv/gpmc/src/GPMC_osal.h>
+
+
+/* Externs */
+extern const GPMC_config_list GPMC_config;
+
+/* Used to check status and initialization */
+static int32_t GPMC_count = -1;
+
+/* Default GPMC parameters structure */
+const GPMC_Params GPMC_defaultParams =
+{
+    GPMC_MODE_BLOCKING, /* transferMode */
+    0U,                 /* transferTimeout */
+    NULL                /* transferCallbackFxn */
+};
+
+/*
+ *  ======== GPMC_init ========
+ */
+void GPMC_init(void)
+{
+    if (GPMC_count == -1) {
+        /* Call each driver's init function */
+        for (GPMC_count = 0; GPMC_config[GPMC_count].fxnTablePtr != NULL; GPMC_count++) {
+            GPMC_config[GPMC_count].fxnTablePtr->initFxn((GPMC_Handle)&(GPMC_config[GPMC_count]));
+        }
+    }
+}
+
+/*
+ *  ======== GPMC_open ========
+ */
+GPMC_Handle GPMC_open(uint32_t index, GPMC_Params *params)
+{
+    GPMC_Handle handle;
+
+    OSAL_Assert((GPMC_Handle)&(GPMC_config[index]) == NULL);
+
+    /* Get handle for this driver instance */
+    handle = (GPMC_Handle)&(GPMC_config[index]);
+
+    return (handle->fxnTablePtr->openFxn(handle, params));
+}
+
+/*
+ *  ======== GPMC_close ========
+ */
+void GPMC_close(GPMC_Handle handle)
+{
+    OSAL_Assert(handle == NULL);
+
+    handle->fxnTablePtr->closeFxn(handle);
+}
+
+/*
+ *  ======== GPMC_Params_init ========
+ */
+void GPMC_Params_init(GPMC_Params *params)
+{
+    OSAL_Assert(params == NULL);
+
+    *params = GPMC_defaultParams;
+}
+
+/*
+ *  ======== GPMC_transfer ========
+ */
+bool GPMC_transfer(GPMC_Handle handle, GPMC_Transaction *transaction)
+{
+    OSAL_Assert(!((handle != NULL) && (transaction != NULL)));
+
+    return (handle->fxnTablePtr->transferFxn(handle, transaction));
+}
+
+/*
+ *  ======== GPMC_control ========
+ */
+int32_t GPMC_control(GPMC_Handle handle, uint32_t cmd, void *arg)
+{
+    OSAL_Assert(handle == NULL);
+
+    return (handle->fxnTablePtr->controlFxn(handle, cmd, arg));
+}
+
diff --git a/packages/ti/drv/gpmc/src/GPMC_osal.h b/packages/ti/drv/gpmc/src/GPMC_osal.h
new file mode 100644 (file)
index 0000000..58f8a35
--- /dev/null
@@ -0,0 +1,431 @@
+/**
+ *   @file  GPMC_osal.h
+ *
+ *   @brief
+ *      This is the sample OS Adaptation layer which is used by the GPMC
+ *      driver. The OSAL layer can be ported in either of the following
+ *      manners to a native OS:
+ *
+ *      <b> Approach 1: </b>
+ *      @n  Use Prebuilt Libraries
+ *           - Ensure that the provide an implementation of all
+ *             Osal_XXX API for their native OS.
+ *           - Link the prebuilt libraries with their application.
+ *           - Refer to the "example" directory for an example of this
+ *       @n <b> Pros: </b>
+ *           - Customers can reuse prebuilt TI provided libraries
+ *       @n <b> Cons: </b>
+ *           - Level of indirection in the API to get to the actual OS call
+ *
+ *      <b> Approach 2: </b>
+ *      @n  Rebuilt Library
+ *           - Create a copy of this file and modify it to directly
+ *             inline the native OS calls
+ *           - Rebuild the GPMC Driver library; ensure that the Include
+ *             path points to the directory where the copy of this file
+ *             has been provided.
+ *           - Please refer to the "test" directory for an example of this
+ *       @n <b> Pros: </b>
+ *           - Optimizations can be done to remove the level of indirection
+ *       @n <b> Cons: </b>
+ *           - GPMC Libraries need to be rebuilt by the customer.
+ *
+ */
+
+/*
+ * Copyright (C) 2014 -2015 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GPMC_OSAL_H
+#define GPMC_OSAL_H
+
+#include <ti/osal/osal.h>
+
+/**
+ * @brief   Assert API. If expression is true then it will stay in the while
+ *          loop.
+ *
+ * @param   expr  Expression which need to be evaluated.
+ *
+ */
+#define GPMC_osalAssert(expr)         (OSAL_Assert(expr))
+
+/**
+ * @brief   The macro is used by the GPMC driver to create a semaphore for
+ * each GPMC  opened in blocking mode. Semaphores created should
+ * *initially* be created with a count of 0 i.e. unavailable.
+ *
+*  @param  count  Initial count of the semaphore. For binary semaphores,
+ *                 only values of 0 or 1 are valid.
+ *
+ *  @param  params  Pointer to the instance configuration parameters. NULL
+ *                  denotes to use the default parameters (SemOSAL default
+ *                  parameters as noted in ::SemOSAL_Params.
+ *
+ *  @return A void* on success or a NULL on an error
+ */
+
+#define GPMC_osalCreateBlockingLock(count,params)                         \
+                                                (SemaphoreP_create((count),(params)))
+
+/**
+ * @brief   The macro is used by the GPMC driver to delete a previously
+ * created semaphore. This is called when a GPMC  opened in blocking mode
+ * is being closed.
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void SemOSAL_delete(void* semHandle)
+    @endverbatim
+
+ *  <b> Parameter </b>
+ *  @n  Semaphore Handle returned by the create semaphore
+ *
+ *  <b> Return Value </b>
+ *  @n  Not Applicable
+ */
+#define GPMC_osalDeleteBlockingLock(X)       (SemaphoreP_delete(X))
+
+
+/*!
+ *  @brief  Initialize params structure to default values.
+ *
+ *  The default parameters are:
+ *   - mode: SemOSAL_Mode_COUNTING
+ *   - name: NULL
+ *
+ *  @param params  Pointer to the instance configuration parameters.
+ */
+#define GPMC_osalSemParamsInit(params)  (SemaphoreP_Params_init(params))
+
+
+/**
+ * @brief   The macro is used by the GPMC driver to pend on a semaphore
+ * This is called when an application tries to receive data on a blocking
+ *  when there is no data available. Since all semaphores are initially
+ * created to be unavailable; this will cause the application to block.
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void Osal_GPMCPendLock(void* semHandle)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Semaphore Handle
+ *
+ *  <b> Return Value </b>
+ *  @n  Not Applicable
+ */
+#define GPMC_osalPendLock(X,Y)         (SemaphoreP_pend((X),(Y)))
+
+/**
+ * @brief   The macro is used by the GPMC driver to post the semaphore
+ * The driver posts the semaphore once data is received on a specific
+ *
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void Osal_GPMCPostLock(void* semHandle)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Semaphore Handle
+ *
+ *  <b> Return Value </b>
+ *  @n  Not Applicable
+ */
+#define GPMC_osalPostLock(X)     (SemaphoreP_post(X))
+
+/**
+ * @brief   Function to disable interrupts to enter a critical region
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void Osal_GPMCHardwareIntDisable()
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Not Applicable
+ *
+ *  <b> Return Value </b>
+ *  @n  Interrupt key
+ */
+#define GPMC_osalHardwareIntDisable() (HwiP_disable())
+
+/**
+ * @brief   Function to restore interrupts to exit a critical region
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void HwiOSAL_exitCritical(int key)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt key
+ *
+ *  <b> Return Value </b>
+ *  @n  Not Applicable
+ */
+#define GPMC_osalHardwareIntRestore(X) (HwiP_restore(X))
+
+/**
+ * @brief  Function to deregister a interrupt
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       int HwiOSAL_deregisterInterrupt(void* hwiPtr)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt handler
+ *
+ *  <b> Return Value </b>
+ *  @n  status of operation
+ */
+#define GPMC_osalHardwareIntDestruct(X)  (HwiP_delete(X))
+
+/**
+ * @brief  Function to register an interrupt
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       HwiP_Handle HwiP_create(X, Y, Z);
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt number
+ *
+ *  <b> Parameter </b>
+ *  @n  hwiFxn entry function of the hardware interrupt
+ *
+ *  <b> Parameter </b>
+ *  @n  params  argument passed into the entry function
+ *
+ *  <b> Return Value </b>
+ *  @n  Interrupt handle
+ */
+#define GPMC_osalRegisterInterrupt(X,Y,Z)     (HwiP_create((X),(Y),(Z)))
+
+/**
+ * @brief  Function to initialize hardware interrupt parameters.
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void HwiP_Params_init(HwiP_Params *params)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Parameters   Pointer to the hardware interrupt's parameter structure.
+ *
+ */
+#define GPMC_osalHwiParamsInit(X)             (HwiP_Params_init(X))
+
+/**
+ * @brief  Function to disable specific hardware interrupt
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void HwiOSAL_disableInterrupt(unsigned int intrNum)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt number
+ *
+ */
+#define GPMC_osalHardwareIntrDisable(X)    (HwiP_disableInterrupt(X))
+
+/**
+ * @brief  Function to enable specific hardware interrupt
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void HwiOSAL_enableInterrupt(unsigned int intrNum)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt number
+ *
+ */
+#define GPMC_osalHardwareIntrEnable(X)     (HwiP_enableInterrupt(X))
+
+/**
+ * @brief  Function to clear specific hardware interrupt
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void GPMC_osalHardwareIntrClear(unsigned int intrNum)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt number
+ *
+ */
+#define GPMC_osalHardwareIntrClear(X)    (HwiP_clearInterrupt(X))
+
+/**
+ * @brief  Function to Setup Interrupt Controller Mux
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void MuxIntcP_create(MuxIntcP_inParams *inParams, MuxIntcP_outParams *outParams)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Pointer to the instance configuration input parameters.
+ *
+ *  <b> Parameter </b>
+ *  @n  Pointer to the instance configuration output parameters.
+ *
+ */
+#define GPMC_osalMuxIntcSetup(X, Y)         (MuxIntcP_create((X), (Y)))
+
+/**
+ * @brief  Function to enable Intc Mux system event
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void MuxIntcP_enableInEvent(int32_t muxNum, int32_t muxInEvent)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt Controller mux number
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt Controller mux input event ID
+ *
+ */
+#define GPMC_osalMuxIntcEnableSysInt(X, Y)  (MuxIntcP_enableInEvent((X), (Y)))
+
+/**
+ * @brief  Function to disable Intc Mux system event
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void MuxIntcP_disableInEvent(int32_t muxNum, int32_t muxInEvent)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt Controller mux number
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt Controller mux input event ID
+ *
+ */
+#define GPMC_osalMuxIntcDisableSysInt(X, Y) (MuxIntcP_disableInEvent((X), (Y)))
+
+/**
+ * @brief  Function to clear Intc Mux system event
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void MuxIntcP_clearInEvent(int cicNum, int cicEventId)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt Controller mux number
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt Controller mux input event ID
+ *
+ */
+#define GPMC_osalMuxIntcClearSysInt(X, Y)   (MuxIntcP_clearInEvent((X), (Y)))
+
+/**
+ * @brief  Function to enable Intc Mux host interrupt event
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void MuxIntcP_enableOutEvent(int32_t muxNum, int32_t muxOutEvent)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt Controller mux number
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt Controller mux output event ID
+ *
+ */
+#define GPMC_osalMuxIntcEnableHostInt(X, Y) (MuxIntcP_enableOutEvent((X), (Y)))
+
+/**
+ * @brief  Function to disable Intc Mux host interrupt event
+ *
+ * <b> Prototype: </b>
+ *  The following is the C prototype for the expected OSAL API.
+ *
+ *  @verbatim
+       void MuxIntcP_disableOutEvent(int32_t muxNum, int32_t muxOutEvent)
+    @endverbatim
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt Controller mux number
+ *
+ *  <b> Parameter </b>
+ *  @n  Interrupt Controller mux output event ID
+ *
+ */
+#define GPMC_osalMuxIntcDisableHostInt(X, Y) (MuxIntcP_disableOutEvent((X), (Y)))
+
+#endif /* __GPMC_OSAL_H__ */
+
diff --git a/packages/ti/drv/gpmc/src/Module.xs b/packages/ti/drv/gpmc/src/Module.xs
new file mode 100755 (executable)
index 0000000..c2bcec7
--- /dev/null
@@ -0,0 +1,92 @@
+/******************************************************************************
+ * FILE PURPOSE: GPMC Driver Source Module specification file.
+ ******************************************************************************
+ * FILE NAME: module.xs
+ *
+ * DESCRIPTION:
+ *  This file contains the module specification for the GPMC Driver
+ *
+ * Copyright (C) 2015 Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* Load the library utility. */
+var libUtility = xdc.loadCapsule ("../build/buildlib.xs");
+
+/* List of all the GPMC Driver Files */
+var gpmcSockLibFiles = [
+    "src/GPMC_drv.c",
+    "src/v1/GPMC_v1.c",
+];
+
+/**************************************************************************
+ * FUNCTION NAME : modBuild
+ **************************************************************************
+ * DESCRIPTION   :
+ *  The function is used to build the GPMC LLD Driver and to add the core
+ *  driver files to the package.
+ **************************************************************************/
+function modBuild()
+{
+    if (socs.length != 0)
+    {
+        /* Build the device independent libraries for all the targets specified. */
+        for (var targets=0; targets < socs["all"].targets.length; targets++)
+        {
+            var targetFiles = gpmcSockLibFiles.slice(); /* make copy */
+            var libOptions = {
+                copts: socs["all"].copts,
+                incs:  lldIncludePath, 
+            };
+            libUtility.buildLibrary ("",  "false", "false", libOptions, Pkg.name, socs["all"].targets[targets], targetFiles);
+            libUtility.buildLibrary ("",  "false", "false", libOptions, Pkg.name, socs["all"].targets[targets], targetFiles, true);
+        }
+        
+        /* Build library targets for device dependent SoCs */
+        for (var soc=0; soc < soc_names.length; soc++) 
+        {
+            var dev = socs[soc_names[soc]];
+            
+            /* do not proceed if this SoC is not configured to be built */
+            if (dev.build == "false")
+               continue;
+
+            var soc_name = soc_names[soc];
+            if ( soc_name.equals("k2k") )
+                soc_name = "k2h";
+
+            if (dev.socDevLib == "true")
+            { 
+                var targetFiles_soc = gpmcSockLibFiles.slice(); /* make copy */
+
+                targetFiles_soc.push (deviceConstruct[0]+soc_name+deviceConstruct[1]);
+                /* Build the libraries for all the targets specified. */
+                for (var targets=0; targets < dev.targets.length; targets++)
+                {
+                    var libOptions = {
+                        copts: dev.copts,
+                        incs:  lldIncludePath, 
+                    };
+                    libUtility.buildLibrary (soc_names[soc], "false", "true", libOptions, Pkg.name, dev.targets[targets], targetFiles_soc);
+                    libUtility.buildLibrary (soc_names[soc], "false", "true", libOptions, Pkg.name, dev.targets[targets], targetFiles_soc, true);
+                }
+             }
+        }
+    }
+
+    /* Add all the .c files to the release package. */
+    var testFiles = libUtility.listAllFiles (".c", "src", true);
+    for (var k = 0 ; k < testFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
+
+    /* Add all the .h files to the release package. */
+    var testFiles = libUtility.listAllFiles (".h", "src", true);
+    for (var k = 0 ; k < testFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
+
+    /* Add all the .mk files to the release package. */
+    var mkFiles = libUtility.listAllFiles (".mk", "src", true);
+    for (var k = 0 ; k < mkFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = mkFiles[k];
+
+}
+
diff --git a/packages/ti/drv/gpmc/src/V1/GPMC_v1.c b/packages/ti/drv/gpmc/src/V1/GPMC_v1.c
new file mode 100755 (executable)
index 0000000..98fb5ee
--- /dev/null
@@ -0,0 +1,984 @@
+/**
+ *  \file   GPMC_v1.c
+ *
+ *  \brief  GPMC IP Version 1 specific driver APIs implementation.
+ *
+ *   This file contains the driver APIs for GPMC controller.
+ */
+
+/*
+ * Copyright (C) 2014-2016 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdint.h>
+#include <stddef.h>
+#include <stdbool.h>
+#include <ti/csl/hw_types.h>
+#include <ti/drv/gpmc/src/V1/GPMC_v1.h>
+#include <ti/drv/gpmc/src/GPMC_osal.h>
+
+
+/* GPMC AM57x functions */
+static void GPMC_init_v1(GPMC_Handle handle);
+static GPMC_Handle GPMC_open_v1(GPMC_Handle handle, const GPMC_Params *params);
+static void GPMC_close_v1(GPMC_Handle handle);
+static bool GPMC_transfer_v1(GPMC_Handle handle, GPMC_Transaction *transaction);
+static int32_t GPMC_control_v1(GPMC_Handle handle, uint32_t cmd, void *arg);
+
+/* GPMC function table for GPMC AM57x implementation */
+const GPMC_FxnTable GPMC_FxnTable_v1 = {
+    &GPMC_init_v1,
+    &GPMC_open_v1,
+    &GPMC_close_v1,
+    &GPMC_transfer_v1,
+    &GPMC_control_v1
+};
+
+/*
+ *  ======== GPMC_init_v1 ========
+ */
+static void GPMC_init_v1(GPMC_Handle handle)
+{
+    /* Input parameter validation */
+    OSAL_Assert(handle == NULL);
+
+    /* Mark the object as available */
+    ((GPMC_v1_Object *)(handle->object))->isOpen = (bool)false;
+    return;
+}
+
+/*
+ *  ======== GPMC_transferCallback_v1 ========
+ */
+static void GPMC_transferCallback_v1(GPMC_Handle handle, GPMC_Transaction *msg)
+{
+    GPMC_v1_Object   *object; /* GPMC object */
+
+    /* Input parameter validation */
+    OSAL_Assert(handle == NULL);
+
+    /* Get the pointer to the object */
+    object = handle->object;
+
+    /* Indicate transfer complete */
+    GPMC_osalPostLock(object->transferComplete);
+}
+
+/*
+ *  ======== GPMC_hwiFxn_v1 ========
+ *  Hwi interrupt handler to service the GPMC peripheral
+ *
+ *  The handler is a generic handler for a GPMC object.
+ */
+static void GPMC_hwiFxn_v1(uintptr_t arg)
+{
+    //GPMC_v1_Object        *object = NULL;
+    GPMC_v1_HwAttrs const *hwAttrs = NULL;
+
+    /* Input parameter validation */
+    OSAL_Assert(NULL == (void *)arg);
+
+    /* Get the pointer to the object and hwAttrs */
+    //object = ((GPMC_Handle)arg)->object;
+    hwAttrs = ((GPMC_Handle)arg)->hwAttrs;
+
+    if (hwAttrs->intcMuxNum != INVALID_INTC_MUX_NUM)
+    {
+        GPMC_osalMuxIntcDisableHostInt(hwAttrs->intcMuxNum, hwAttrs->intcMuxOutEvent);
+        GPMC_osalMuxIntcClearSysInt(hwAttrs->intcMuxNum, hwAttrs->intcMuxInEvent);
+    }
+
+    /* TBD */
+
+    if (hwAttrs->intcMuxNum != INVALID_INTC_MUX_NUM)
+    {
+        GPMC_osalMuxIntcClearSysInt(hwAttrs->intcMuxNum, hwAttrs->intcMuxInEvent);
+        GPMC_osalHardwareIntrClear(hwAttrs->intrNum);
+        GPMC_osalMuxIntcEnableHostInt(hwAttrs->intcMuxNum, hwAttrs->intcMuxOutEvent);
+    }
+}
+
+static void GPMCIntDisableAll(uint32_t baseAddr)
+{
+       GPMCIntDisable(baseAddr, GPMC_FIFOEVENT_INT);
+       GPMCIntDisable(baseAddr, GPMC_TERMINALCOUNT_INT);
+       GPMCIntDisable(baseAddr, GPMC_WAIT0EDGEDETECTION_INT);
+       GPMCIntDisable(baseAddr, GPMC_WAIT1EDGEDETECTION_INT);
+}
+
+static void GPMCIntEnableAll(uint32_t baseAddr)
+{
+       GPMCIntEnable(baseAddr, GPMC_FIFOEVENT_INT);
+       GPMCIntEnable(baseAddr, GPMC_TERMINALCOUNT_INT);
+       GPMCIntEnable(baseAddr, GPMC_WAIT0EDGEDETECTION_INT);
+       GPMCIntEnable(baseAddr, GPMC_WAIT1EDGEDETECTION_INT);
+}
+
+static void GPMCIntClearAll(uint32_t baseAddr)
+{
+       GPMCIntStatusClear(baseAddr, GPMC_FIFOEVENT_INT);
+       GPMCIntStatusClear(baseAddr, GPMC_TERMINALCOUNT_INT);
+       GPMCIntStatusClear(baseAddr, GPMC_WAIT0EDGEDETECTION_INT);
+       GPMCIntStatusClear(baseAddr, GPMC_WAIT1EDGEDETECTION_INT);
+}
+
+/*
+ *  ======== GPMC_open_v1 ========
+ */
+static GPMC_Handle GPMC_open_v1(GPMC_Handle handle, const GPMC_Params *params)
+{
+    SemaphoreP_Params      semParams;
+    uint32_t               key;
+    GPMC_v1_Object        *object = NULL;
+    GPMC_v1_HwAttrs const *hwAttrs = NULL;
+    HwiP_Params            hwiInputParams;
+    HwiP_Fxn               hwiFxn;
+    MuxIntcP_inParams      muxInParams;
+    MuxIntcP_outParams     muxOutParams;
+    int32_t                retFlag = 0U;
+    uint32_t               timeConfig;
+
+    /* Input parameter validation */
+    OSAL_Assert(handle == NULL);
+
+    /* Get the pointer to the object and hwAttrs */
+    object = handle->object;
+    hwAttrs = handle->hwAttrs;
+
+    GPMC_osalHwiParamsInit(&hwiInputParams);
+
+    /* Determine if the device index was already opened */
+    key = GPMC_osalHardwareIntDisable();
+    if(object->isOpen == (bool)true)
+    {
+        GPMC_osalHardwareIntRestore(key);
+        handle = NULL;
+    }
+    else
+    {
+        /* Mark the handle as being used */
+        object->isOpen = (bool)true;
+        GPMC_osalHardwareIntRestore(key);
+
+        /* Store the GPMC parameters */
+        if (params == NULL)
+        {
+            /* No params passed in, so use the defaults */
+            GPMC_Params_init(&(object->gpmcParams));
+        }
+        else
+        {
+            /* Copy the params contents */
+            object->gpmcParams = *params;
+        }
+
+        /* Extract GPMC operating mode based on hwAttrs and input parameters */
+        if(GPMC_MODE_BLOCKING == object->gpmcParams.transferMode)
+        {
+            if(true == hwAttrs->intrEnable)
+            {
+                object->intrPollMode = GPMC_OPER_MODE_BLOCKING;
+            }
+            else
+            {
+                object->intrPollMode = GPMC_OPER_MODE_POLLING;
+            }
+        }
+        else
+        {
+            object->intrPollMode = GPMC_OPER_MODE_CALLBACK;
+        }
+
+        /* Extract the polling mode from hardware attributes. */
+        if(GPMC_OPER_MODE_POLLING != object->intrPollMode)
+        {
+            if (hwAttrs->intcMuxNum != INVALID_INTC_MUX_NUM)
+            {
+                /* Setup intc mux */
+                muxInParams.arg         = (uintptr_t)handle;
+                muxInParams.muxNum      = hwAttrs->intcMuxNum;
+                muxInParams.muxInEvent  = hwAttrs->intcMuxInEvent;
+                muxInParams.muxOutEvent = hwAttrs->intcMuxOutEvent;
+                muxInParams.muxIntcFxn  = (MuxIntcFxn)(&GPMC_hwiFxn_v1);
+                GPMC_osalMuxIntcSetup(&muxInParams, &muxOutParams);
+
+                hwiFxn                  = (HwiP_Fxn)muxOutParams.muxIntcFxn;
+                hwiInputParams.arg      = muxOutParams.arg;
+            }
+            else
+            {
+                hwiFxn                  = (HwiP_Fxn)(&GPMC_hwiFxn_v1);
+                hwiInputParams.arg      = (uintptr_t)handle;
+            }
+
+            /* Setup Hardware Interrupt Controller */
+            hwiInputParams.name = NULL;
+            hwiInputParams.priority = 0x20;
+#if defined (__ARM_ARCH_7A__)
+            hwiInputParams.evtId = 0; /* Event ID not used in GIC */
+            hwiInputParams.triggerSensitivity = 0x3; /* interrupt edge triggered */
+#else
+            hwiInputParams.evtId = hwAttrs->eventId;
+#endif
+            object->hwi = GPMC_osalRegisterInterrupt(hwAttrs->intrNum, hwiFxn, &hwiInputParams);
+
+            if(object->hwi == NULL)
+            {
+                GPMC_close_v1(handle);
+                handle = NULL;
+                retFlag = 1U;
+            }
+        }
+
+        if(retFlag == 0U)
+        {
+            /*
+             * Construct thread safe handles for this GPMC peripheral
+             * Semaphore to provide exclusive access to the GPMC peripheral
+             */
+            GPMC_osalSemParamsInit(&semParams);
+            semParams.mode = SemaphoreP_Mode_BINARY;
+            object->mutex = GPMC_osalCreateBlockingLock(1U, &semParams);
+
+            /*
+             * Store a callback function that posts the transfer complete
+             * semaphore for synchronous mode
+             */
+            if (object->intrPollMode == GPMC_OPER_MODE_BLOCKING)
+            {
+                /*
+                 * Semaphore to cause the waiting task to block for the GPMC
+                 * to finish
+                 */
+                object->transferComplete = GPMC_osalCreateBlockingLock(0, &semParams);
+
+                /* Store internal callback function */
+                object->gpmcParams.transferCallbackFxn = &GPMC_transferCallback_v1;
+            }
+
+            if(object->intrPollMode == GPMC_OPER_MODE_CALLBACK)
+            {
+                /* Check to see if a callback function was defined for async mode */
+                OSAL_Assert(object->gpmcParams.transferCallbackFxn == NULL);
+            }
+
+            /* Reset GPMC */
+            GPMCModuleSoftReset(hwAttrs->gpmcBaseAddr);
+            while(!GPMCModuleResetStatusGet(hwAttrs->gpmcBaseAddr));
+        }
+
+        if(retFlag == 0U)
+        {
+                       /* Set SYSCONFIG register to no idle mode */
+            GPMCIdleModeSelect(hwAttrs->gpmcBaseAddr, GPMC_IDLEMODE_NOIDLE);
+
+            /* Disable all interrupts */
+            GPMCIntDisableAll(hwAttrs->gpmcBaseAddr);
+
+            /* Timeout control disable */
+            GPMCTimeOutFeatureConfig(hwAttrs->gpmcBaseAddr, GPMC_TIMEOUTFEATURE_DISABLE);
+            GPMCTimeOutStartValSet(hwAttrs->gpmcBaseAddr, 0);
+
+            /* Set the wait pin polarity */
+            GPMCWaitPinSelect(hwAttrs->gpmcBaseAddr,
+                              hwAttrs->chipSel,
+                              hwAttrs->waitPinNum);
+            GPMCWaitPinPolaritySelect(hwAttrs->gpmcBaseAddr,
+                                      hwAttrs->waitPinNum,
+                                      hwAttrs->waitPinPol);
+
+            GPMCCSConfig(hwAttrs->gpmcBaseAddr, hwAttrs->chipSel, GPMC_CS_DISABLE);
+            GPMCTimeParaGranularitySelect(hwAttrs->gpmcBaseAddr,
+                                          hwAttrs->chipSel,
+                                          hwAttrs->timeLatency);
+
+            GPMCDevTypeSelect(hwAttrs->gpmcBaseAddr, hwAttrs->chipSel, hwAttrs->devType);
+
+            GPMCDevSizeSelect(hwAttrs->gpmcBaseAddr, hwAttrs->chipSel, hwAttrs->devSize);
+
+            GPMCAddrDataMuxProtocolSelect(hwAttrs->gpmcBaseAddr,
+                                          hwAttrs->chipSel,
+                                          hwAttrs->addrDataMux);
+
+            /* by default, read/write async single access */
+            GPMCReadTypeSelect(hwAttrs->gpmcBaseAddr,
+                               hwAttrs->chipSel,
+                               GPMC_READTYPE_ASYNC);
+            GPMCWriteTypeSelect(hwAttrs->gpmcBaseAddr,
+                               hwAttrs->chipSel,
+                               GPMC_WRITETYPE_ASYNC);
+
+            GPMCAccessTypeSelect(hwAttrs->gpmcBaseAddr,
+                               hwAttrs->chipSel,
+                               GPMC_MODE_READ,
+                               GPMC_ACCESSTYPE_SINGLE);
+            GPMCAccessTypeSelect(hwAttrs->gpmcBaseAddr,
+                               hwAttrs->chipSel,
+                               GPMC_MODE_WRITE,
+                               GPMC_ACCESSTYPE_SINGLE);
+
+            /* Set chip select address */
+            GPMCBaseAddrSet(hwAttrs->gpmcBaseAddr,
+                            hwAttrs->chipSel,
+                            hwAttrs->chipSelBaseAddr >> GPMC_CS_BASE_ADDR_SHIFT);
+            GPMCMaskAddrSet(hwAttrs->gpmcBaseAddr,
+                            hwAttrs->chipSel,
+                            hwAttrs->chipSelAddrSize);
+
+            /* CONFIG2 reister timing config, no extra delay */
+            timeConfig = GPMC_CS_TIMING_CONFIG(hwAttrs->timingParams.csWrOffTime,
+                                               hwAttrs->timingParams.csRdOffTime,
+                                               GPMC_CS_EXTRA_NODELAY,
+                                               hwAttrs->timingParams.csOnTime);
+            GPMCCSTimingConfig(hwAttrs->gpmcBaseAddr,
+                               hwAttrs->chipSel,
+                               timeConfig);
+
+            /* CONFIG3 reister timing config, no extra delay */
+            timeConfig = GPMC_ADV_TIMING_CONFIG(hwAttrs->timingParams.advAadMuxWrOffTime,
+                                                hwAttrs->timingParams.advAadMuxRdOffTime,
+                                                hwAttrs->timingParams.advWrOffTime,
+                                                hwAttrs->timingParams.advRdOffTime,
+                                                GPMC_ADV_EXTRA_NODELAY,
+                                                hwAttrs->timingParams.advAadMuxOnTime,
+                                                hwAttrs->timingParams.advOnTime);
+            GPMCADVTimingConfig(hwAttrs->gpmcBaseAddr,
+                                    hwAttrs->chipSel,
+                                    timeConfig);
+
+            /* CONFIG4 reister timing config, no extra delay */
+            timeConfig = GPMC_WE_OE_TIMING_CONFIG(hwAttrs->timingParams.weOffTime,
+                                                  GPMC_WE_EXTRA_NODELAY,
+                                                  hwAttrs->timingParams.weOnTtime,
+                                                  hwAttrs->timingParams.oeAadMuxOffTime,
+                                                  hwAttrs->timingParams.oeOffTime,
+                                                  GPMC_OE_EXTRA_NODELAY,
+                                                  hwAttrs->timingParams.oeAadMuxOnTime,
+                                                  hwAttrs->timingParams.oeOnTime);
+            GPMCWEAndOETimingConfig(hwAttrs->gpmcBaseAddr,
+                                    hwAttrs->chipSel,
+                                    timeConfig);
+
+            /* CONFIG5 reister timing config */
+            timeConfig = GPMC_RDACCESS_CYCLETIME_TIMING_CONFIG(hwAttrs->timingParams.rdCycleTime,
+                                                               hwAttrs->timingParams.wrCycleTime,
+                                                               hwAttrs->timingParams.rdAccessTime,
+                                                               hwAttrs->timingParams.pageBurstAccess);
+            GPMCRdAccessAndCycleTimeTimingConfig(hwAttrs->gpmcBaseAddr,
+                                                 hwAttrs->chipSel,
+                                                 timeConfig);
+
+            /* CONFIG6 reister timing config */
+            GPMCWrAccessAndWrDataOnADMUXBusTimingConfig(hwAttrs->gpmcBaseAddr,
+                                                        hwAttrs->chipSel,
+                                                        hwAttrs->timingParams.wrAcessTime,
+                                                        hwAttrs->timingParams.wrDataOnMuxBusTime);
+
+            timeConfig = GPMC_CYCLE2CYCLE_BUSTURNAROUND_TIMING_CONFIG(hwAttrs->timingParams.cycle2CycleDelay,
+                                                                      hwAttrs->timingParams.cycleDelaySameChipSel,
+                                                                      hwAttrs->timingParams.cycleDelayDiffChipSel,
+                                                                      hwAttrs->timingParams.busTurnAroundTime);
+            GPMCycle2CycleAndTurnArndTimeTimingConfig(hwAttrs->gpmcBaseAddr,
+                                                      hwAttrs->chipSel,
+                                                      timeConfig);
+
+            GPMCCSConfig(hwAttrs->gpmcBaseAddr, hwAttrs->chipSel, GPMC_CS_ENABLE);
+        }
+    }
+    return(handle);
+}
+
+/*
+ *  ======== GPMC_close_v1 ========
+ */
+static void GPMC_close_v1(GPMC_Handle handle)
+{
+    GPMC_v1_Object        *object = NULL;
+    GPMC_v1_HwAttrs const *hwAttrs = NULL;
+
+    /* Input parameter validation */
+    OSAL_Assert(handle == NULL);
+
+    /* Get the pointer to the object and hwAttrs */
+    object = handle->object;
+    hwAttrs = handle->hwAttrs;
+
+    /* Mask I2C interrupts */
+    GPMCIntDisableAll(hwAttrs->gpmcBaseAddr);
+
+    /* Destruct the Hwi */
+    if(GPMC_OPER_MODE_POLLING != object->intrPollMode)
+    {
+        GPMC_osalHardwareIntDestruct(object->hwi);
+    }
+
+    /* Destruct the instance lock */
+    GPMC_osalDeleteBlockingLock(object->mutex);
+
+    /* Destruct the transfer completion lock */
+    if(GPMC_OPER_MODE_BLOCKING == object->intrPollMode)
+    {
+        GPMC_osalDeleteBlockingLock(object->transferComplete);
+    }
+
+    /* Open flag is set false */
+    object->isOpen = (bool)false;
+
+    return;
+}
+
+static void GPMC_ctrlNandReadData(GPMC_v1_HwAttrs const *hwAttrs,
+                                  uint8_t *pRxData,
+                                  uint32_t size)
+{
+    uint16_t *pData16 = (uint16_t *)pRxData;
+    uint8_t  *pData8 = pRxData;
+
+    while(size > 0U)
+    {
+        if(hwAttrs->devSize == GPMC_DEVICESIZE_16BITS)
+        {
+            *pData16 = HW_RD_REG16(hwAttrs->gpmcBaseAddr + GPMC_NAND_DATA_N(hwAttrs->chipSel));
+            pData16++;
+                       if (size == 1)
+            {
+                size = 0;
+            }
+                       else
+            {
+                size -= 2;
+            }
+        }
+        else
+        {
+                       *pData8 = HW_RD_REG8(hwAttrs->gpmcBaseAddr + GPMC_NAND_DATA_N(hwAttrs->chipSel));
+            pData8++;
+            size--;
+        }
+    }
+}
+
+static int32_t GPMC_nand_read_v1(GPMC_Handle handle,
+                                 const GPMC_Transaction *transaction)
+{
+    GPMC_v1_Object *object = NULL;
+    GPMC_v1_HwAttrs const *hwAttrs = NULL;
+    int32_t         retVal = 0;
+
+    /* Input parameter validation */
+    OSAL_Assert(!((handle != NULL) && (transaction != NULL)));
+
+    object = handle->object;
+    hwAttrs = handle->hwAttrs;
+
+    if(GPMC_OPER_MODE_POLLING == object->intrPollMode)
+    {
+               GPMC_ctrlNandReadData(hwAttrs, object->readBufIdx,
+                                     object->readCountIdx);
+    }
+    else
+    {
+    }
+    return(retVal);
+}
+
+static int32_t GPMC_nor_read_v1(GPMC_Handle handle,
+                                const GPMC_Transaction *transaction)
+{
+    GPMC_v1_Object        *object = NULL;
+    GPMC_v1_HwAttrs const *hwAttrs = NULL;
+    uint16_t              *pData16, *pAddr16;
+    uint8_t               *pData8, *pAddr8;
+    uint32_t               size;
+    int32_t                retVal = 0;
+
+    /* Input parameter validation */
+    OSAL_Assert(!((handle != NULL) && (transaction != NULL)));
+
+    object = handle->object;
+    hwAttrs = handle->hwAttrs;
+
+    size = object->readCountIdx;
+    pData8 = (uint8_t *)(object->readBufIdx);
+    pAddr8 = (uint8_t *)(hwAttrs->chipSelBaseAddr + transaction->offset);
+    pData16 = (uint16_t *)(object->readBufIdx);
+    pAddr16 = (uint16_t *)(hwAttrs->chipSelBaseAddr + transaction->offset);
+
+    while(size > 0U)
+    {
+        if(hwAttrs->devSize == GPMC_DEVICESIZE_16BITS)
+        {
+                       *pData16++ = *pAddr16++;
+                       if (size == 1)
+            {
+                size = 0;
+            }
+                       else
+            {
+                size -= 2;
+            }
+        }
+        else
+        {
+                       *pData8++ = *pAddr8++;
+            size--;
+        }
+    }
+    return(retVal);
+}
+
+static void GPMC_ctrlNandWriteData(GPMC_v1_HwAttrs const *hwAttrs,
+                                   uint8_t *pTxData,
+                                   uint32_t size)
+{
+    uint16_t *pData16 = (uint16_t *)pTxData;
+    uint8_t  *pData8 = pTxData;
+
+    while(size > 0U)
+    {
+        /* Check if writer buffer is empty */
+        while(!GPMCEmptyWriteBuffStatusGet(hwAttrs->gpmcBaseAddr));
+
+        if(hwAttrs->devSize == GPMC_DEVICESIZE_16BITS)
+        {
+                       HW_WR_REG16(hwAttrs->gpmcBaseAddr + GPMC_NAND_DATA_N(hwAttrs->chipSel), *pData16);
+                       pData16++;
+                       if (size == 1)
+            {
+                size = 0;
+            }
+                       else
+            {
+                size -= 2;
+            }
+        }
+        else
+        {
+            HW_WR_REG8(hwAttrs->gpmcBaseAddr + GPMC_NAND_DATA_N(hwAttrs->chipSel), *pData8);
+            pData8++;
+            size--;
+        }
+    }
+}
+
+static int32_t GPMC_nand_write_v1(GPMC_Handle handle,
+                                  const GPMC_Transaction *transaction)
+{
+    GPMC_v1_Object *object = NULL;
+    GPMC_v1_HwAttrs const *hwAttrs = NULL;
+    int32_t         retVal = 0;
+
+    /* Input parameter validation */
+    OSAL_Assert(!((handle != NULL) && (transaction != NULL)));
+
+    object = handle->object;
+    hwAttrs = handle->hwAttrs;
+
+    if(GPMC_OPER_MODE_POLLING == object->intrPollMode)
+    {
+               GPMC_ctrlNandWriteData(hwAttrs, object->writeBufIdx,
+                                      object->writeCountIdx);
+    }
+    else
+    {
+    }
+    return(retVal);
+}
+
+static int32_t GPMC_nor_write_v1(GPMC_Handle handle,
+                                 const GPMC_Transaction *transaction)
+{
+    GPMC_v1_Object        *object = NULL;
+    GPMC_v1_HwAttrs const *hwAttrs = NULL;
+    uint16_t              *pData16, *pAddr16;
+    uint8_t               *pData8, *pAddr8;
+    uint32_t               size;
+    int32_t                retVal = 0;
+
+    /* Input parameter validation */
+    OSAL_Assert(!((handle != NULL) && (transaction != NULL)));
+
+    object = handle->object;
+    hwAttrs = handle->hwAttrs;
+
+    size = object->writeCountIdx;
+    pData8 = (uint8_t *)(object->writeBufIdx);
+    pAddr8 = (uint8_t *)(hwAttrs->chipSelBaseAddr + transaction->offset);
+    pData16 = (uint16_t *)(object->writeBufIdx);
+    pAddr16 = (uint16_t *)(hwAttrs->chipSelBaseAddr + transaction->offset);
+
+    while(size > 0U)
+    {
+        if(hwAttrs->devSize == GPMC_DEVICESIZE_16BITS)
+        {
+                       *pAddr16++ = *pData16++;
+                       if (size == 1)
+            {
+                size = 0;
+            }
+                       else
+            {
+                size -= 2;
+            }
+        }
+        else
+        {
+                       *pAddr8++ = *pData8++;
+            size--;
+        }
+    }
+
+    return(retVal);
+}
+
+/*
+ *  ======== GPMC_primeTransfer_v1 =======
+ */
+static int32_t GPMC_primeTransfer_v1(GPMC_Handle handle,
+                                     const GPMC_Transaction *transaction)
+{
+    GPMC_v1_Object        *object = NULL;
+    GPMC_v1_HwAttrs const *hwAttrs = NULL;
+    int32_t                retVal = 0;
+
+    /* Input parameter validation */
+    OSAL_Assert(!((handle != NULL) && (transaction != NULL)));
+
+    /* Get the pointer to the object and hwAttrs */
+    object = handle->object;
+    hwAttrs = handle->hwAttrs;
+
+    /* Disable and clear the interrupts */
+    GPMCIntDisableAll(hwAttrs->gpmcBaseAddr);
+    GPMCIntClearAll(hwAttrs->gpmcBaseAddr);
+
+    /* Interrupt mode */
+    if(object->intrPollMode != GPMC_OPER_MODE_POLLING)
+    {
+        GPMCIntEnableAll(hwAttrs->gpmcBaseAddr);
+    }
+
+    /* Identify the direction of transfer (whether read/write) */
+    if(transaction->rxBuf)
+    {
+        if(hwAttrs->devType == GPMC_DEVICETYPE_NANDLIKE)
+        {
+            retVal = GPMC_nand_read_v1(handle, transaction);
+        }
+        else if(hwAttrs->devType == GPMC_DEVICETYPE_NORLIKE)
+        {
+            retVal = GPMC_nor_read_v1(handle, transaction);
+        }
+        else
+        {
+            retVal = -1;
+        }
+    }
+    else if(transaction->txBuf)
+    {
+        if(hwAttrs->devType == GPMC_DEVICETYPE_NANDLIKE)
+        {
+            retVal = GPMC_nand_write_v1(handle, transaction);
+        }
+        else if(hwAttrs->devType == GPMC_DEVICETYPE_NORLIKE)
+        {
+            retVal = GPMC_nor_write_v1(handle, transaction);
+        }
+        else
+        {
+            retVal = -1;
+        }
+    }
+    else
+    {
+        retVal = -1;
+    }
+
+    return(retVal);
+}
+
+static bool GPMC_transfer_v1(GPMC_Handle handle, GPMC_Transaction *transaction)
+{
+    GPMC_v1_Object        *object;      /* GPMC object */
+    GPMC_v1_HwAttrs const *hwAttrs;     /* GPMC hardware attributes */
+    bool                   ret = false; /* return value */
+
+    /* Input parameter validation */
+    OSAL_Assert(!((handle != NULL) && (transaction != NULL)));
+
+    /* Get the pointer to the object and hwAttrs */
+    object = handle->object;
+    hwAttrs = handle->hwAttrs;
+
+    /* Check if anything needs to be written or read */
+    if (0 != transaction->count)
+    {
+        /* Acquire the lock for this particular GPMC handle */
+        GPMC_osalPendLock(object->mutex, SemaphoreP_WAIT_FOREVER);
+
+        /* Book keeping of transmit and receive buffers. */
+        object->writeBufIdx = (uint8_t *)transaction->txBuf;
+        object->writeCountIdx = transaction->count;
+        object->readBufIdx =  (uint8_t *)transaction->rxBuf;
+        object->readCountIdx = transaction->count;
+
+        /*
+         * GPMC_primeTransfer_v1 is a longer process and
+         * protection is needed from the GPMC interrupt
+         */
+        if (GPMC_OPER_MODE_POLLING != object->intrPollMode)
+        {
+            GPMC_osalHardwareIntrEnable(hwAttrs->intrNum);
+        }
+
+        if (GPMC_primeTransfer_v1(handle, transaction) == 0)
+        {
+            if (object->intrPollMode == GPMC_OPER_MODE_BLOCKING)
+            {
+                GPMC_osalPendLock(object->transferComplete, SemaphoreP_WAIT_FOREVER);
+
+                /* transfer is completed and semaphore is posted. */
+            }
+            else
+            {
+                /* Always return true if in Asynchronous mode */
+            }
+
+            ret = true;
+
+            /* Release the lock for this particular GPMC handle */
+            GPMC_osalPostLock(object->mutex);
+        }
+    }
+
+    /* Return the number of bytes transferred by the I2C */
+    return (ret);
+}
+
+static void GPMC_eccSizeSet(GPMC_v1_HwAttrs const *hwAttrs,
+                            uint32_t *size)
+{
+    GPMCECCSizeValSet(hwAttrs->gpmcBaseAddr, GPMC_ECC_SIZE_0, size[0]);
+    GPMCECCSizeValSet(hwAttrs->gpmcBaseAddr, GPMC_ECC_SIZE_1, size[1]);
+}
+
+static int32_t GPMC_control_v1(GPMC_Handle handle, uint32_t cmd, void *arg)
+{
+    GPMC_v1_HwAttrs const *hwAttrs;     /* GPMC hardware attributes */
+    uint32_t              *params = (uint32_t *)arg;
+    uint32_t               dataAddr;
+    uint32_t               dataSize;
+    int32_t                retVal;
+
+    /* Input parameter validation */
+    OSAL_Assert(handle == NULL);
+
+    /* Get the pointer to the hwAttrs */
+    hwAttrs = handle->hwAttrs;
+
+    switch (cmd)
+    {
+        case GPMC_V1_CMD_GETDEVSIZE:
+        {
+            *params = hwAttrs->devSize;
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_GETDEVADDR:
+        {
+            *params = hwAttrs->chipSelBaseAddr;
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+               /* NAND device commands */
+        case GPMC_V1_CMD_SETNANDCMD:
+        {
+            HW_WR_REG8(hwAttrs->gpmcBaseAddr + GPMC_NAND_COMMAND_N(hwAttrs->chipSel),
+                       (uint8_t)(*params));
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_SETNANDADDR:
+        {
+            HW_WR_REG8(hwAttrs->gpmcBaseAddr + GPMC_NAND_ADDRESS_N(hwAttrs->chipSel),
+                       (uint8_t)(*params));
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_WRNANDDATA:
+        {
+                       dataAddr = *params++;
+                       dataSize = *params;
+
+            GPMC_ctrlNandWriteData(hwAttrs, (uint8_t *)dataAddr, dataSize);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_RDNANDDATA:
+        {
+                       dataAddr = *params++;
+                       dataSize = *params;
+
+            GPMC_ctrlNandReadData(hwAttrs, (uint8_t *)dataAddr, dataSize);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_GETWAITPINSTATUS:
+        {
+            *params = GPMCWaitPinStatusGet(hwAttrs->gpmcBaseAddr, hwAttrs->waitPinNum);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_ECCCONTROL:
+        {
+            if (*params)
+            {
+                GPMCECCEnable(hwAttrs->gpmcBaseAddr);
+            }
+            else
+            {
+                GPMCECCDisable(hwAttrs->gpmcBaseAddr);
+            }
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_ECCGETINFO:
+        {
+            *params++ = hwAttrs->eccAlgo;
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_ECCSETSIZE:
+        {
+            GPMC_eccSizeSet(hwAttrs, params);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_ECCGETRESULT:
+        {
+            uint32_t eccResIdx;
+
+            eccResIdx = *params++;
+            *params = GPMCECCResultGet(hwAttrs->gpmcBaseAddr, eccResIdx);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+
+        case GPMC_V1_CMD_ECCGETBCHRESULT:
+        {
+            uint32_t eccResIdx;
+
+            eccResIdx = *params++;
+            *params = GPMCECCBCHResultGet(hwAttrs->gpmcBaseAddr,
+                                          eccResIdx, hwAttrs->chipSel);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_ELMSETSYNDFRGMT:
+        {
+            uint32_t synFrgmtId = *params++;
+            uint32_t synFrgmtVal = *params;
+
+            elmSyndromeFrgmtSet(hwAttrs->elmBaseAddr, synFrgmtId,
+                                synFrgmtVal, hwAttrs->chipSel);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_ELMSTARTERRLOCPROC:
+        {
+            elmErrLocProcessingStart(hwAttrs->elmBaseAddr, hwAttrs->chipSel);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_ELMGETINTSTATUS:
+        {
+            params[1] = elmIntStatusGet(hwAttrs->elmBaseAddr, params[0]);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_ELMCLRINTSTATUS:
+        {
+            elmIntStatusClear(hwAttrs->elmBaseAddr, *params);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_ELMGETERRLOCPROCSTATUS:
+        {
+            *params = elmErrLocProcessingStatusGet(hwAttrs->elmBaseAddr,
+                                                   hwAttrs->chipSel);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_ELMGETNUMERRS:
+        {
+            *params = elmNumOfErrsGet(hwAttrs->elmBaseAddr,
+                                      hwAttrs->chipSel);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        case GPMC_V1_CMD_ELMGETERRLOCADDR:
+        {
+            uint32_t errNum;
+
+            errNum = *params++;
+            *params = elmErrLocBitAddrGet(hwAttrs->elmBaseAddr,
+                                          errNum,
+                                          hwAttrs->chipSel);
+            retVal = GPMC_STATUS_SUCCESS;
+            break;
+        }
+
+        default:
+        retVal = GPMC_STATUS_UNDEFINEDCMD;
+        break;
+    }
+
+    return retVal;
+}
diff --git a/packages/ti/drv/gpmc/src/V1/GPMC_v1.h b/packages/ti/drv/gpmc/src/V1/GPMC_v1.h
new file mode 100755 (executable)
index 0000000..1758ca9
--- /dev/null
@@ -0,0 +1,372 @@
+/**
+ *
+ * \file    GPMC_v1.h
+ *
+ * \brief   This file contains the GPMC controller specific struct
+ *          definition, macros and function prototypes.
+ *
+ ******************************************************************************/
+
+
+/*
+ * Copyright (c) 2016, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+
+#ifndef _GPMC_V1_H_
+#define _GPMC_V1_H_
+
+#include <ti/csl/src/ip/gpmc/V1/gpmc.h>
+#include <ti/csl/src/ip/elm/V0/elm.h>
+#include <ti/drv/gpmc/GPMC.h>
+
+/*!
+ *  \brief  Get device size (bus width)
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_GETDEVSIZE           (GPMC_CMD_RESERVED + 0U)
+
+/*!
+ *  \brief  Get device chip select base address
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_GETDEVADDR           (GPMC_CMD_RESERVED + 1U)
+
+/* Below are NAND device commands */
+
+/*!
+ *  \brief  Set NAND command to GPMC controller
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_SETNANDCMD           (GPMC_CMD_RESERVED + 16U)
+
+/*!
+ *  \brief  Set NAND address to GPMC controller
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_SETNANDADDR          (GPMC_CMD_RESERVED + 17U)
+
+/*!
+ *  \brief  Write NAND DATA to GPMC controller
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_WRNANDDATA           (GPMC_CMD_RESERVED + 18U)
+
+/*!
+ *  \brief  Read NAND DATA from GPMC controller
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_RDNANDDATA           (GPMC_CMD_RESERVED + 19U)
+
+/*!
+ *  \brief  Get wait pin status from GPMC controller
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_GETWAITPINSTATUS     (GPMC_CMD_RESERVED + 20U)
+
+/*!
+ *  \brief  Enable or disable ECC
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_ECCCONTROL           (GPMC_CMD_RESERVED + 21U)
+
+/*
+ *  \brief  Get ECC configuration information
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_ECCGETINFO           (GPMC_CMD_RESERVED + 22U)
+
+/*!
+ *  \brief  Read/Write ECC size config
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_ECCSETSIZE           (GPMC_CMD_RESERVED + 23U)
+
+/*!
+ *  \brief  get ECC result
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_ECCGETRESULT         (GPMC_CMD_RESERVED + 24U)
+
+/*!
+ *  \brief  Get ECC BCH result
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_ECCGETBCHRESULT      (GPMC_CMD_RESERVED + 25U)
+
+/* Error Location Module commands */
+/*!
+ *  \brief  Sets the fragments of syndrome polynomial for
+ *          error-location processing
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_ELMSETSYNDFRGMT      (GPMC_CMD_RESERVED + 32U)
+
+/*!
+ *  \brief  Start the error-location processing
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_ELMSTARTERRLOCPROC   (GPMC_CMD_RESERVED + 33U)
+
+/*!
+ *  \brief  Get the ELM interrupt status
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_ELMGETINTSTATUS      (GPMC_CMD_RESERVED + 34U)
+
+/*!
+ *  \brief  Clear the ELM interrupt status
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_ELMCLRINTSTATUS      (GPMC_CMD_RESERVED + 35U)
+
+/*!
+ *  \brief  Get the ELM error location processing status
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_ELMGETERRLOCPROCSTATUS (GPMC_CMD_RESERVED + 36U)
+
+/*!
+ *  \brief  Get the number of errors
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_ELMGETNUMERRS        (GPMC_CMD_RESERVED + 37U)
+
+/*!
+ *  \brief  Get the ELM error location bit address
+ *
+ *  Command code used with GPMC_control()
+ */
+#define GPMC_V1_CMD_ELMGETERRLOCADDR     (GPMC_CMD_RESERVED + 38U)
+
+
+/*!
+ *  \brief  Macro which defines number of the shift bits
+ *          of the chip select base address
+ */
+#define GPMC_CS_BASE_ADDR_SHIFT  (0x18U)
+
+/*!
+ *  \brief  Macro which defines the invalid value of the interrupt mux number
+ */
+#define INVALID_INTC_MUX_NUM     (0xffffU)
+
+/*!
+ *  \brief  GPMC operation modes
+ */
+typedef enum gpmcOperMode_s {
+    GPMC_OPER_MODE_BLOCKING,
+    GPMC_OPER_MODE_POLLING,
+    GPMC_OPER_MODE_CALLBACK
+} gpmcOperMode;
+
+/*!
+ *  \brief  Nand ECC alogorithm typedef
+ */
+typedef enum GPMC_v1_nandEccAlgo_s
+{
+    GPMC_NAND_ECC_ALGO_NONE          = 0x00U,
+    GPMC_NAND_ECC_ALGO_HAMMING_1BIT,
+    GPMC_NAND_ECC_ALGO_BCH_4BIT,
+    GPMC_NAND_ECC_ALGO_BCH_8BIT,
+    GPMC_NAND_ECC_ALGO_BCH_16BIT
+
+} GPMC_v1_nandEccAlgo;
+
+
+/*!
+ *  \brief  Structure holding the timing parameters
+ */
+typedef struct GPMC_v1_timingParams
+{
+    uint32_t    csOnTime;
+    /**< Chip Select assertion time. */
+    uint32_t    csRdOffTime;
+    /**< Chip Select Read de-assertion time. */
+    uint32_t    csWrOffTime;
+    /**< Chip Select Write de-assertion time. */
+    uint32_t    advOnTime;
+    /**< ADV Assertion time. */
+    uint32_t    advRdOffTime;
+    /**< ADV Read de-assertion time. */
+    uint32_t    advWrOffTime;
+    /**< ADV Write de-assertion time. */
+    uint32_t    advAadMuxOnTime;
+    /**< ADV Assertion time in an AADMultiplexed access. */
+    uint32_t    advAadMuxRdOffTime;
+    /**< ADV Read de-assertion time in an AADMultiplexed access. */
+    uint32_t    advAadMuxWrOffTime;
+    /**< ADV Write de-assertion time in an AADMultiplexed access. */
+    uint32_t    weOnTtime;
+    /**< WE assertion time. */
+    uint32_t    weOffTime;
+    /**< WE de-assertion time. */
+    uint32_t    oeOnTime;
+    /**< OE assertion time. */
+    uint32_t    oeOffTime;
+    /**< OE de-assertion time. */
+    uint32_t    oeAadMuxOnTime;
+    /**< OE assertion time in an AADMultiplexed access. */
+    uint32_t    oeAadMuxOffTime;
+    /**< OE de-assertion time in an AADMultiplexed access. */
+    uint32_t    pageBurstAccess;
+    /**< Multiple access word delay. */
+    uint32_t    rdAccessTime;
+    /**< Start-cycle to first valid delay. */
+    uint32_t    wrAcessTime;
+    /**< Delay from StartAccessTime to the CLK rising edge. */
+    uint32_t    rdCycleTime;
+    /**< Total read cycle time. */
+    uint32_t    wrCycleTime;
+    /**< Total write cycle time. */
+    uint32_t    wrDataOnMuxBusTime;
+    /**< Write Data on Mux Bus Time. */
+    uint32_t    cycle2CycleDelay;
+    /**< Chip Select high pulse delay between two successive accesses. */
+    uint32_t    cycleDelaySameChipSel;
+    /**< Value to control adding of cycle2cycle delay between two successive
+         accesses to the same chip select. */
+    uint32_t    cycleDelayDiffChipSel;
+    /**< Value to control adding of cycle2cycle delay between two successive
+         accesses to the different chip select. */
+    uint32_t    busTurnAroundTime;
+    /**< Bus turn around time between two successive
+         accesses to the same chip-select (read to write)
+         or to a different chip-select(read to read and read to write)
+         in GPMC_FCLK cycles. */
+} GPMC_v1_timingParams_t;
+
+
+/******************************************************************************
+*          Structures to be passed to GPMC_soc
+******************************************************************************/
+
+/* GPMC function table pointer */
+extern const GPMC_FxnTable GPMC_FxnTable_v1;
+
+
+/*!
+ *  @brief  GPMC_v1 Object
+ *
+ *  The application must not access any member variables of this structure!
+ */
+typedef struct GPMC_v1_Object_s {
+    /* GPMC OS specific objects */
+    void                *mutex;              /* instance lock */
+    void                *transferComplete;   /*! Transfer complete lock */
+    void                *hwi;                /*! Hwi object */
+    uint32_t             waitTimeout;        /* Wait time out count */
+    GPMC_Params          gpmcParams;         /* input parameters */
+    GPMC_TransactionType transType;          /* Read or Write Transaction */
+    uint32_t             intrPollMode;       /* Interrupt or polling mode */
+    uint8_t             *writeBufIdx;        /* Internal inc. writeBuf index */
+    uint32_t             writeCountIdx;      /* Internal dec. writeCounter */
+    uint8_t             *readBufIdx;         /* Internal inc. readBuf index */
+    uint32_t             readCountIdx;       /* Internal dec. readCounter */
+    bool                 isOpen;             /* flag to indicate module is open */
+
+} GPMC_v1_Object;
+
+/*!
+ *  @brief  GPMC Hardware attributes
+ */
+typedef struct GPMC_v1_HwAttrs_s {
+    /*! GPMC IP V1 Peripheral base address. */
+    uint32_t                gpmcBaseAddr;
+    /*! device type, NAND or NOR like */
+    uint32_t                devType;
+    /*! device size, 8-bit, 16-bit or 32-bit bus width */
+    uint32_t                devSize;
+    /*! address and data multiplexed protocol */
+    uint32_t                addrDataMux;
+    /*! Current Active chip select in use by the memory controller */
+    uint32_t                timeLatency;
+    /*! Signals timing latencies scalar factor */
+    uint32_t                chipSel;
+    /*! Chip select base address (A29 - A24) */
+    uint32_t                chipSelBaseAddr;
+    /*! Chip select address mask size */
+    uint32_t                chipSelAddrSize;
+    /*! GPMC IP V1 Peripheral CorePac interrupt vector */
+    uint32_t                intrNum;
+    /*! GPMC IP V1 Peripheral CorePac intc event ID */
+    uint32_t                eventId;
+    /*! interrupt controller mux number.
+        K2: CIC number
+        AM: Xbar instance number
+        -1: reserved for Resource Manager */
+    int32_t                 intcMuxNum;
+    /*! interrupt controller mux input event ID.
+        K2: CIC input event;
+        AM: Xbar mux input event;
+        -1: reserved for Resource Manager */
+    int32_t                 intcMuxInEvent;
+    /*! interrupt controller mux output event ID.
+        K2: host int num, output int from CIC;
+        AM: Xbar input index;
+        -1: reserved for Resource Manager */
+    int32_t                 intcMuxOutEvent;
+    /*! Enable GPMC interrupt. */
+    bool                    intrEnable;
+    /*! Wait pin Number to which the Ready/Busy pin is connected. */
+    uint32_t                waitPinNum;
+    /*! Wait pin polarity  */
+    uint32_t                waitPinPol;
+    /*! Structure holding the timing parameters for the device. */
+    GPMC_v1_timingParams_t  timingParams;
+    /*! Error Location Module base address for ECC computation. */
+    uint32_t                elmBaseAddr;
+    /**< ECC algorithm supported by the controller. */
+    GPMC_v1_nandEccAlgo     eccAlgo;
+
+} GPMC_v1_HwAttrs;
+
+#endif  // _GPMC_V1_H_
diff --git a/packages/ti/drv/gpmc/src/src_files_common.mk b/packages/ti/drv/gpmc/src/src_files_common.mk
new file mode 100755 (executable)
index 0000000..18087b6
--- /dev/null
@@ -0,0 +1,19 @@
+#
+# This file is the makefile for building GPMC RTOS library.
+#
+#   Copyright (c) Texas Instruments Incorporated 2016
+#
+
+SRCDIR = . src src/V1
+INCDIR = . src src/V1
+# Common source files across all platforms and cores
+  SRCS_COMMON += GPMC_drv.c GPMC_v1.c
+
+PACKAGE_SRCS_COMMON = GPMC.h makefile gpmc_component.mk \
+                      docs/ReleaseNotes_GPMC_LLD.pdf \
+                      docs/GPMC_LLD_SoftwareManifest.html \
+                      src/GPMC_osal.h src/V1/GPMC_v1.h src/src_files_common.mk \
+                      build/makefile.mk build/makefile_indp.mk \
+                      build/makefile_profile.mk build/makefile_profile_indp.mk
+
+
diff --git a/packages/ti/drv/gpmc/test/Module.xs b/packages/ti/drv/gpmc/test/Module.xs
new file mode 100644 (file)
index 0000000..a1edd34
--- /dev/null
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * FILE PURPOSE: GPMC LLD unit test files.
+ ******************************************************************************
+ * FILE NAME: module.xs
+ *
+ * DESCRIPTION:
+ *  This file contains the module specification for GPMC LLD test files.
+ *
+ * Copyright (C) 2009-2012, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* Load the library utility. */
+var libUtility = xdc.loadCapsule ("../build/buildlib.xs");
+
+/**************************************************************************
+ * FUNCTION NAME : modBuild
+ **************************************************************************
+ * DESCRIPTION   :
+ *  The function is used to add all the source files in the test
+ *  directory into the package.
+ **************************************************************************/
+function modBuild()
+{
+    /* Add all the .c files to the release package. */
+    var testFiles = libUtility.listAllFiles (".c", "test", true);
+    for (var k = 0 ; k < testFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
+
+    /* Add all the .h files to the release package. */
+    var testFiles = libUtility.listAllFiles (".h", "test", true);
+    for (var k = 0 ; k < testFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
+
+    /* Add all the makefiles files to the release package. */
+    var testFiles = libUtility.listAllFiles ("makefile", "test", true);
+    for (var k = 0 ; k < testFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
+
+    /* Add all the .cmd files to the release package. */
+    var testFiles = libUtility.listAllFiles (".cmd", "test", true);
+    for (var k = 0 ; k < testFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
+
+    /* Add all the .cfg files to the release package. */
+    var testFiles = libUtility.listAllFiles (".cfg", "test", true);
+    for (var k = 0 ; k < testFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
+
+    /* Add the .txt to the package */
+    var testFiles = libUtility.listAllFiles (".txt", "test", true);
+    for (var k = 0 ; k < testFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
+}
diff --git a/packages/ti/drv/gpmc/test/am335x/armv7/bios/GPMC_Test_icev2AM335x_armTestProject.txt b/packages/ti/drv/gpmc/test/am335x/armv7/bios/GPMC_Test_icev2AM335x_armTestProject.txt
new file mode 100755 (executable)
index 0000000..8556126
--- /dev/null
@@ -0,0 +1,6 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpmc/test/src/main_gpmc_flash_test.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpmc/test/src/GPMC_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpmc/test/am335x/armv7/bios/am335x_app_icev2am335x.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -DUART_V1 -DSOC_AM335x -DICEV2_AM335X -g -gstrict-dwarf -gdwarf-3 -finstrument-functions -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/drv/gpmc -I${PDK_INSTALL_PATH} -I${EDMA3LLD_BIOS6_INSTALLDIR}/packages "  -rtsc.enableRtsc
+-ccs.setLinkerOptions " -lgcc -lrdimon -lm -lnosys -nostartfiles -static -Wl,--gc-sections -L$(BIOS_INSTALL_PATH)/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu "
+
diff --git a/packages/ti/drv/gpmc/test/am335x/armv7/bios/am335x_app_icev2am335x.cfg b/packages/ti/drv/gpmc/test/am335x/armv7/bios/am335x_app_icev2am335x.cfg
new file mode 100755 (executable)
index 0000000..dfad790
--- /dev/null
@@ -0,0 +1,263 @@
+/**
+ *  \file   am335x_app_icev2am335x.cfg
+ *
+ *  \brief  Sysbios config file for GPMC test project on AM335x ICEV2 EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 2015 - 2016 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/* ================ General configuration ================ */ 
+var Defaults = xdc.useModule('xdc.runtime.Defaults');
+var Diags = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Main = xdc.useModule('xdc.runtime.Main');
+var Memory = xdc.useModule('xdc.runtime.Memory')
+var SysMin = xdc.useModule('xdc.runtime.SysMin');
+var System = xdc.useModule('xdc.runtime.System');
+var Text = xdc.useModule('xdc.runtime.Text');
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+var Task = xdc.useModule('ti.sysbios.knl.Task');
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
+var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var Timer = xdc.useModule('ti.sysbios.hal.Timer');
+var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
+var SemihostSupport = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+
+/* 
+ * Program.argSize sets the size of the .args section. 
+ * The examples don't use command line args so argSize is set to 0.
+ */
+Program.argSize = 0x0;
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x4000;
+
+/*
+ * Uncomment this line to globally disable Asserts.
+ * All modules inherit the default from the 'Defaults' module.  You
+ * can override these defaults on a per-module basis using Module.common$. 
+ * Disabling Asserts will save code space and improve runtime performance.
+Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
+ */
+Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
+
+/*
+ * Uncomment this line to keep module names from being loaded on the target.
+ * The module name strings are placed in the .const section. Setting this
+ * parameter to false will save space in the .const section.  Error and
+ * Assert messages will contain an "unknown module" prefix instead
+ * of the actual module name.
+Defaults.common$.namedModule = false;
+ */
+Defaults.common$.namedModule = false;
+
+/*
+ * Minimize exit handler array in System.  The System module includes
+ * an array of functions that are registered with System_atexit() to be
+ * called by System_exit().
+ */
+System.maxAtexitHandlers = 4;
+
+/* 
+ * Uncomment this line to disable the Error print function.  
+ * We lose error information when this is disabled since the errors are
+ * not printed.  Disabling the raiseHook will save some code space if
+ * your app is not using System_printf() since the Error_print() function
+ * calls System_printf().
+Error.raiseHook = null;
+ */
+Error.raiseHook = null;
+/* 
+ * Uncomment this line to keep Error, Assert, and Log strings from being
+ * loaded on the target.  These strings are placed in the .const section.
+ * Setting this parameter to false will save space in the .const section.
+ * Error, Assert and Log message will print raw ids and args instead of
+ * a formatted message.
+Text.isLoaded = false;
+ */
+Text.isLoaded = false;
+/*
+ * Uncomment this line to disable the output of characters by SysMin
+ * when the program exits.  SysMin writes characters to a circular buffer.
+ * This buffer can be viewed using the SysMin Output view in ROV.
+ */
+SysMin.flushAtExit = false;
+
+/* ================ BIOS configuration ================ */
+
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+BIOS.libType = BIOS.LibType_Custom;
+BIOS.customCCOpts = BIOS.customCCOpts.replace(" -g ","");
+BIOS.assertsEnabled = false;
+BIOS.logsEnabled = false;
+BIOS.swiEnabled = false;
+
+/*
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 32000;
+
+Swi.common$.namedInstance = true;
+Program.sectionsExclude = ".*";
+
+Clock.tickPeriod = 1000;
+Hwi.dispatcherSwiSupport = true;
+Hwi.dispatcherTaskSupport = true;
+Hwi.dispatcherAutoNestingSupport = true;
+
+/* No runtime stack checking is performed */
+Task.checkStackFlag = false;
+
+
+/* Reduce the number of task priorities */
+Task.numPriorities = 4;
+
+/* ================ Task configuration ================ */
+var task0Params = new Task.Params();
+task0Params.instance.name = "echo";
+task0Params.stackSize = 0x1000;
+Program.global.echo = Task.create("&gpmc_test", task0Params);
+
+/* ================ Driver configuration ================ */
+
+var devType                     = "am335x"
+
+/* Load and use the CSL packages */
+var Csl = xdc.useModule('ti.csl.Settings');
+Csl.deviceType = devType;
+
+/* Load the i2c package */
+var I2c = xdc.useModule('ti.drv.i2c.Settings');
+I2c.socType = devType;
+
+/* Load the OSAL package */
+var osType = "tirtos";
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = devType;
+
+/* Load the gpmc package */
+var Gpmc = xdc.loadPackage('ti.drv.gpmc');
+Gpmc.Settings.enableProfiling = true;     
+Gpmc.Settings.socType = devType;
+
+/* Load Profiling package */
+var Utils = xdc.loadPackage('ti.utils.profiling');
+
+/* Load the board package */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "icev2AM335x";
+
+/* Load the uart package */
+var Uart = xdc.useModule('ti.drv.uart.Settings');
+Uart.socType = devType;
+
+
+/* ================ Cache and MMU configuration ================ */
+
+var Cache = xdc.useModule('ti.sysbios.family.arm.a8.Cache');
+Cache.enableCache = true; 
+
+var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');
+Mmu.enableMMU = true;
+
+/* Force peripheral section to be NON cacheable strongly-ordered memory */
+var peripheralAttrs = {
+    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
+    tex: 0,
+    bufferable : false,                // bufferable
+    cacheable  : false,                // cacheable
+    shareable  : false,                // shareable
+    noexecute  : true,                 // not executable
+};
+
+/* Define the base address of the 1 Meg page the peripheral resides in. */
+var norBaseAddr1 = 0x08000000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(norBaseAddr1,
+                          norBaseAddr1,
+                          peripheralAttrs);                                                      
+
+/* Define the base address of the 1 Meg page the peripheral resides in. */
+/* var norBaseAddr2 = 0x09100000; */
+var norBaseAddr2 = 0x08100000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(norBaseAddr2,
+                          norBaseAddr2,
+                          peripheralAttrs);                                                      
+
+/* Define the base address of the 1 Meg page the peripheral resides in. */
+var prcmBaseAddr = 0x44e00400;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(prcmBaseAddr,
+                          prcmBaseAddr,
+                          peripheralAttrs);
+
+                          
+/* Define the base address of the 1 Meg page the peripheral resides in. */
+var uart3BaseAddr = 0x481a6000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(uart3BaseAddr,
+                          uart3BaseAddr,
+                          peripheralAttrs);  
+
+/* Define the base address of the 1 Meg page the peripheral resides in. */
+var gpmcBaseAddr = 0x50000000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(gpmcBaseAddr,
+                          gpmcBaseAddr,
+                          peripheralAttrs);                                                      
+
+/* Define the base address of the 1 Meg page the peripheral resides in. */
+var elmBaseAddr = 0x48080000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(elmBaseAddr,
+                          elmBaseAddr,
+                          peripheralAttrs);                                                      
+
+/* ================ Task configuration ================ */                          
+/* Define and add one Task Hook Set */
+Task.addHookSet({
+       registerFxn: '&TaskRegisterId',
+       switchFxn: '&mySwitch',
+});
diff --git a/packages/ti/drv/gpmc/test/am437x/armv7/bios/GPMC_Test_evmAM437x_armTestProject.txt b/packages/ti/drv/gpmc/test/am437x/armv7/bios/GPMC_Test_evmAM437x_armTestProject.txt
new file mode 100755 (executable)
index 0000000..c7fb7ea
--- /dev/null
@@ -0,0 +1,6 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpmc/test/src/main_gpmc_flash_test.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpmc/test/src/GPMC_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpmc/test/am437x/armv7/bios/gpmc_arm_evmam437x.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a9 -mtune=cortex-a9 -march=armv7-a -marm -mfloat-abi=hard -DSOC_AM437x -DEVM_AM437X -g -gstrict-dwarf -gdwarf-3 -finstrument-functions -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/drv/gpmc -I${PDK_INSTALL_PATH} -I${EDMA3LLD_BIOS6_INSTALLDIR}/packages "  -rtsc.enableRtsc
+-ccs.setLinkerOptions " -lrdimon -lgcc -lm -lnosys -nostartfiles -static -Wl,--gc-sections -L$(BIOS_INSTALL_PATH)/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu "
+
diff --git a/packages/ti/drv/gpmc/test/am437x/armv7/bios/gpmc_arm_evmam437x.cfg b/packages/ti/drv/gpmc/test/am437x/armv7/bios/gpmc_arm_evmam437x.cfg
new file mode 100755 (executable)
index 0000000..d2b9361
--- /dev/null
@@ -0,0 +1,256 @@
+/**
+ *  \file   gpmc_arm_evmam437x.cfg
+ *
+ *  \brief  Sysbios config file for GPMC test project on AM437x GP EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 2015 - 2016 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/* ================ General configuration ================ */
+var Defaults = xdc.useModule('xdc.runtime.Defaults');
+var Diags = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Main = xdc.useModule('xdc.runtime.Main');
+var Memory = xdc.useModule('xdc.runtime.Memory')
+var SysMin = xdc.useModule('xdc.runtime.SysMin');
+var System = xdc.useModule('xdc.runtime.System');
+var Text = xdc.useModule('xdc.runtime.Text');
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+var Swi = xdc.useModule('ti.sysbios.knl.Swi');
+var Task = xdc.useModule('ti.sysbios.knl.Task');
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
+var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
+var Timer = xdc.useModule('ti.sysbios.hal.Timer');
+var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
+var SemihostSupport = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+
+/* 
+ * Program.argSize sets the size of the .args section. 
+ * The examples don't use command line args so argSize is set to 0.
+ */
+Program.argSize = 0x0;
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x4000;
+
+/*
+ * Uncomment this line to globally disable Asserts.
+ * All modules inherit the default from the 'Defaults' module.  You
+ * can override these defaults on a per-module basis using Module.common$. 
+ * Disabling Asserts will save code space and improve runtime performance.
+Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
+ */
+Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
+
+/*
+ * Uncomment this line to keep module names from being loaded on the target.
+ * The module name strings are placed in the .const section. Setting this
+ * parameter to false will save space in the .const section.  Error and
+ * Assert messages will contain an "unknown module" prefix instead
+ * of the actual module name.
+Defaults.common$.namedModule = false;
+ */
+Defaults.common$.namedModule = false;
+
+/*
+ * Minimize exit handler array in System.  The System module includes
+ * an array of functions that are registered with System_atexit() to be
+ * called by System_exit().
+ */
+System.maxAtexitHandlers = 4;
+
+/* 
+ * Uncomment this line to disable the Error print function.  
+ * We lose error information when this is disabled since the errors are
+ * not printed.  Disabling the raiseHook will save some code space if
+ * your app is not using System_printf() since the Error_print() function
+ * calls System_printf().
+Error.raiseHook = null;
+ */
+Error.raiseHook = null;
+/* 
+ * Uncomment this line to keep Error, Assert, and Log strings from being
+ * loaded on the target.  These strings are placed in the .const section.
+ * Setting this parameter to false will save space in the .const section.
+ * Error, Assert and Log message will print raw ids and args instead of
+ * a formatted message.
+Text.isLoaded = false;
+ */
+Text.isLoaded = false;
+/*
+ * Uncomment this line to disable the output of characters by SysMin
+ * when the program exits.  SysMin writes characters to a circular buffer.
+ * This buffer can be viewed using the SysMin Output view in ROV.
+ */
+SysMin.flushAtExit = false;
+
+/* ================ BIOS configuration ================ */
+
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+BIOS.libType = BIOS.LibType_Custom;
+BIOS.customCCOpts = BIOS.customCCOpts.replace(" -g ","");
+BIOS.assertsEnabled = false;
+BIOS.logsEnabled = false;
+BIOS.swiEnabled = false;
+
+/*
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 32000;
+
+Swi.common$.namedInstance = true;
+Program.sectionsExclude = ".*";
+
+Clock.tickPeriod = 1000;
+Hwi.dispatcherSwiSupport = false;
+Hwi.dispatcherTaskSupport = true;
+Hwi.dispatcherAutoNestingSupport = true;
+Hwi.initStackFlag = false;
+Hwi.checkStackFlag = false;
+
+BIOS.cpuFreq.lo = 600000000;
+
+/* No runtime stack checking is performed */
+Task.checkStackFlag = false;
+
+/* Reduce the number of task priorities */
+Task.numPriorities = 4;
+
+/* ================ Task configuration ================ */
+var task0Params = new Task.Params();
+task0Params.instance.name = "echo";
+task0Params.stackSize = 0x1000;
+Program.global.echo = Task.create("&gpmc_test", task0Params);
+
+
+/* ================ Driver configuration ================ */
+
+var devType                     = "am437x"
+
+/* Load and use the CSL packages */
+var Csl = xdc.useModule('ti.csl.Settings');
+Csl.deviceType = devType;
+
+/* Load the i2c package */
+var I2c = xdc.useModule('ti.drv.i2c.Settings');
+I2c.socType = devType;
+
+/* Load the OSAL package */
+var osType = "tirtos";
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = devType;
+
+/* Load the gpmc package */
+var Gpmc = xdc.loadPackage('ti.drv.gpmc');
+Gpmc.Settings.enableProfiling = true;     
+Gpmc.Settings.socType = devType;
+
+/* Load Profiling package */
+var Utils = xdc.loadPackage('ti.utils.profiling');
+
+/* Load the board package */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM437x";
+
+/* Load the uart package */
+var Uart = xdc.useModule('ti.drv.uart.Settings');
+Uart.socType = devType;
+
+/* ================ Cache and MMU configuration ================ */
+
+var Cache = xdc.useModule('ti.sysbios.family.arm.a9.Cache');
+Cache.enableCache = true;
+Cache.configureL2Sram = false;//DDR build
+
+var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');
+Mmu.enableMMU = true;
+
+/* Force peripheral section to be NON cacheable strongly-ordered memory */
+var peripheralAttrs = {
+    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
+    tex: 0,
+    bufferable : false,                // bufferable
+    cacheable  : false,                // cacheable
+    shareable  : false,                // shareable
+    noexecute  : true,                 // not executable
+};
+
+/* Define the base address of the 1 Meg page the peripheral resides in. */
+var prcmBaseAddr = 0x44df2800;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(prcmBaseAddr,
+                          prcmBaseAddr,
+                          peripheralAttrs);
+
+var i2c0BaseAddr = 0x44e0b000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(i2c0BaseAddr,
+                          i2c0BaseAddr,
+                          peripheralAttrs);
+
+/* Define the base address of the 1 Meg page the peripheral resides in. */
+var uart3BaseAddr = 0x481a6000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(uart3BaseAddr,
+                          uart3BaseAddr,
+                          peripheralAttrs);  
+
+/* Define the base address of the 1 Meg page the peripheral resides in. */
+var gpmcBaseAddr = 0x50000000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(gpmcBaseAddr,
+                          gpmcBaseAddr,
+                          peripheralAttrs);                                                      
+
+/* Define the base address of the 1 Meg page the peripheral resides in. */
+var elmBaseAddr = 0x48080000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(elmBaseAddr,
+                          elmBaseAddr,
+                          peripheralAttrs);    
+
+/* ================ Task configuration ================ */
+/* Define and add one Task Hook Set */
+Task.addHookSet({
+       registerFxn: '&TaskRegisterId',
+       switchFxn: '&mySwitch',
+});
diff --git a/packages/ti/drv/gpmc/test/src/GPMC_board.h b/packages/ti/drv/gpmc/test/src/GPMC_board.h
new file mode 100755 (executable)
index 0000000..fa65d44
--- /dev/null
@@ -0,0 +1,84 @@
+/**
+ *  \file   GPMC_board.h
+ *
+ *  \brief  GPMC Board header file
+ *
+ */
+
+/*
+ * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+#ifndef GPMC_BOARD_H
+#define GPMC_BOARD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined (ICEV2_AM335X)
+#include <ti/board/src/icev2AM335x/include/board_cfg.h>
+#elif defined (EVM_AM437X)
+#include <ti/board/src/evmAM437x/include/board_cfg.h>
+#else
+#endif
+
+#if defined (ICEV2_AM335X)
+#define BOARD_FLASH_ID         BOARD_FLASH_ID_MT29W160EB
+#define BOARD_FLASH_INSTANCE   BOARD_GPMC_NOR_INSTANCE
+
+/* GPMC NOR flash offset address for read/write test */
+#define TEST_ADDR_OFFSET       (0x10000U)  /* Sector 1 start address */
+/* Test read/write data length in bytes */
+#define TEST_DATA_LEN          (512U)
+
+#elif defined (EVM_AM437X)
+#define BOARD_FLASH_ID         BOARD_FLASH_ID_MT29F4G08ABAEAWP
+#define BOARD_FLASH_INSTANCE   BOARD_GPMC_NAND_INSTANCE
+
+/* GPMC NOR flash offset address for read/write test */
+#define TEST_ADDR_OFFSET       (0x40000U)  /* Block 1 start address */
+/* Test read/write data length in bytes */
+#define TEST_DATA_LEN          (4096U)
+
+#else
+#endif
+
+/* Do not enable the erase/write test */
+#undef TEST_GPMC_FLASH_WRITE
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GPMC_BOARD_H */
diff --git a/packages/ti/drv/gpmc/test/src/GPMC_log.c b/packages/ti/drv/gpmc/test/src/GPMC_log.c
new file mode 100755 (executable)
index 0000000..e2821ee
--- /dev/null
@@ -0,0 +1,69 @@
+/**
+ *  \file   SPI_log.c
+ *
+ *  \brief  This file contains the uart console print specific functions and
+ *          macros.
+ *
+ */
+
+/*
+ * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+/* XDCtools Header files */
+#include <xdc/std.h>
+#include <xdc/cfg/global.h>
+#include <xdc/runtime/System.h>
+#include <stdio.h>
+
+/* BIOS Header files */
+#include <ti/sysbios/BIOS.h>
+#include <ti/csl/hw_types.h>
+/* TI-RTOS Header files */
+#include <ti/drv/uart/UART.h>
+#include <ti/drv/uart/UART_stdio.h>
+
+
+/**********************************************************************
+ ************************** Macros ************************************
+ **********************************************************************/
+
+
+/**********************************************************************
+ ************************** Internal functions ************************
+ **********************************************************************/
+
+/**********************************************************************
+ ************************** Global Variables **************************
+ **********************************************************************/
+
diff --git a/packages/ti/drv/gpmc/test/src/GPMC_log.h b/packages/ti/drv/gpmc/test/src/GPMC_log.h
new file mode 100755 (executable)
index 0000000..e221c28
--- /dev/null
@@ -0,0 +1,77 @@
+/**
+ *  \file   GPMC_log.h
+ *
+ *  \brief  This file contains the prototypes for the log print functions. By
+            default the prints will be directed to serial console using UART.
+ *
+ */
+
+/*
+ * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef _GPMC_LOG_H
+#define _GPMC_LOG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+
+/* UART Header files */
+#include <ti/drv/uart/UART.h>
+#include <ti/drv/uart/UART_stdio.h>
+
+/**********************************************************************
+ ************************** Global Variables **************************
+ **********************************************************************/
+extern void UART_printf(const char *pcString, ...);
+extern void ConsoleUtilsInit(void);
+
+/**********************************************************************
+ ************************** Macros ************************************
+ **********************************************************************/
+/* Enable the below macro to have prints on the IO Console */
+//#define IO_CONSOLE
+
+#ifndef IO_CONSOLE
+#define GPMC_log                UART_printf
+#else
+#define GPMC_log                printf
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GPMC_LOG_H */
diff --git a/packages/ti/drv/gpmc/test/src/main_gpmc_flash_test.c b/packages/ti/drv/gpmc/test/src/main_gpmc_flash_test.c
new file mode 100755 (executable)
index 0000000..8acf2d1
--- /dev/null
@@ -0,0 +1,266 @@
+/**
+ *  \file   main_gpmc_flash_test.c
+ *
+ *  \brief  Test application main file. This application will write and read
+ *          the data to/from GPMC NOR/NAND flash through Board flash interface.
+ *
+ */
+
+/*
+ * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+/* XDCtools Header files */
+#include <xdc/std.h>
+#include <xdc/cfg/global.h>
+#include <xdc/runtime/System.h>
+
+/* BIOS Header files */
+#include <ti/sysbios/BIOS.h>
+
+/* GPMC Header files */
+#include <ti/drv/gpmc/GPMC.h>
+#include <ti/drv/gpmc/soc/GPMC_soc.h>
+#include <ti/drv/gpmc/test/src/GPMC_board.h>
+#include <ti/drv/gpmc/test/src/GPMC_log.h>
+
+/* Board Header files */
+#include <ti/board/board.h>
+#include <ti/board/src/flash/include/board_flash.h>
+
+/**********************************************************************
+ ************************** Macros ************************************
+ **********************************************************************/
+
+/**********************************************************************
+ ************************** Internal functions ************************
+ **********************************************************************/
+
+/* Function to generate known data */
+static void GeneratePattern(uint8_t *txBuf, uint8_t *rxBuf, uint32_t length);
+
+/* Data compare function */
+bool VerifyData(uint8_t *expData,
+                uint8_t *rxData,
+                uint32_t length);
+
+/**********************************************************************
+ ************************** Global Variables **************************
+ **********************************************************************/
+
+/* Buffer containing the known data that needs to be written to flash */
+uint8_t txBuf[TEST_DATA_LEN];
+
+/* Buffer containing the received data */
+uint8_t rxBuf[TEST_DATA_LEN];
+
+/*
+ *  ======== test function ========
+ */
+void gpmc_test(UArg arg0, UArg arg1)
+{
+    Board_flashHandle boardHandle;
+    Board_FlashInfo *flashInfo;
+    uint32_t blockNum, pageNum;
+    bool testPassed = true;
+
+    /* Open the Board flash device with GPMC port instance
+       and use the default GPMC configurations */
+    boardHandle = Board_flashOpen(BOARD_FLASH_ID,
+                                  BOARD_GPMC_INSTANCE, NULL);
+
+    if (!boardHandle)
+    {
+        GPMC_log("\n Board_flashOpen failed. \n");
+        testPassed = false;
+        goto err;
+    }
+    else
+    {
+        flashInfo = (Board_FlashInfo *)boardHandle;
+        GPMC_log("\n GPMC flash device ID: 0x%x, manufacturer ID: 0x%x \n",
+                flashInfo->device_id, flashInfo->manufacturer_id);
+    }
+
+    if (Board_flashOffsetToBlkPage(boardHandle, TEST_ADDR_OFFSET,
+                                   &blockNum, &pageNum))
+    {
+        GPMC_log("\n Board_flashOffsetToBlkPage failed. \n");
+        testPassed = false;
+        goto err;
+    }
+
+    /* Generate the data */
+    GeneratePattern(txBuf, rxBuf, TEST_DATA_LEN);
+
+#ifdef TEST_GPMC_FLASH_WRITE
+    /* Erase block, to which data has to be written */
+    if (Board_flashEraseBlk(boardHandle, blockNum))
+    {
+        GPMC_log("\n Board_flashEraseBlk failed. \n");
+        testPassed = false;
+        goto err;
+    }
+    GPMC_log("\n GPMC flash block erase test passed. \n");
+
+
+    /* Write buffer to flash */
+    if (Board_flashWrite(boardHandle, TEST_ADDR_OFFSET, txBuf,
+                         TEST_DATA_LEN, NULL))
+    {
+        GPMC_log("\n Board_flashWrite failed. \n");
+        testPassed = false;
+        goto err;
+    }
+    GPMC_log("\n GPMC flash write test passed. \n");
+#endif
+
+    /* Reset receive buffer */
+    if (Board_flashRead(boardHandle, TEST_ADDR_OFFSET, rxBuf,
+                        TEST_DATA_LEN, NULL))
+    {
+        GPMC_log("\n Board_flashRead failed. \n");
+        testPassed = false;
+        goto err;
+    }
+    GPMC_log("\n GPMC flash read test passed. \n");
+
+#ifndef TEST_GPMC_FLASH_WRITE
+    /* if no write test, copy rxBuf to txBuf to pass the test */
+    memcpy(txBuf, rxBuf, TEST_DATA_LEN);
+#endif
+
+    /* Verify Data */
+    if (VerifyData(txBuf, rxBuf, TEST_DATA_LEN) == false)
+    {
+        GPMC_log("\n Data mismatch. \n");
+        testPassed = false;
+    }
+
+err:
+    if (boardHandle)
+    {
+        Board_flashClose(boardHandle);
+    }
+
+    if(true == testPassed)
+    {
+        GPMC_log("\n All tests have passed. \n");
+    }
+    else
+    {
+        GPMC_log("\n Some tests have failed. \n");
+    }
+
+    while(1);
+}
+
+void GPMC_initConfig(void)
+{
+    GPMC_v1_HwAttrs gpmc_cfg;
+
+    /* Get the default UART init configurations */
+    GPMC_socGetInitCfg(BOARD_GPMC_INSTANCE, &gpmc_cfg);
+
+    /* Modify the default UART configurations if necessary */
+
+    /* Set the default UART init configurations */
+    GPMC_socSetInitCfg(BOARD_GPMC_INSTANCE, &gpmc_cfg);
+}
+
+/*
+ *  ======== main ========
+ */
+int main(void)
+{
+    /* Call board init functions */
+    Board_initCfg boardCfg;
+
+    boardCfg = BOARD_INIT_PINMUX_CONFIG |
+        BOARD_INIT_MODULE_CLOCK |
+        BOARD_INIT_UART_STDIO;
+    Board_init(boardCfg);
+
+    GPMC_initConfig();
+
+    /* Start BIOS */
+    BIOS_start();
+    return (0);
+}
+
+/*
+ *  ======== CompareData ========
+ */
+bool VerifyData(uint8_t *expData,
+                uint8_t *rxData,
+                uint32_t length)
+{
+    uint32_t idx = 0;
+    uint32_t match = 1;
+    bool retVal = false;
+
+    for(idx = 0; ((idx < length) && (match != 0)); idx++)
+    {
+        if(*expData != *rxData)
+        {
+            match = 0;
+        }
+        expData++;
+        rxData++;
+    }
+
+    if(match == 1)
+    {
+        retVal = true;
+    }
+
+    return retVal;
+}
+
+/*
+ *  ======== GeneratePattern ========
+ */
+static void GeneratePattern(uint8_t *txBuf, uint8_t *rxBuf, uint32_t length)
+{
+    volatile uint32_t idx;
+    volatile uint8_t *txPtr = txBuf;
+    volatile uint8_t *rxPtr = rxBuf;
+
+    for(idx = 0; idx < length; idx++)
+    {
+       *txPtr++ = (uint8_t)idx;
+       *rxPtr++ = (uint8_t)0U;
+    }
+}