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

Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
86 files changed:
packages/ti/fs/fatfs/.gitignore [new file with mode: 0644]
packages/ti/fs/fatfs/FATFS.h [new file with mode: 0644]
packages/ti/fs/fatfs/FATFSver.h [new file with mode: 0644]
packages/ti/fs/fatfs/FATFSver.h.xdt [new file with mode: 0644]
packages/ti/fs/fatfs/Settings.xdc.xdt [new file with mode: 0644]
packages/ti/fs/fatfs/build/buildlib.xs [new file with mode: 0644]
packages/ti/fs/fatfs/build/makefile_indp.mk [new file with mode: 0644]
packages/ti/fs/fatfs/build/makefile_mp_indp.mk [new file with mode: 0644]
packages/ti/fs/fatfs/build/makefile_profile_indp.mk [new file with mode: 0644]
packages/ti/fs/fatfs/config.bld [new file with mode: 0644]
packages/ti/fs/fatfs/config_mk.bld [new file with mode: 0644]
packages/ti/fs/fatfs/diskio.h [new file with mode: 0644]
packages/ti/fs/fatfs/docs/FATFS_LLD_SoftwareManifest.doc [new file with mode: 0644]
packages/ti/fs/fatfs/docs/FATFS_LLD_SoftwareManifest.pdf [new file with mode: 0644]
packages/ti/fs/fatfs/docs/FATFS_LLD_UserGuide.pdf [new file with mode: 0644]
packages/ti/fs/fatfs/docs/Module.xs [new file with mode: 0644]
packages/ti/fs/fatfs/docs/ReleaseNotes_FATFS_LLD.doc [new file with mode: 0644]
packages/ti/fs/fatfs/docs/ReleaseNotes_FATFS_LLD.pdf [new file with mode: 0644]
packages/ti/fs/fatfs/docs/doxyfile.xdt [new file with mode: 0644]
packages/ti/fs/fatfs/docs/tifooter.htm [new file with mode: 0644]
packages/ti/fs/fatfs/docs/tiheader.htm [new file with mode: 0644]
packages/ti/fs/fatfs/docs/tilogo.gif [new file with mode: 0644]
packages/ti/fs/fatfs/docs/titagline.gif [new file with mode: 0644]
packages/ti/fs/fatfs/example/Module.xs [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am335x/armv7/bios/FATFS_Console_evmAM335x_armExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am335x/armv7/bios/FATFS_Console_icev2AM335x_armExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am335x/armv7/bios/fatfs_evm.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am335x/armv7/bios/fatfs_icev2.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am437x/armv7/bios/FATFS_Console_evmAM437x_armExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am437x/armv7/bios/FATFS_Console_idkAM437x_armExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am437x/armv7/bios/fatfs_evm.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am437x/armv7/bios/fatfs_idk.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am571x/armv7/bios/FATFS_Console_idkAM571x_armExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am571x/armv7/bios/fatfs_idk.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am571x/c66/bios/FATFS_Console_idkAM571x_c66xExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am571x/c66/bios/fatfs_idk.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am572x/armv7/bios/FATFS_Console_MultiPartition_evmAM572x_armExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am572x/armv7/bios/FATFS_Console_evmAM572x_SMP_armExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am572x/armv7/bios/FATFS_Console_evmAM572x_armExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am572x/armv7/bios/FATFS_Console_idkAM572x_armExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am572x/armv7/bios/fatfs_evm.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am572x/armv7/bios/fatfs_idk.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am572x/c66/bios/FATFS_Console_evmAM572x_c66xExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am572x/c66/bios/FATFS_Console_idkAM572x_c66xExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am572x/c66/bios/fatfs_evm.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am572x/c66/bios/fatfs_idk.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am574x/armv7/bios/FATFS_Console_idkAM574x_armExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am574x/armv7/bios/fatfs_idk.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am574x/c66/bios/FATFS_Console_idkAM574x_c66xExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am574x/c66/bios/fatfs_idk.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am65xx/a53/fatfsConsole_a53.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am65xx/r5/fatfsConsole_r5.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/am65xx/r5/mpu.xs [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/dra7xx/armv7/bios/FATFS_Console_evmDRA72x_armExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/dra7xx/armv7/bios/FATFS_Console_evmDRA75x_armExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/dra7xx/armv7/bios/fatfs.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/dra7xx/c66/bios/FATFS_Console_evmDRA72x_c66xExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/dra7xx/c66/bios/FATFS_Console_evmDRA75x_c66xExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/dra7xx/c66/bios/FATFS_Console_evmDRA78x_c66xExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/dra7xx/c66/bios/fatfs.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/dra7xx/m4/bios/FATFS_Console_evmDRA72x_m4ExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/dra7xx/m4/bios/FATFS_Console_evmDRA75x_m4ExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/dra7xx/m4/bios/FATFS_Console_evmDRA78x_m4ExampleProject.txt [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/dra7xx/m4/bios/fatfs.cfg [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/makefile [new file with mode: 0755]
packages/ti/fs/fatfs/example/console/src/FATFS_log.c [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/src/FATFS_log.h [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/src/fs_shell_app_utils.h [new file with mode: 0644]
packages/ti/fs/fatfs/example/console/src/main_console.c [new file with mode: 0644]
packages/ti/fs/fatfs/fatfs_component.mk [new file with mode: 0644]
packages/ti/fs/fatfs/ff.h [new file with mode: 0644]
packages/ti/fs/fatfs/ffconf.h [new file with mode: 0644]
packages/ti/fs/fatfs/integer.h [new file with mode: 0644]
packages/ti/fs/fatfs/makefile [new file with mode: 0644]
packages/ti/fs/fatfs/package.bld [new file with mode: 0644]
packages/ti/fs/fatfs/package.xdc [new file with mode: 0644]
packages/ti/fs/fatfs/package.xs [new file with mode: 0644]
packages/ti/fs/fatfs/src/FATFS_drv.c [new file with mode: 0644]
packages/ti/fs/fatfs/src/FATFS_drv_log.h [new file with mode: 0644]
packages/ti/fs/fatfs/src/FATFS_osal.h [new file with mode: 0644]
packages/ti/fs/fatfs/src/Module.xs [new file with mode: 0644]
packages/ti/fs/fatfs/src/diskio.c [new file with mode: 0644]
packages/ti/fs/fatfs/src/ff.c [new file with mode: 0644]
packages/ti/fs/fatfs/src/src_files_common.mk [new file with mode: 0644]
packages/ti/fs/fatfs/temp.txt [new file with mode: 0644]

diff --git a/packages/ti/fs/fatfs/.gitignore b/packages/ti/fs/fatfs/.gitignore
new file mode 100644 (file)
index 0000000..700b267
--- /dev/null
@@ -0,0 +1,26 @@
+*.swp
+*~
+.dlls
+.executables
+.interfaces
+.libraries
+.xdcenv.mak
+Settings.h
+Settings.xdc
+build/c66/
+build/k2[heklg]/
+build/am57*/
+build/am335x/
+build/am437x/
+build/m4/
+build/armv7/
+docs/Doxyfile
+docs/doxygen/
+example/console/*/*/bios/src
+FATFSver.h
+lib/
+package.mak
+package/
+packages/
+*.o
+*.dep
diff --git a/packages/ti/fs/fatfs/FATFS.h b/packages/ti/fs/fatfs/FATFS.h
new file mode 100644 (file)
index 0000000..7708b1e
--- /dev/null
@@ -0,0 +1,421 @@
+/*
+ * 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.
+ *
+ */
+/** ============================================================================
+ *  @file       FATFS.h
+ *
+ *  @brief      FATFS interface for driver
+ *
+ *  The SD header file should be included in an application as follows:
+ *  @code
+ *  #include <ti/fs/fatfs/FATFS.h>
+ *  @endcode
+ *
+ *  ============================================================================
+ */
+
+#ifndef FATFS_H
+#define FATFS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include <ti/fs/fatfs/ff.h>
+#include <ti/fs/fatfs/diskio.h>
+
+/*@{*/
+/**
+ *  @def  FATFS_OK
+ *        FATFS return code -- Function executed successfully
+ */
+#define FATFS_OK                                        0
+
+/**
+ *  @def  FATFS_ERR
+ *        FATFS return code -- Function executed failed
+ */
+#define FATFS_ERR                                   (-(1))
+
+/**
+ *  @def  FATFS_VOLUME_FULL_ERR
+ *        FATFS return code -- VolToPart structure is full and
+ *                             no index to add more partitions
+ */
+#define FATFS_VOLUME_FULL_ERR                       (-(10))
+
+/**
+ *  @def  FATFS_VOLUME_DISK_AVL
+ *        FATFS status code -- VolToPart structure is available
+ *                             to add partitions
+ */
+#define FATFS_VOLUME_DISK_AVL                       (0)
+
+/*Offset macros of MBR table */
+/**
+ *  @def  FATFS_MBR_TABLE
+ *        MBR: Partition table offset
+ */
+#define FATFS_MBR_TABLE                             (446)
+
+/**
+ *  @def  FATFS_SZ_PTE
+ *        MBR: Size of a partition table entry
+ */
+#define FATFS_SZ_PTE                                (16)
+
+/**
+ *  @def  FATFS_NUM_OF_PARTITIONS
+ *        Number of partitions supported
+ */
+#define FATFS_NUM_OF_PARTITIONS                     (4)
+
+/**
+ *  @def  FATFS_MBR_PT_TYPE_OFFSET
+ *        Partition Type offset of each partition entry in MBR
+ */
+#define FATFS_MBR_PT_TYPE_OFFSET                    (4)
+
+/**
+ *  @def  FATFS_DFLT_VOLUME_PD
+ *        Default value of the VolToPart structure variable: partition disk
+ */
+#define FATFS_DFLT_VOLUME_PD                        (0xf)
+
+/**
+ *  @def  FATFS_DFLT_VOLUME_PT
+ *        Default value of the VolToPart structure variable: partition number
+ */
+#define FATFS_DFLT_VOLUME_PT                        (0xf)
+
+/**
+ *  @def  FATFS_MOUNT_IMMEDIATE
+ *        Value to mount the partition immediately during f_mount function call
+ */
+#define FATFS_MOUNT_IMMEDIATE                        (1)
+
+/**
+ *  @def  FATFS_MOUNT_LATER
+ *        Value to mount the partition later during f_open function call but not during f_mount function call
+ */
+#define FATFS_MOUNT_LATER                            (0)
+
+/**
+ *  @def  FATFS_MEDIA_BOOT_SEC_OFFSET
+ *        Offset of Media field in the BOOT Sector which holds the information of the device
+ *        is removable or non removable media.
+ */
+#define FATFS_MEDIA_BOOT_SEC_OFFSET                  (21)
+
+/**
+ *  @def  FATFS_JUMP_BOOT_SEC_OFFSET
+ *        Offset of the JUMP instruction field which holds the information of three byte
+ *        unconditional branch instruction.
+ */
+#define FATFS_JUMP_BOOT_SEC_OFFSET                   (0)
+
+/**
+ *  @def  FATFS_BOOT_MEDIA_TYPE_NON_REM
+ *        Standard value of Media offset in Boot sector for non removable media.
+ */
+#define FATFS_BOOT_MEDIA_TYPE_NON_REM                (0xF0)
+
+/**
+ *  @def  FATFS_BOOT_MEDIA_REM_TYPE_MIN
+ *        Legal minimum value of Media offset in Boot sector for removable media.
+ */
+#define FATFS_BOOT_MEDIA_REM_TYPE_MIN                (0xF8)
+
+/**
+ *  @def  FATFS_BOOT_MEDIA_REM_TYPE_MAX
+ *        Legal maximum value of Media offset in Boot sector for removable media.
+ */
+#define FATFS_BOOT_MEDIA_REM_TYPE_MAX                (0xFF)
+
+/**
+ *  @def  FATFS_JUMP_BOOT_SEC_JMP_INS_0
+ *        Valid JUMP INstruction code value to jump to bootstrap code.
+ */
+#define FATFS_JUMP_BOOT_SEC_JMP_INS_0                (0xEB)
+
+/**
+ *  @def  FATFS_JUMP_BOOT_SEC_JMP_INS_1
+ *        Another Valid JUMP INstruction code value to jump to bootstrap code.
+ */
+#define FATFS_JUMP_BOOT_SEC_JMP_INS_1                (0xE9)
+
+/*@}*/
+/** @} */
+
+
+
+/*!
+ *  @brief      Return status of FATFS.
+ */
+typedef int32_t                   FATFS_Error;
+
+/*!
+ *  @brief      A handle that is returned from a FATFS_open() call.
+ */
+typedef void                     *FATFS_Handle;
+
+/*!
+ *  @brief      Parameters that is required for FATFS_open() call.
+ */
+typedef void                     *FATFS_Params;
+
+/*!
+ *  @brief      A handle that is returned to open driver.
+ */
+typedef void                     *FATFS_DrvHandle;
+
+/*!
+ *  @brief      Parameters that is required to open driver.
+ */
+typedef void                     *FATFS_DrvParams;
+
+/*!
+ *  @brief      The definition of a SD function table that contains the
+ *              required set of functions to control a specific SD driver
+ *              implementation.
+ */
+typedef struct FATFS_DrvFxnTable_s  FATFS_DrvFxnTable;
+
+/*!
+ *  @brief  SD Parameters
+ *
+ *  SD parameters are used to with the FATFS_open() call. Default values for
+ *  these parameters are set using FATFS_Params_init().
+ *
+ *  @sa     FATFS_Params_init()
+ */
+typedef struct FATFS_ConfigParams_s {
+    FATFS_DrvHandle    drvHandle;       /*!< Driver Handle. */
+    FATFS_DrvParams    drvParams;       /*!< Driver Parameters. */
+    FATFS_DrvFxnTable *drvFxnTablePtr;  /*!< FATFS functional table to be
+                                             register on open. */
+    void              *custom;          /*!< Custom argument used by driver
+                                             implementation */
+} FATFS_ConfigParams;
+
+/*!
+ *  @brief      A function pointer to a driver specific implementation of
+ *              FATFS_close().
+ */
+typedef FATFS_Error (*FATFS_CloseDrvFxn) (FATFS_DrvHandle drvHandle);
+
+/*!
+ *  @brief      A function pointer to a driver specific implementation of
+ *              FATFS_control().
+ */
+typedef FATFS_Error (*FATFS_ControlDrvFxn) (FATFS_DrvHandle drvHandle,
+                                            uint32_t cmd,
+                                            void *arg);
+
+/*!
+ *  @brief      A function pointer to a driver specific implementation of
+ *              FATFS_init().
+ */
+typedef FATFS_Error (*FATFS_InitDrvFxn) (void);
+
+/*!
+ *  @brief      A function pointer to a driver specific implementation of
+ *              FATFS_open().
+ */
+typedef FATFS_Error (*FATFS_OpenDrvFxn) (uint32_t index,
+                                         FATFS_DrvParams  drvParams,
+                                         FATFS_DrvHandle *drvHandle);
+
+/*!
+ *  @brief      A function pointer to a driver specific implementation of
+ *              FATFS_transfer().
+ */
+typedef FATFS_Error (*FATFS_WriteDrvFxn) (FATFS_DrvHandle drvHandle,
+                                          uint8_t *buf,
+                                          uint32_t block,
+                                          uint32_t numBlks);
+
+/*!
+ *  @brief      A function pointer to a driver specific implementation of
+ *              FATFS_transfer().
+ */
+typedef FATFS_Error (*FATFS_ReadDrvFxn) (FATFS_DrvHandle drvHandle,
+                                         uint8_t *buf,
+                                         uint32_t block,
+                                         uint32_t numBlks);
+
+/*!
+ *  @brief      The definition of a SD function table that contains the
+ *              required set of functions to control a specific SD driver
+ *              implementation.
+ */
+struct FATFS_DrvFxnTable_s {
+    /*! Function to close the specified peripheral */
+    FATFS_CloseDrvFxn             closeDrvFxn;
+
+    /*! Function to implementation specific control function */
+    FATFS_ControlDrvFxn           controlDrvFxn;
+
+    /*! Function to initialize the given data object */
+    FATFS_InitDrvFxn              initDrvFxn;
+
+    /*! Function to open the specified peripheral */
+    FATFS_OpenDrvFxn              openDrvFxn;
+
+    /*! Function to initiate a driver data write */
+    FATFS_WriteDrvFxn             writeDrvFxn;
+
+    /*! Function to initiate a driver data read */
+    FATFS_ReadDrvFxn              readDrvFxn;
+};
+
+/* SD function table pointer */
+extern FATFS_DrvFxnTable FATFS_drvFxnTable;
+
+/*!
+ *  @brief  SDAm57x Hardware attributes
+ */
+typedef struct FATFS_HwAttrs_s {
+    uint32_t        drvInst; /*!< Driver instance if driver is not opened. */
+} FATFS_HwAttrs;
+
+/*!
+ *  @brief  SDAm572x Object
+ *
+ *  The application must not access any member variables of this structure!
+ */
+typedef struct FATFS_Object_s {
+    FATFS_DrvHandle     drvHandle;     /*!< Driver Handle. */
+    uint32_t            drvInst;       /*!< SD driver instance if SD driver is not
+                                            opened. */
+    uint32_t            driveNumber;   /*!< Drive number used by FatFs */
+    DSTATUS             diskState;     /*!< Disk status */
+    FATFS               filesystem[FATFS_NUM_OF_PARTITIONS];    /*!< FATFS data object */
+
+    FATFS_ConfigParams  FATFSConfigParams;   /*! Stores SD parameters */
+
+    uint32_t            isOpen;        /*! flag to indicate module is open */
+
+} FATFS_Object;
+
+/*!
+ *  @brief  SD Global configuration
+ *
+ *  The FATFS_Config structure contains a set of pointers used to characterize
+ *  the SD driver implementation.
+ *
+ *  This structure needs to be defined before calling FATFS_init() and it must
+ *  not be changed thereafter.
+ *
+ *  @sa     FATFS_init()
+ */
+typedef struct FATFS_Config_s {
+    /*! Pointer to a table of driver-specific implementations of SD APIs */
+    FATFS_DrvFxnTable    *drvFxnTablePtr;
+
+    /*! Pointer to a driver specific data object */
+    FATFS_Object         *object;
+
+    /*! Pointer to a driver specific hardware attributes structure */
+    FATFS_HwAttrs        *hwAttrs;
+} FATFS_Config;
+
+
+/* Avoid Misra warning "MISRA.DECL.ARRAY_SIZE" by pairing config array type 
+ * with its array size to avoid externs with [] (no size) */
+typedef FATFS_Config FATFSConfigList[((uint32_t)_VOLUMES) + (uint32_t)1U];
+
+
+/*!
+ *  @brief  Function to close a SD peripheral specified by the SD handle
+ *
+ *  @pre    FATFS_open() had to be called first.
+ *
+ *  @param  handle  A FATFS_Handle returned from FATFS_open
+ *
+ *  @sa     FATFS_open()
+ */
+extern FATFS_Error FATFS_close(FATFS_Handle handle);
+
+/*!
+ *  @brief  Function to initialize a given SD peripheral specified by the
+ *          particular index value. The parameter specifies which mode the SD
+ *          will operate.
+ *
+ *  @pre    SD controller has been initialized
+ *
+ *  @param  index         Logical peripheral number for the disk indexed into
+ *                        the FATFS_config table
+ *
+ *  @param  params        Pointer to an parameter block, if NULL it will use
+ *                        default values. All the fields in this structure are
+ *                        RO (read-only).
+ *
+ *  @param  handle        Handle to the FATFS driver which holds the hardware
+ *                        attributes and object filesystem parameters.
+ *
+ *  @return A FATFS_Handle on success or a NULL on an error or if it has been
+ *          opened already.
+ *
+ *  @sa     FATFS_init()
+ *  @sa     FATFS_close()
+ */
+extern FATFS_Error FATFS_open(uint32_t index,
+                              FATFS_Params  params,
+                              FATFS_Handle *handle);
+
+/*!
+ *  @brief  Function to initialize the FATFS_Params struct to its defaults
+ *
+ *  @param  params      An pointer to FATFS_Params structure for
+ *                      initialization
+ *
+ */
+extern FATFS_Error FATFS_Params_init(FATFS_Params params);
+
+/*!
+ *  @brief  Function to initializes the FATFS module
+ *
+ *  @pre    The FATFS_config structure must exist and be persistent before this
+ *          function can be called. This function must also be called before
+ *          any other FATFS APIs. This function call does not modify any
+ *          peripheral registers.
+ */
+extern FATFS_Error FATFS_init(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FATFS_H */
diff --git a/packages/ti/fs/fatfs/FATFSver.h b/packages/ti/fs/fatfs/FATFSver.h
new file mode 100644 (file)
index 0000000..0d7a5c4
--- /dev/null
@@ -0,0 +1,68 @@
+#ifndef _FATFSVER_H
+#define _FATFSVER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ============================================================= */
+/**
+ *   @file  FATFSver.h
+ *
+ *   path  ti/fs/fatfs/FATFSver.h
+ *
+ *   @brief  fatfs Driver Version Definitions
+ *
+ *  ============================================================
+ *  Copyright (c) Texas Instruments Incorporated 2009-Present
+ *
+ *  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 fatfs Driver Version. Versions numbers are encoded in the
+ * following format:
+ *  0xAABBCCDD -> Arch (AA); API Changes (BB); Major (CC); Minor (DD)
+ */
+#define FATFS_DRV_VERSION_ID                     (0x0100000F)
+
+/**
+ * @brief   This is the version string which describes the FATFS driver along with
+ * the date and build information.
+ */
+#define FATFS_DRV_VERSION_STR                    "fatfs Driver Revision: 01.00.00.15"
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif  /* _FATFSVER_H */
diff --git a/packages/ti/fs/fatfs/FATFSver.h.xdt b/packages/ti/fs/fatfs/FATFSver.h.xdt
new file mode 100644 (file)
index 0000000..7b11087
--- /dev/null
@@ -0,0 +1,100 @@
+%%{
+/*!
+ *  This template implements the FATFSver.h
+ */
+  /* Versioning */
+  var ver = this;
+  var ver1 = [00,00,00,00];
+  var ver2 = [00,00,00,00];
+
+  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 = "\""+"fatfs Driver Revision: "+ver1[0]+"."+ver1[1]+"."+ver1[2]+"."+ver1[3]+"\"";
+  var versionID = "(0x"+ver2[0]+ver2[1]+ver2[2]+ver2[3]+")";
+
+%%}
+#ifndef _FATFSVER_H
+#define _FATFSVER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ============================================================= */
+/**
+ *   @file  FATFSver.h
+ *
+ *   path  ti/fs/fatfs/FATFSver.h
+ *
+ *   @brief  fatfs Driver Version Definitions
+ *
+ *  ============================================================
+ *  Copyright (c) Texas Instruments Incorporated 2009-Present
+ *
+ *  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 mmcsd Driver Version. Versions numbers are encoded in the
+ * following format:
+ *  0xAABBCCDD -> Arch (AA); API Changes (BB); Major (CC); Minor (DD)
+ */
+#define FATFS_DRV_VERSION_ID                     `versionID`
+
+/**
+ * @brief   This is the version string which describes the FATFS driver along with
+ * the date and build information.
+ */
+#define FATFS_DRV_VERSION_STR                    `versionStr`
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif  /* _FATFSVER_H */
diff --git a/packages/ti/fs/fatfs/Settings.xdc.xdt b/packages/ti/fs/fatfs/Settings.xdc.xdt
new file mode 100644 (file)
index 0000000..6fb7f03
--- /dev/null
@@ -0,0 +1,36 @@
+
+%%{
+/*!
+ *  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 fatfsVersionString = `packageVersion`;
+       
+    /*! 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 Uart Settings = xdc.useModule ('ti.Uart.Settings');
+     *      UartSettings.libProfile = "debug";
+     * 
+     */
+    metaonly config string libProfile = "release";     
+}
+
diff --git a/packages/ti/fs/fatfs/build/buildlib.xs b/packages/ti/fs/fatfs/build/buildlib.xs
new file mode 100644 (file)
index 0000000..fd51571
--- /dev/null
@@ -0,0 +1,589 @@
+/******************************************************************************
+ * 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.exe 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(makelibname,targetname, objectPath)
+{
+   var tooldir;
+   var cmdprefix;
+   var targetDir;
+   var stringname=String(targetname).replace("(xdc.bld.ITarget.Module)","");
+   
+   switch(stringname)
+   {
+    case String(C66LE):
+      tooldir="C6X_GEN_INSTALL_PATH";
+      cmdprefix="";
+      targetDir="c66/release";
+      targetname=C66LE;
+      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);     
+        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 +"/"+targetDir+"/obj"); 
+    
+    }
+    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);     
+        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 +"/"+targetDir+"/obj"); 
+    }
+   
+ return libmakefile;
+
+}
+
+function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, targetName)
+{
+  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 (libOptions, libName, target, libFiles) 
+{
+    var targetDir;
+
+    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";
+    }
+    
+        
+    var lldFullLibraryPath = "./lib/" + targetDir +"/" + libName;
+    var lldFullBuildPath = "./build/" + targetDir +"/" + libName;
+    var lldFullLibraryPathMake = "$(LIBDIR)/" + targetDir +"/" + libName;
+
+    /* 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(lib+".mk",target,objectPath);  
+
+    /* 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);
+        librule += " $(COMMONSRCCOBJS)";                   
+    }
+    if(afiles.length > 0)
+    {                                                
+        makeAddObjects("COMMONSRC",makefilelib,afiles,libOptions,"asm",target);
+        librule += " $(COMMONSRCASMOBJS)";                   
+    }
+    if(safiles.length > 0)
+    {                                                
+        makeAddObjects("COMMONSRC",makefilelib,safiles,libOptions,"sa",target);
+        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/fs/fatfs/build/makefile_indp.mk b/packages/ti/fs/fatfs/build/makefile_indp.mk
new file mode 100644 (file)
index 0000000..8098c39
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# 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 $(PDK_INSTALL_PATH)/ti/build/Rules.make
+include $(PDK_FATFS_COMP_PATH)/src/src_files_common.mk
+
+MODULE_NAME = fatfs_indp
+
+# List all the external components/interfaces, whose interface header files
+#  need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = pdk
+
+ifneq ($(SOC),$(filter $(SOC), am65xx j721e))
+INCLUDE_EXTERNAL_INTERFACES += edma
+endif
+
+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
+
+# Nothing beyond this point
diff --git a/packages/ti/fs/fatfs/build/makefile_mp_indp.mk b/packages/ti/fs/fatfs/build/makefile_mp_indp.mk
new file mode 100644 (file)
index 0000000..6481570
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Copyright (c) 2018, 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 $(PDK_INSTALL_PATH)/ti/build/Rules.make
+include $(PDK_FATFS_COMP_PATH)/src/src_files_common.mk
+
+MODULE_NAME = fatfs_multi_indp
+
+# List all the external components/interfaces, whose interface header files
+#  need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = pdk
+
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) -DMULTIPARTITION
+
+# 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
+
+# Nothing beyond this point
diff --git a/packages/ti/fs/fatfs/build/makefile_profile_indp.mk b/packages/ti/fs/fatfs/build/makefile_profile_indp.mk
new file mode 100644 (file)
index 0000000..69a0d6b
--- /dev/null
@@ -0,0 +1,62 @@
+#
+# 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 $(PDK_INSTALL_PATH)/ti/build/Rules.make
+include $(PDK_FATFS_COMP_PATH)/src/src_files_common.mk
+
+MODULE_NAME = fatfs_profile_indp
+
+# List all the external components/interfaces, whose interface header files
+#  need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = pdk
+
+ifneq ($(SOC),$(filter $(SOC), am65xx j721e))
+INCLUDE_EXTERNAL_INTERFACES += edma
+endif
+
+ifeq ($(BUILDTYPE),$(filter $(BUILDTYPE), profile profiledma))
+  ifeq ($(CORE),$(filter $(CORE), a15_0 a9host a8host mpu mcu))
+    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
+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
+
+# Nothing beyond this point
diff --git a/packages/ti/fs/fatfs/config.bld b/packages/ti/fs/fatfs/config.bld
new file mode 100644 (file)
index 0000000..2f102ca
--- /dev/null
@@ -0,0 +1,89 @@
+/******************************************************************************
+ * FILE PURPOSE: Build configuration Script for the fatfs Driver
+ ******************************************************************************
+ * FILE NAME: config.bld
+ *
+ * DESCRIPTION: 
+ *  This file contains the build configuration script for the fatfs driver
+ *  and is responsible for configuration of the paths for the various 
+ *  tools required to build the driver.
+ *
+ * Copyright (C) 2014-2017, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* Get the Tools Base directory from the Environment Variable. */
+var c66ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
+var c674ToolsBaseDir = 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");
+var arm9ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_ARM9");
+
+/* Get the base directory for the fatfs Socket Driver Package */
+var driverPath = new java.io.File(".//").getPath();
+
+/* Read the part number from the environment variable. */
+var LLDPartNumber = java.lang.System.getenv("PARTNO");
+
+/* Include Path */
+var lldIncludePath = " -I" + driverPath + "/src" + " -I" + driverPath;
+
+/* Configure the fatfs 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";
+
+/* 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";
+
+/* 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 -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
+
+/* 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 -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
+
+/* 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";
+
+/* Check if we need to run the STATIC Analysis or not? */
+var coverityAnalysis = java.lang.System.getenv("STATIC_ANALYZE");
+
+/* Setup the Coverity Filters to perform Static Analysis. */
+if (coverityAnalysis == "ON") {
+    var coverityInstallPath = java.lang.System.getenv("STATIC_ANALYZE_PATH");
+    var cfgBase = xdc.getPackageBase("tisb.coverity.filters") + "cfg";
+
+    var coverityFilter = [
+    {
+        moduleName: "tisb.coverity.filters.Coverity",
+        params: {
+            cfgDir:  cfgBase,  // The Coverity configuration file directory
+            rootDir: coverityInstallPath,
+            outDir: xdc.csd() + "cov_out",
+            analyzeLibs: true
+        }
+    },
+    ];
+
+    /* Run the coverity filters on the LE Build only. */
+    C66LE.profiles["release"].filters = coverityFilter;
+}
+
+/* List all the build targets here. */
+Build.targets = [ A8LE, A9LE, C66LE, M4LE, A15LE];
diff --git a/packages/ti/fs/fatfs/config_mk.bld b/packages/ti/fs/fatfs/config_mk.bld
new file mode 100644 (file)
index 0000000..cb64190
--- /dev/null
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * FILE PURPOSE: Build configuration Script for the fatfs Driver
+ ******************************************************************************
+ * FILE NAME: config.bld
+ *
+ * DESCRIPTION: 
+ *  This file contains the build configuration script for the fatfs driver
+ *  and is responsible for configuration of the paths for the various 
+ *  tools required to build the driver.
+ *
+ * Copyright (C) 2014-2015, Texas Instruments, Inc.
+ *****************************************************************************/
+
+/* Get the Tools Base directory from the Environment Variable. */
+var c66ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
+var c674ToolsBaseDir = 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 arm9ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_ARM9");
+var a8ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A8");
+
+/* Get the base directory for the fatfs Socket Driver Package */
+var driverPath = new java.io.File(".//").getPath();
+
+/* Read the part number from the environment variable. */
+var LLDPartNumber = java.lang.System.getenv("PARTNO");
+
+/* Include Path */
+var lldIncludePath = " -I" + driverPath + "/src" + " -I" + driverPath;
+
+/* Configure the fatfs 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/fs/fatfs/diskio.h b/packages/ti/fs/fatfs/diskio.h
new file mode 100644 (file)
index 0000000..727809e
--- /dev/null
@@ -0,0 +1,107 @@
+/*-----------------------------------------------------------------------/\r
+/  Low level disk interface modlue include file   (C)ChaN, 2014          /\r
+/-----------------------------------------------------------------------*/\r
+\r
+#ifndef _DISKIO_DEFINED\r
+#define _DISKIO_DEFINED\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include "integer.h"\r
+#include <ti/csl/hw_types.h>\r
+#include <stdio.h>\r
+\r
+/* Status of Disk Functions */\r
+typedef BYTE   DSTATUS;\r
+\r
+/* Results of Disk Functions */\r
+typedef enum {\r
+       RES_OK = 0,             /* 0: Successful */\r
+       RES_ERROR,              /* 1: R/W Error */\r
+       RES_WRPRT,              /* 2: Write Protected */\r
+       RES_NOTRDY,             /* 3: Not Ready */\r
+       RES_PARERR              /* 4: Invalid Parameter */\r
+} DRESULT;\r
+\r
+\r
+/*---------------------------------------*/\r
+/* Prototypes for disk control functions */\r
+\r
+\r
+DSTATUS disk_initialize (BYTE pdrv);\r
+DSTATUS disk_status (BYTE pdrv);\r
+DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);\r
+DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);\r
+DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);\r
+\r
+\r
+/* Disk Status Bits (DSTATUS) */\r
+\r
+#define STA_NOINIT             ((uint32_t)0x01U)       /* Drive not initialized */\r
+#define STA_NODISK             ((uint32_t)0x02U)       /* No medium in the drive */\r
+#define STA_PROTECT            ((uint32_t)0x04U)       /* Write protected */\r
+\r
+\r
+/* Command code for disk_ioctrl fucntion */\r
+\r
+/* Generic command (Used by FatFs) */\r
+#define CTRL_SYNC                      0       /* Complete pending write process (needed at _FS_READONLY == 0) */\r
+#define GET_SECTOR_COUNT       1       /* Get media size (needed at _USE_MKFS == 1) */\r
+#define GET_SECTOR_SIZE                2       /* Get sector size (needed at _MAX_SS != _MIN_SS) */\r
+#define GET_BLOCK_SIZE         3       /* Get erase block size (needed at _USE_MKFS == 1) */\r
+#define CTRL_TRIM                      4       /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */\r
+\r
+/* Generic command (Not used by FatFs) */\r
+#define CTRL_POWER                     5       /* Get/Set power status */\r
+#define CTRL_LOCK                      6       /* Lock/Unlock media removal */\r
+#define CTRL_EJECT                     7       /* Eject media */\r
+#define CTRL_FORMAT                    8       /* Create physical format on the media */\r
+\r
+/* MMC/SDC specific ioctl command */\r
+#define MMC_GET_TYPE           10      /* Get card type */\r
+#define MMC_GET_CSD                    11      /* Get CSD */\r
+#define MMC_GET_CID                    12      /* Get CID */\r
+#define MMC_GET_OCR                    13      /* Get OCR */\r
+#define MMC_GET_SDSTAT         14      /* Get SD status */\r
+#define ISDIO_READ                     55      /* Read data form SD iSDIO register */\r
+#define ISDIO_WRITE                    56      /* Write data to SD iSDIO register */\r
+#define ISDIO_MRITE                    57      /* Masked write data to SD iSDIO register */\r
+\r
+/* ATA/CF specific ioctl command */\r
+#define ATA_GET_REV                    20      /* Get F/W revision */\r
+#define ATA_GET_MODEL          21      /* Get model name */\r
+#define ATA_GET_SN                     22      /* Get serial number */\r
+\r
+/*\r
+ * Updates made by Texas Instruments\r
+ *\r
+ * The following additions are needed in order to control the total number of\r
+ * volumes supported and to allow the disk_* APIs to call media specific disk\r
+ * functions which are registered in a table of type 'diskio_fxns'\r
+ */\r
+\r
+/* Disk I/O function table object, used to map media specific implementations */\r
+typedef struct {\r
+    DSTATUS (*d_init)   (BYTE drive);\r
+    DSTATUS (*d_status) (BYTE drive);\r
+    DRESULT (*d_read)   (BYTE drive, BYTE *buf, DWORD start, BYTE num);\r
+    DRESULT (*d_write)  (BYTE drive, const BYTE *buf, DWORD start, BYTE num);\r
+    DRESULT (*d_ioctl)  (BYTE drive, BYTE cmd, void * buf);\r
+} diskio_fxns;\r
+\r
+DRESULT disk_register(\r
+        BYTE drive,\r
+        DSTATUS (*d_init)  (BYTE drive),\r
+        DSTATUS (*d_status) (BYTE drive),\r
+        DRESULT (*d_read)  (BYTE drive, BYTE *buf, DWORD start, BYTE num),\r
+        DRESULT (*d_write) (BYTE drive, const BYTE *buf, DWORD start, BYTE num),\r
+        DRESULT (*d_ioctl) (BYTE drive, BYTE cmd, void * buf));\r
+\r
+DRESULT disk_unregister(BYTE drive);\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif\r
diff --git a/packages/ti/fs/fatfs/docs/FATFS_LLD_SoftwareManifest.doc b/packages/ti/fs/fatfs/docs/FATFS_LLD_SoftwareManifest.doc
new file mode 100644 (file)
index 0000000..9e56639
Binary files /dev/null and b/packages/ti/fs/fatfs/docs/FATFS_LLD_SoftwareManifest.doc differ
diff --git a/packages/ti/fs/fatfs/docs/FATFS_LLD_SoftwareManifest.pdf b/packages/ti/fs/fatfs/docs/FATFS_LLD_SoftwareManifest.pdf
new file mode 100644 (file)
index 0000000..14fd642
Binary files /dev/null and b/packages/ti/fs/fatfs/docs/FATFS_LLD_SoftwareManifest.pdf differ
diff --git a/packages/ti/fs/fatfs/docs/FATFS_LLD_UserGuide.pdf b/packages/ti/fs/fatfs/docs/FATFS_LLD_UserGuide.pdf
new file mode 100644 (file)
index 0000000..6ea92dd
Binary files /dev/null and b/packages/ti/fs/fatfs/docs/FATFS_LLD_UserGuide.pdf differ
diff --git a/packages/ti/fs/fatfs/docs/Module.xs b/packages/ti/fs/fatfs/docs/Module.xs
new file mode 100644 (file)
index 0000000..13fb80c
--- /dev/null
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * FILE PURPOSE: FATFS Driver DOCS Module specification file.
+ ******************************************************************************
+ * FILE NAME: module.xs
+ *
+ * DESCRIPTION: 
+ *  This file contains the module specification for the FATFS 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: fatfs_document_generation\n";
+    Pkg.makePrologue += "fatfs_document_generation:\n";
+    Pkg.makePrologue += "\t @echo ----------------------------\n";
+    Pkg.makePrologue += "\t @echo Generating FATFS Driver Documentation\n";
+    Pkg.makePrologue += "\t doxygen docs/Doxyfile\n";
+    Pkg.makePrologue += "\t @echo FATFS 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 FATFS Software Manifest to the package */
+    Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/FATFS_LLD_SoftwareManifest.pdf";
+
+    /* 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_FATFS_LLD.pdf";
+
+    /* 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 FATFS 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 FATFS Eclipse Plugin Generated \n";
+        Pkg.makePrologue += "\t @echo ----------------------------\n";
+    }
+}
+
diff --git a/packages/ti/fs/fatfs/docs/ReleaseNotes_FATFS_LLD.doc b/packages/ti/fs/fatfs/docs/ReleaseNotes_FATFS_LLD.doc
new file mode 100644 (file)
index 0000000..8094944
Binary files /dev/null and b/packages/ti/fs/fatfs/docs/ReleaseNotes_FATFS_LLD.doc differ
diff --git a/packages/ti/fs/fatfs/docs/ReleaseNotes_FATFS_LLD.pdf b/packages/ti/fs/fatfs/docs/ReleaseNotes_FATFS_LLD.pdf
new file mode 100644 (file)
index 0000000..d7ddedf
Binary files /dev/null and b/packages/ti/fs/fatfs/docs/ReleaseNotes_FATFS_LLD.pdf differ
diff --git a/packages/ti/fs/fatfs/docs/doxyfile.xdt b/packages/ti/fs/fatfs/docs/doxyfile.xdt
new file mode 100644 (file)
index 0000000..62915ae
--- /dev/null
@@ -0,0 +1,298 @@
+%%{\r
+/*!\r
+ *  This template implements the Doxyfile\r
+ */  \r
+  /* Versioning */\r
+  var ver = this;\r
+  var packageVersion = ver[0]+"."+ver[1]+"."+ver[2]+"."+ver[3];\r
+\r
+%%}\r
+\r
+# Doxyfile 1.5.6\r
+\r
+#---------------------------------------------------------------------------\r
+# Project related configuration options\r
+#---------------------------------------------------------------------------\r
+DOXYFILE_ENCODING      = UTF-8\r
+PROJECT_NAME           = "FATFS Low Level Driver"
+PROJECT_NUMBER         = `packageVersion`\r
+OUTPUT_DIRECTORY       = ./docs/doxygen\r
+CREATE_SUBDIRS         = NO\r
+OUTPUT_LANGUAGE        = English\r
+BRIEF_MEMBER_DESC      = YES\r
+REPEAT_BRIEF           = YES\r
+ABBREVIATE_BRIEF       = "The $name class" \\r
+                         "The $name widget" \\r
+                         "The $name file" \\r
+                         is \\r
+                         provides \\r
+                         specifies \\r
+                         contains \\r
+                         represents \\r
+                         a \\r
+                         an \\r
+                         the\r
+ALWAYS_DETAILED_SEC    = NO\r
+INLINE_INHERITED_MEMB  = NO\r
+FULL_PATH_NAMES        = NO\r
+STRIP_FROM_PATH        = \r
+STRIP_FROM_INC_PATH    = \r
+SHORT_NAMES            = NO\r
+JAVADOC_AUTOBRIEF      = NO\r
+QT_AUTOBRIEF           = NO\r
+MULTILINE_CPP_IS_BRIEF = NO\r
+INHERIT_DOCS           = YES\r
+SEPARATE_MEMBER_PAGES  = NO\r
+TAB_SIZE               = 8\r
+ALIASES                = \r
+OPTIMIZE_OUTPUT_FOR_C  = YES\r
+OPTIMIZE_OUTPUT_JAVA   = NO\r
+OPTIMIZE_FOR_FORTRAN   = NO\r
+OPTIMIZE_OUTPUT_VHDL   = NO\r
+BUILTIN_STL_SUPPORT    = NO\r
+CPP_CLI_SUPPORT        = NO\r
+SIP_SUPPORT            = NO\r
+IDL_PROPERTY_SUPPORT   = YES\r
+DISTRIBUTE_GROUP_DOC   = NO\r
+SUBGROUPING            = YES\r
+TYPEDEF_HIDES_STRUCT   = NO\r
+#---------------------------------------------------------------------------\r
+# Build related configuration options\r
+#---------------------------------------------------------------------------\r
+EXTRACT_ALL            = NO\r
+EXTRACT_PRIVATE        = NO\r
+EXTRACT_STATIC         = YES\r
+EXTRACT_LOCAL_CLASSES  = YES\r
+EXTRACT_LOCAL_METHODS  = NO\r
+EXTRACT_ANON_NSPACES   = NO\r
+HIDE_UNDOC_MEMBERS     = YES\r
+HIDE_UNDOC_CLASSES     = YES\r
+HIDE_FRIEND_COMPOUNDS  = NO\r
+HIDE_IN_BODY_DOCS      = NO\r
+INTERNAL_DOCS          = NO\r
+CASE_SENSE_NAMES       = NO\r
+HIDE_SCOPE_NAMES       = NO\r
+SHOW_INCLUDE_FILES     = YES\r
+INLINE_INFO            = YES\r
+SORT_MEMBER_DOCS       = YES\r
+SORT_BRIEF_DOCS        = NO\r
+SORT_GROUP_NAMES       = NO\r
+SORT_BY_SCOPE_NAME     = NO\r
+GENERATE_TODOLIST      = YES\r
+GENERATE_TESTLIST      = YES\r
+GENERATE_BUGLIST       = YES\r
+GENERATE_DEPRECATEDLIST= YES\r
+ENABLED_SECTIONS       = \r
+MAX_INITIALIZER_LINES  = 30\r
+SHOW_USED_FILES        = YES\r
+SHOW_FILES             = YES\r
+SHOW_NAMESPACES        = YES\r
+FILE_VERSION_FILTER    = \r
+#---------------------------------------------------------------------------\r
+# configuration options related to warning and progress messages\r
+#---------------------------------------------------------------------------\r
+QUIET                  = NO\r
+WARNINGS               = YES\r
+WARN_IF_UNDOCUMENTED   = YES\r
+WARN_IF_DOC_ERROR      = YES\r
+WARN_NO_PARAMDOC       = NO\r
+WARN_FORMAT            = "$file:$line: $text"\r
+WARN_LOGFILE           = \r
+#---------------------------------------------------------------------------\r
+# configuration options related to the input files\r
+#---------------------------------------------------------------------------\r
+INPUT                  = \r
+INPUT_ENCODING         = UTF-8\r
+FILE_PATTERNS          = *.c \\r
+                         *.cc \\r
+                         *.cxx \\r
+                         *.cpp \\r
+                         *.c++ \\r
+                         *.d \\r
+                         *.java \\r
+                         *.ii \\r
+                         *.ixx \\r
+                         *.ipp \\r
+                         *.i++ \\r
+                         *.inl \\r
+                         *.h \\r
+                         *.hh \\r
+                         *.hxx \\r
+                         *.hpp \\r
+                         *.h++ \\r
+                         *.idl \\r
+                         *.odl \\r
+                         *.cs \\r
+                         *.php \\r
+                         *.php3 \\r
+                         *.inc \\r
+                         *.m \\r
+                         *.mm \\r
+                         *.dox \\r
+                         *.py \\r
+                         *.f90 \\r
+                         *.f \\r
+                         *.vhd \\r
+                         *.vhdl\r
+RECURSIVE              = YES\r
+EXCLUDE                = YES \\r
+                         ./example \\r
+                         ./test \\r
+                         ./package \\r
+                         ./packages\r
+EXCLUDE_SYMLINKS       = NO\r
+EXCLUDE_PATTERNS       = cslr_*.h\r
+EXCLUDE_SYMBOLS        = \r
+EXAMPLE_PATH           = \r
+EXAMPLE_PATTERNS       = *\r
+EXAMPLE_RECURSIVE      = NO\r
+IMAGE_PATH             = \r
+INPUT_FILTER           = \r
+FILTER_PATTERNS        = \r
+FILTER_SOURCE_FILES    = NO\r
+#---------------------------------------------------------------------------\r
+# configuration options related to source browsing\r
+#---------------------------------------------------------------------------\r
+SOURCE_BROWSER         = NO\r
+INLINE_SOURCES         = NO\r
+STRIP_CODE_COMMENTS    = YES\r
+REFERENCED_BY_RELATION = NO\r
+REFERENCES_RELATION    = NO\r
+REFERENCES_LINK_SOURCE = YES\r
+USE_HTAGS              = NO\r
+VERBATIM_HEADERS       = NO\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the alphabetical class index\r
+#---------------------------------------------------------------------------\r
+ALPHABETICAL_INDEX     = NO\r
+COLS_IN_ALPHA_INDEX    = 5\r
+IGNORE_PREFIX          = \r
+#---------------------------------------------------------------------------\r
+# configuration options related to the HTML output\r
+#---------------------------------------------------------------------------\r
+GENERATE_HTML          = YES\r
+HTML_OUTPUT            = html\r
+HTML_FILE_EXTENSION    = .html\r
+HTML_HEADER            = ./docs/tiheader.htm\r
+HTML_FOOTER            = ./docs/tifooter.htm\r
+HTML_STYLESHEET        = \r
+GENERATE_HTMLHELP      = YES\r
+GENERATE_DOCSET        = NO\r
+DOCSET_FEEDNAME        = "Doxygen generated docs"\r
+DOCSET_BUNDLE_ID       = org.doxygen.Project\r
+HTML_DYNAMIC_SECTIONS  = NO\r
+CHM_FILE               = ..\..\fatfslldDocs.chm
+HHC_LOCATION           = hhc.exe\r
+GENERATE_CHI           = NO\r
+CHM_INDEX_ENCODING     = \r
+BINARY_TOC             = NO\r
+TOC_EXPAND             = NO\r
+DISABLE_INDEX          = NO\r
+ENUM_VALUES_PER_LINE   = 4\r
+GENERATE_TREEVIEW      = NONE\r
+TREEVIEW_WIDTH         = 250\r
+FORMULA_FONTSIZE       = 10\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the LaTeX output\r
+#---------------------------------------------------------------------------\r
+GENERATE_LATEX         = NO\r
+LATEX_OUTPUT           = latex\r
+LATEX_CMD_NAME         = latex\r
+MAKEINDEX_CMD_NAME     = makeindex\r
+COMPACT_LATEX          = NO\r
+PAPER_TYPE             = a4wide\r
+EXTRA_PACKAGES         = \r
+LATEX_HEADER           = \r
+PDF_HYPERLINKS         = YES\r
+USE_PDFLATEX           = YES\r
+LATEX_BATCHMODE        = NO\r
+LATEX_HIDE_INDICES     = NO\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the RTF output\r
+#---------------------------------------------------------------------------\r
+GENERATE_RTF           = NO\r
+RTF_OUTPUT             = rtf\r
+COMPACT_RTF            = NO\r
+RTF_HYPERLINKS         = NO\r
+RTF_STYLESHEET_FILE    = \r
+RTF_EXTENSIONS_FILE    = \r
+#---------------------------------------------------------------------------\r
+# configuration options related to the man page output\r
+#---------------------------------------------------------------------------\r
+GENERATE_MAN           = NO\r
+MAN_OUTPUT             = man\r
+MAN_EXTENSION          = .3\r
+MAN_LINKS              = NO\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the XML output\r
+#---------------------------------------------------------------------------\r
+GENERATE_XML           = NO\r
+XML_OUTPUT             = xml\r
+XML_SCHEMA             = \r
+XML_DTD                = \r
+XML_PROGRAMLISTING     = YES\r
+#---------------------------------------------------------------------------\r
+# configuration options for the AutoGen Definitions output\r
+#---------------------------------------------------------------------------\r
+GENERATE_AUTOGEN_DEF   = NO\r
+#---------------------------------------------------------------------------\r
+# configuration options related to the Perl module output\r
+#---------------------------------------------------------------------------\r
+GENERATE_PERLMOD       = NO\r
+PERLMOD_LATEX          = NO\r
+PERLMOD_PRETTY         = YES\r
+PERLMOD_MAKEVAR_PREFIX = \r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the preprocessor   \r
+#---------------------------------------------------------------------------\r
+ENABLE_PREPROCESSING   = YES\r
+MACRO_EXPANSION        = NO\r
+EXPAND_ONLY_PREDEF     = NO\r
+SEARCH_INCLUDES        = YES\r
+INCLUDE_PATH           = \r
+INCLUDE_FILE_PATTERNS  = \r
+PREDEFINED             = \r
+EXPAND_AS_DEFINED      = \r
+SKIP_FUNCTION_MACROS   = YES\r
+#---------------------------------------------------------------------------\r
+# Configuration::additions related to external references   \r
+#---------------------------------------------------------------------------\r
+TAGFILES               = \r
+GENERATE_TAGFILE       = \r
+ALLEXTERNALS           = NO\r
+EXTERNAL_GROUPS        = YES\r
+PERL_PATH              = /usr/bin/perl\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the dot tool   \r
+#---------------------------------------------------------------------------\r
+CLASS_DIAGRAMS         = NO\r
+MSCGEN_PATH            = \r
+HIDE_UNDOC_RELATIONS   = YES\r
+HAVE_DOT               = NO\r
+DOT_FONTPATH           = \r
+CLASS_GRAPH            = YES\r
+COLLABORATION_GRAPH    = YES\r
+GROUP_GRAPHS           = YES\r
+UML_LOOK               = NO\r
+TEMPLATE_RELATIONS     = NO\r
+INCLUDE_GRAPH          = YES\r
+INCLUDED_BY_GRAPH      = YES\r
+CALL_GRAPH             = NO\r
+CALLER_GRAPH           = NO\r
+GRAPHICAL_HIERARCHY    = YES\r
+DIRECTORY_GRAPH        = YES\r
+DOT_IMAGE_FORMAT       = png\r
+DOT_PATH               = \r
+DOTFILE_DIRS           = \r
+DOT_GRAPH_MAX_NODES    = 50\r
+MAX_DOT_GRAPH_DEPTH    = 1000\r
+DOT_TRANSPARENT        = YES\r
+DOT_MULTI_TARGETS      = NO\r
+GENERATE_LEGEND        = YES\r
+DOT_CLEANUP            = YES\r
+#---------------------------------------------------------------------------\r
+# Configuration::additions related to the search engine   \r
+#---------------------------------------------------------------------------\r
+SEARCHENGINE           = NO\r
+\r
+\r
diff --git a/packages/ti/fs/fatfs/docs/tifooter.htm b/packages/ti/fs/fatfs/docs/tifooter.htm
new file mode 100644 (file)
index 0000000..c35c513
--- /dev/null
@@ -0,0 +1,4 @@
+<hr size="1"><small>\r
+Copyright  $year, Texas Instruments Incorporated</small>\r
+</body>\r
+</html>\r
diff --git a/packages/ti/fs/fatfs/docs/tiheader.htm b/packages/ti/fs/fatfs/docs/tiheader.htm
new file mode 100644 (file)
index 0000000..c38e6fb
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">\r
+<title>$title</title>\r
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css">\r
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css">\r
+</head><body>\r
+<table width=100%>\r
+<tr>\r
+  <td bgcolor="black" width="1"><a href="http://www.ti.com"><img border=0 src="../../tilogo.gif"></a></td>\r
+  <td bgcolor="red"><img src="../../titagline.gif"></td>\r
+</tr>\r
+</table>\r
diff --git a/packages/ti/fs/fatfs/docs/tilogo.gif b/packages/ti/fs/fatfs/docs/tilogo.gif
new file mode 100644 (file)
index 0000000..f2fab2d
Binary files /dev/null and b/packages/ti/fs/fatfs/docs/tilogo.gif differ
diff --git a/packages/ti/fs/fatfs/docs/titagline.gif b/packages/ti/fs/fatfs/docs/titagline.gif
new file mode 100644 (file)
index 0000000..743a024
Binary files /dev/null and b/packages/ti/fs/fatfs/docs/titagline.gif differ
diff --git a/packages/ti/fs/fatfs/example/Module.xs b/packages/ti/fs/fatfs/example/Module.xs
new file mode 100644 (file)
index 0000000..313ed1c
--- /dev/null
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * FILE PURPOSE: FATFS LLD example files.
+ ******************************************************************************
+ * FILE NAME: module.xs
+ *
+ * DESCRIPTION: 
+ *  This file contains the module specification for FATFS 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 .xs files to the release package. */
+    var exampleFiles = libUtility.listAllFiles (".xs", "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/fs/fatfs/example/console/am335x/armv7/bios/FATFS_Console_evmAM335x_armExampleProject.txt b/packages/ti/fs/fatfs/example/console/am335x/armv7/bios/FATFS_Console_evmAM335x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..ddebb1b
--- /dev/null
@@ -0,0 +1,9 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am335x/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am335x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am335x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am335x/armv7/bios/fatfs_evm.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard  -DSOC_AM335x -DevmAM335x -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/fs/fatfs "  -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/fs/fatfs/example/console/am335x/armv7/bios/FATFS_Console_icev2AM335x_armExampleProject.txt b/packages/ti/fs/fatfs/example/console/am335x/armv7/bios/FATFS_Console_icev2AM335x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..379c8df
--- /dev/null
@@ -0,0 +1,9 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am335x/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am335x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am335x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am335x/armv7/bios/fatfs_icev2.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard  -DSOC_AM335x -Dicev2AM335x -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/fs/fatfs "  -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/fs/fatfs/example/console/am335x/armv7/bios/fatfs_evm.cfg b/packages/ti/fs/fatfs/example/console/am335x/armv7/bios/fatfs_evm.cfg
new file mode 100644 (file)
index 0000000..4ee659b
--- /dev/null
@@ -0,0 +1,216 @@
+/**
+ *  \file   fatfs_evm.cfg
+ *
+ *  \brief  Sysbios config file for fatfs example project on AM335x GP EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 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.
+ *
+ */
+
+/* ================ 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.assertsEnabled = false;
+BIOS.logsEnabled = false;
+BIOS.swiEnabled = false;
+BIOS.customCCOpts = BIOS.customCCOpts.replace(" -g ","");
+
+/*
+ * 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;
+
+Task.enableIdleTask = false;
+Task.initStackFlag = false;
+Task.checkStackFlag = false;
+
+
+/* ================ Driver configuration ================ */
+var socType="am335x";
+
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+/* Load the OSAL package */
+var osType = "tirtos";
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+/* Load the I2C package required by board */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+/* Load the board package */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM335x";
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+
+/* Load the uart package */
+var UartPackage = xdc.loadPackage('ti.drv.uart');
+
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+
+/* ================ 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 peripheralBaseAddr = 0x44e00400;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
+                          peripheralBaseAddr,
+                          peripheralAttrs);
+
+                          
+/* Define the base address of the 1 Meg page the peripheral resides in. */
+var peripheralBaseAddr = 0x481a6000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
+                          peripheralBaseAddr,
+                          peripheralAttrs);
diff --git a/packages/ti/fs/fatfs/example/console/am335x/armv7/bios/fatfs_icev2.cfg b/packages/ti/fs/fatfs/example/console/am335x/armv7/bios/fatfs_icev2.cfg
new file mode 100644 (file)
index 0000000..4f64ef3
--- /dev/null
@@ -0,0 +1,212 @@
+/**
+ *  \file   fatfs_icev2.cfg
+ *
+ *  \brief  Sysbios config file for fatfs example project on AM335X iceV2 EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 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.
+ *
+ */
+
+/* ================ 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.logsEnabled = false;
+BIOS.swiEnabled = false;
+BIOS.assertsEnabled = false;
+BIOS.customCCOpts = BIOS.customCCOpts.replace(" -g ","");
+
+/*
+ * 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;
+
+Task.enableIdleTask = false;
+Task.initStackFlag = false;
+Task.checkStackFlag = false;
+
+/* ================ Driver configuration ================ */
+var socType="am335x";
+
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+
+/* Load the OSAL package */
+var osType = "tirtos";
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+/* Load the I2C package required by board */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+/* Load the board package */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "icev2AM335x";
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+
+/* Load the uart package */
+var UartPackage = xdc.loadPackage('ti.drv.uart');
+
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+
+/* ================ 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 peripheralBaseAddr = 0x44e00400;;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
+                          peripheralBaseAddr,
+                          peripheralAttrs);
+
+                          
+/* Define the base address of the 1 Meg page the peripheral resides in. */
+var peripheralBaseAddr = 0x481a6000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
+                          peripheralBaseAddr,
+                          peripheralAttrs);
+                                                                               
diff --git a/packages/ti/fs/fatfs/example/console/am437x/armv7/bios/FATFS_Console_evmAM437x_armExampleProject.txt b/packages/ti/fs/fatfs/example/console/am437x/armv7/bios/FATFS_Console_evmAM437x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..222f354
--- /dev/null
@@ -0,0 +1,9 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am437x/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am437x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am437x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am437x/armv7/bios/fatfs_evm.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a9 -mtune=cortex-a9 -march=armv7-a -marm -mfloat-abi=hard -DSOC_AM437x -DevmAM437x -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/fs/fatfs "  -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/fs/fatfs/example/console/am437x/armv7/bios/FATFS_Console_idkAM437x_armExampleProject.txt b/packages/ti/fs/fatfs/example/console/am437x/armv7/bios/FATFS_Console_idkAM437x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..92dd813
--- /dev/null
@@ -0,0 +1,9 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am437x/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am437x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am437x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am437x/armv7/bios/fatfs_idk.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a9 -mtune=cortex-a9 -march=armv7-a -marm -mfloat-abi=hard -DSOC_AM437x -DidkAM437x -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/fs/fatfs "  -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/fs/fatfs/example/console/am437x/armv7/bios/fatfs_evm.cfg b/packages/ti/fs/fatfs/example/console/am437x/armv7/bios/fatfs_evm.cfg
new file mode 100644 (file)
index 0000000..755c2d3
--- /dev/null
@@ -0,0 +1,213 @@
+/**
+ *  \file   fatfs_evm.cfg
+ *
+ *  \brief  Sysbios config file for fatfs example project on AM437x GP EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 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.
+ *
+ */
+
+/* ================ 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.logsEnabled = false;
+BIOS.swiEnabled = false;
+BIOS.assertsEnabled = false;
+BIOS.customCCOpts = BIOS.customCCOpts.replace(" -g ","");
+BIOS.cpuFreq.lo = 600000000;
+/*
+ * 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;
+
+Task.enableIdleTask = false;
+Task.initStackFlag = false;
+Task.checkStackFlag = false;
+
+
+
+/* ================ Driver configuration ================ */
+var socType="am437x";
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+/* Load the OSAL package */
+var osType = "tirtos";
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+/* Load the I2C package required by board */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+
+/* Load the board package */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM437x";
+
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+
+/* Load the UART package */
+var UARTPackage = xdc.loadPackage('ti.drv.uart');
+
+/* ================ 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 peripheralBaseAddr = 0x44DF2800;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
+                          peripheralBaseAddr,
+                          peripheralAttrs);
+                          
+var peripheralBaseAddr = 0x44e0b000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
+                          peripheralBaseAddr,
+                          peripheralAttrs);
diff --git a/packages/ti/fs/fatfs/example/console/am437x/armv7/bios/fatfs_idk.cfg b/packages/ti/fs/fatfs/example/console/am437x/armv7/bios/fatfs_idk.cfg
new file mode 100644 (file)
index 0000000..a8cfc9b
--- /dev/null
@@ -0,0 +1,212 @@
+/**
+ *  \file   fatfs_idk.cfg
+ *
+ *  \brief  Sysbios config file for fatfs example project on AM437x IDK EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 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.
+ *
+ */
+
+/* ================ 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.assertsEnabled = false;
+BIOS.logsEnabled = false;
+BIOS.swiEnabled = false;
+BIOS.customCCOpts = BIOS.customCCOpts.replace(" -g ","");
+BIOS.cpuFreq.lo = 600000000;
+/*
+ * 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;
+
+Task.enableIdleTask = false;
+Task.initStackFlag = false;
+Task.checkStackFlag = false;
+
+
+
+/* ================ Driver configuration ================ */
+var socType="am437x";
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+/* Load the OSAL package */
+var osType = "tirtos";
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+/* Load the I2C package required by board */
+var I2C               = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType  = socType;
+
+/* Load the board package */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "idkAM437x";
+
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+
+/* Load the UART package */
+var UARTPackage = xdc.loadPackage('ti.drv.uart');
+
+/* ================ 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 peripheralBaseAddr = 0x44DF2800;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
+                          peripheralBaseAddr,
+                          peripheralAttrs);
+                          
+var peripheralBaseAddr = 0x44e0b000;
+
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
+                          peripheralBaseAddr,
+                          peripheralAttrs);
diff --git a/packages/ti/fs/fatfs/example/console/am571x/armv7/bios/FATFS_Console_idkAM571x_armExampleProject.txt b/packages/ti/fs/fatfs/example/console/am571x/armv7/bios/FATFS_Console_idkAM571x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..35fb2f5
--- /dev/null
@@ -0,0 +1,9 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am57xx/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am571x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am571x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am571x/armv7/bios/fatfs_idk.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -DDRA7xx -DSOC_AM571x -DidkAM571x -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/fs/fatfs "  -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/fs/fatfs/example/console/am571x/armv7/bios/fatfs_idk.cfg b/packages/ti/fs/fatfs/example/console/am571x/armv7/bios/fatfs_idk.cfg
new file mode 100644 (file)
index 0000000..a9f3300
--- /dev/null
@@ -0,0 +1,244 @@
+/**
+ *  \file   fatfs_idk.cfg
+ *
+ *  \brief  Sysbios config file for fatfs example project on AM571X IDK EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 2015-2018 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 Log = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
+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 ti_sysbios_family_arm_gic_Hwi = xdc.useModule('ti.sysbios.family.arm.gic.Hwi');
+var Cache = xdc.useModule('ti.sysbios.hal.Cache');
+var IntXbar    = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+/*
+ * 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 = 0x20000;
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/* Circular buffer size for System_printf() */
+SysMin.bufSize = 0x200;
+System.SupportProxy = SysMin;
+
+/*
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 16;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+if (Program.build.target.$name.match(/gnu/)) {
+    if (Program.build.target.$name.match(/A8F/) ||
+        Program.build.target.$name.match(/A9F/) ||
+        Program.build.target.$name.match(/A15F/)) {
+        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+    }
+}
+
+/* ================ BIOS configuration ================ */
+
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+/*
+ * Build a custom SYS/BIOS library from sources.
+ */
+BIOS.libType = BIOS.LibType_Custom;
+
+/*
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x1000;
+
+
+/* No runtime stack checking is performed */
+Task.checkStackFlag = false;
+
+/* Reduce the number of task priorities */
+Task.numPriorities = 4;
+
+/* ================ Driver configuration ================ */
+var socType           = "am571x";
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+/* Load the OSAL package */
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+
+/* Load the UART package */
+var UART = xdc.loadPackage('ti.drv.uart');    
+
+/* Load the I2C package */
+var I2C = xdc.loadPackage('ti.drv.i2c');    
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "idkAM571x";
+
+/* ================ Cache and MMU configuration ================ */
+
+var Cache1  = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
+var Mmu = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
+
+/* Enable the cache */
+Cache1.enableCache = true;
+
+/* Enable the MMU (Required for L1 data caching) */
+Mmu.enableMMU = true;
+
+/******************************************************************************
+ *
+ * SYS/BIOS assigns the following defaults to MAIR0 ATTR0, ATTR1 and ATTR2:
+ *
+ * ATTR0 -> 0x44 (mark memory region as non-cacheable normal memory)
+ * ATTR1 -> 0x04 (mark memory region as device memory, i.e. strongly
+ * ordered and non-cacheable)
+ * ATTR2 -> 0xFF (mark memory region as normal memory, RW cacheable and
+ * RW allocate)
+ ******************************************************************************
+ */
+
+
+// descriptor attribute structure
+var attrs0 = new Mmu.DescriptorAttrs();
+
+Mmu.initDescAttrsMeta(attrs0);
+attrs0.type = Mmu.DescriptorType_BLOCK;    // BLOCK descriptor
+attrs0.shareable = 2;                      // sharerable
+attrs0.attrIndx = 1;                       // Non-cache, device memory
+attrs0.noExecute = true;                   // Not executable
+
+// Set the descriptor for each entry in the address range
+for (var i=0x40600000; i < 0x60000000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs0);
+}
+
+// descriptor attribute structure
+var attrs1 = new Mmu.DescriptorAttrs();
+
+Mmu.initDescAttrsMeta(attrs1);
+attrs1.type = Mmu.DescriptorType_BLOCK;    // BLOCK descriptor
+attrs1.shareable = 2;                      // sharerable
+attrs1.attrIndx = 2;                       // Cached, normal memory
+
+// Set the descriptor for each entry in the address range
+for (var i=0x80000000; i < 0xA0000000; i = i + 0x00200000) {
+    // Each 'BLOCK' descriptor entry spans a 2MB address range
+    Mmu.setSecondLevelDescMeta(i, i, attrs1);
+}
+
+
+/* ================ Memory sections configuration ================ */
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/fs/fatfs/example/console/am571x/c66/bios/FATFS_Console_idkAM571x_c66xExampleProject.txt b/packages/ti/fs/fatfs/example/console/am571x/c66/bios/FATFS_Console_idkAM571x_c66xExampleProject.txt
new file mode 100644 (file)
index 0000000..d784c72
--- /dev/null
@@ -0,0 +1,8 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am57xx/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am571x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am571x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am571x/c66/bios/fatfs_idk.cfg"
+-ccs.setCompilerOptions "-D -mv6600 -g -dSOC_AM571x -didkAM571x -dUSE_BIOS -dC66X -dNSS_GEN2  --diag_warning=225 --diag_warning=994 --diag_warning=262 --diag_suppress=1111 --diag_suppress=827  --diag_suppress=824  --diag_suppress=837  --diag_suppress=1037 --diag_suppress=195 --diag_suppress=77  --diag_suppress=232 -I${PDK_INSTALL_PATH}/ti/fs/fatfs"  -rtsc.enableRtsc
diff --git a/packages/ti/fs/fatfs/example/console/am571x/c66/bios/fatfs_idk.cfg b/packages/ti/fs/fatfs/example/console/am571x/c66/bios/fatfs_idk.cfg
new file mode 100644 (file)
index 0000000..ab3adf1
--- /dev/null
@@ -0,0 +1,124 @@
+/**
+ *  \file   fatfs_idk.cfg
+ *
+ *  \brief  Sysbios config file for fatfs C66X test project on AM571X IDK EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 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.
+ *
+ */
+/* ================ General configuration ================ */
+var Memory                      =   xdc.useModule('xdc.runtime.Memory');
+var HeapMem                     =   xdc.useModule('ti.sysbios.heaps.HeapMem');
+var HeapBuf                     =   xdc.useModule('ti.sysbios.heaps.HeapBuf');
+var Log                         =   xdc.useModule('xdc.runtime.Log');
+var Task                        =   xdc.useModule('ti.sysbios.knl.Task');
+var Semaphore                   =   xdc.useModule('ti.sysbios.knl.Semaphore');
+var Hwi                         =   xdc.useModule('ti.sysbios.family.c64p.Hwi');
+var ECM                         =   xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
+var System                      =   xdc.useModule('xdc.runtime.System');
+SysStd                          =   xdc.useModule('xdc.runtime.SysStd');
+var IntXbar                     =   xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+System.SupportProxy             =   SysStd;
+
+/* Create a default system heap using ti.bios.HeapMem. */
+var heapMemParams1              =   new HeapMem.Params;
+heapMemParams1.size             =   8192 * 25;
+heapMemParams1.sectionName      =   "systemHeap";
+Program.global.heap0            =   HeapMem.create(heapMemParams1);
+
+/* This is the default memory heap. */
+Memory.defaultHeapInstance      =   Program.global.heap0;
+Program.sectMap["systemHeap"]   =   Program.platform.stackMemory;
+
+/*
+ * Enable Event Groups here and registering of ISR for specific GEM INTC is done
+ * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs
+ */
+var exception            =     xdc.useModule('ti.sysbios.family.c64p.Exception');
+exception.enablePrint = true;
+
+/* ================ BIOS configuration ================ */
+
+var BIOS                        =   xdc.useModule('ti.sysbios.BIOS'); 
+
+/* Enable BIOS Task Scheduler */
+BIOS.taskEnabled                       =   true;
+
+/* ================ Task configuration ================ */
+
+/* No runtime stack checking is performed */
+Task.checkStackFlag = false;
+
+
+/* Reduce the number of task priorities */
+Task.numPriorities = 4;
+
+
+/* ================ Driver configuration ================ */
+var socType           = "am571x";
+
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+
+/* Load the OSAL package */
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+
+/* Load the UART package */
+var UART = xdc.loadPackage('ti.drv.uart');    
+
+/* Load the I2C package */
+var I2C = xdc.loadPackage('ti.drv.i2c');    
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "idkAM571x";
+
+/* ================ Memory sections configuration ================ */
+Program.sectMap[".text"] = "EXT_RAM";
+Program.sectMap[".const"] = "EXT_RAM";
+Program.sectMap[".plt"] = "EXT_RAM";
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/fs/fatfs/example/console/am572x/armv7/bios/FATFS_Console_MultiPartition_evmAM572x_armExampleProject.txt b/packages/ti/fs/fatfs/example/console/am572x/armv7/bios/FATFS_Console_MultiPartition_evmAM572x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..eb7edf5
--- /dev/null
@@ -0,0 +1,9 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am57xx/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am572x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am572x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am572x/armv7/bios/fatfs_evm.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -DDRA7xx -DSOC_AM572x -DevmAM572x -DMULTI_PARTITION -DCONSOLE_EMMC -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/fs/fatfs "  -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/fs/fatfs/example/console/am572x/armv7/bios/FATFS_Console_evmAM572x_SMP_armExampleProject.txt b/packages/ti/fs/fatfs/example/console/am572x/armv7/bios/FATFS_Console_evmAM572x_SMP_armExampleProject.txt
new file mode 100644 (file)
index 0000000..0c08a01
--- /dev/null
@@ -0,0 +1,10 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am57xx/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am572x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am572x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am572x/armv7/bios/fatfs_evm.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -DDRA7xx -DSOC_AM572x -DevmAM572x -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/fs/fatfs "  -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 "
+-rtsc.setConfiguroOptions "--cfgArgs {SMP:\"enable\"}"
diff --git a/packages/ti/fs/fatfs/example/console/am572x/armv7/bios/FATFS_Console_evmAM572x_armExampleProject.txt b/packages/ti/fs/fatfs/example/console/am572x/armv7/bios/FATFS_Console_evmAM572x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..d7bc6e3
--- /dev/null
@@ -0,0 +1,9 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am57xx/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am572x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am572x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am572x/armv7/bios/fatfs_evm.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -DDRA7xx -DSOC_AM572x -DevmAM572x -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/fs/fatfs "  -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/fs/fatfs/example/console/am572x/armv7/bios/FATFS_Console_idkAM572x_armExampleProject.txt b/packages/ti/fs/fatfs/example/console/am572x/armv7/bios/FATFS_Console_idkAM572x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..310d31b
--- /dev/null
@@ -0,0 +1,9 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am57xx/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am572x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am572x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am572x/armv7/bios/fatfs_idk.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -DDRA7xx -DSOC_AM572x -DidkAM572x -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/fs/fatfs "  -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/fs/fatfs/example/console/am572x/armv7/bios/fatfs_evm.cfg b/packages/ti/fs/fatfs/example/console/am572x/armv7/bios/fatfs_evm.cfg
new file mode 100644 (file)
index 0000000..99c83a3
--- /dev/null
@@ -0,0 +1,245 @@
+/**
+ *  \file   fatfs_evm.cfg
+ *
+ *  \brief  Sysbios config file for fatfs example project on AM572X GP EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 2015-2019 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 Log = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
+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 ti_sysbios_family_arm_gic_Hwi = xdc.useModule('ti.sysbios.family.arm.gic.Hwi');
+var IntXbar    = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+/*
+ * 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 = 0x20000;
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/* Circular buffer size for System_printf() */
+SysMin.bufSize = 0x200;
+System.SupportProxy = SysMin;
+
+/*
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 16;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+if (Program.build.target.$name.match(/gnu/)) {
+    if (Program.build.target.$name.match(/A8F/) ||
+        Program.build.target.$name.match(/A9F/) ||
+        Program.build.target.$name.match(/A15F/)) {
+        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+    }
+}
+
+/* ================ BIOS configuration ================ */
+
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+
+var smpCfg;
+/* Enable BIOS SMP mode */
+if (Program.build.cfgArgs !=  null)
+{
+    smpCfg = Program.build.cfgArgs.SMP;
+    if(smpCfg == 'enable')
+    {
+        xdc.print("Enabling BIOS SMP mode");
+        BIOS.smpEnabled = true;
+        var Cache = xdc.module("ti.sysbios.hal.Cache");
+    }
+}
+
+/*
+ * Build a custom SYS/BIOS library from sources.
+ */
+BIOS.libType = BIOS.LibType_Custom;
+
+/*
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x1000;
+
+
+/* No runtime stack checking is performed */
+Task.checkStackFlag = false;
+
+/* Reduce the number of task priorities */
+Task.numPriorities = 4;
+
+/* ================ Driver configuration ================ */
+var socType           = "am572x";
+
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+/* Load the OSAL package */
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+
+/* Load the UART package */
+var UART = xdc.loadPackage('ti.drv.uart');    
+
+/* Load the I2C package */
+var I2C = xdc.loadPackage('ti.drv.i2c');    
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM572x";
+
+/* ================ Cache and MMU configuration ================ */
+
+var Mmu = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
+
+/* Enable the cache */
+if(smpCfg == null || smpCfg == '')
+{
+    var Cache  = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
+    Cache.enableCache = true;
+}
+
+/* Enable the MMU (Required for L1 data caching) */
+Mmu.enableMMU = true;
+
+/* Map MMC1 regs in MMU */
+var peripheralAttrs = new Mmu.DescriptorAttrs();
+Mmu.initDescAttrsMeta(peripheralAttrs);
+peripheralAttrs.type = Mmu.DescriptorType_BLOCK;  // BLOCK descriptor
+peripheralAttrs.noExecute = true;                 // not executable
+peripheralAttrs.accPerm = 0;                      // read/write at PL1
+peripheralAttrs.attrIndx = 1;                     // MAIR0 Byte1 describes
+                                                  // memory attributes for
+                                                  // each BLOCK MMU entry
+var peripheralBaseAddr = 0x4ae00000;
+// Configure the corresponding MMU page descriptor accordingly
+Mmu.setSecondLevelDescMeta(peripheralBaseAddr,
+                           peripheralBaseAddr,
+                           peripheralAttrs);
+
+var attrs = new Mmu.DescriptorAttrs();
+Mmu.initDescAttrsMeta(attrs);
+attrs.type = Mmu.DescriptorType_BLOCK;
+attrs.noExecute = true;
+attrs.accPerm = 0;
+attrs.attrIndx = 1;
+
+/* Set IO Delay configuration areas as non-cache */
+Mmu.setSecondLevelDescMeta(0x4844a000, 0x4844a000, attrs);
+Mmu.setSecondLevelDescMeta(0x4ae07d00, 0x4ae07d00, attrs);
+
+
+/* ================ Memory sections configuration ================ */
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/fs/fatfs/example/console/am572x/armv7/bios/fatfs_idk.cfg b/packages/ti/fs/fatfs/example/console/am572x/armv7/bios/fatfs_idk.cfg
new file mode 100644 (file)
index 0000000..7d706e6
--- /dev/null
@@ -0,0 +1,229 @@
+/**
+ *  \file   fatfs_idk.cfg
+ *
+ *  \brief  Sysbios config file for fatfs example project on AM572X IDK EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 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.
+ *
+ */
+/* ================ General configuration ================ */
+var Defaults = xdc.useModule('xdc.runtime.Defaults');
+var Diags = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Log = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
+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 ti_sysbios_family_arm_gic_Hwi = xdc.useModule('ti.sysbios.family.arm.gic.Hwi');
+var Cache = xdc.useModule('ti.sysbios.hal.Cache');
+var IntXbar    = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+/*
+ * 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 = 0x20000;
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/* Circular buffer size for System_printf() */
+SysMin.bufSize = 0x200;
+System.SupportProxy = SysMin;
+
+/*
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 16;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+if (Program.build.target.$name.match(/gnu/)) {
+    if (Program.build.target.$name.match(/A8F/) ||
+        Program.build.target.$name.match(/A9F/) ||
+        Program.build.target.$name.match(/A15F/)) {
+        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+    }
+}
+
+/* ================ BIOS configuration ================ */
+
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+/*
+ * Build a custom SYS/BIOS library from sources.
+ */
+BIOS.libType = BIOS.LibType_Custom;
+
+/*
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x1000;
+
+
+/* No runtime stack checking is performed */
+Task.checkStackFlag = false;
+
+/* Reduce the number of task priorities */
+Task.numPriorities = 4;
+
+/* ================ Driver configuration ================ */
+var socType           = "am572x";
+
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+/* Load the OSAL package */
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+
+/* Load the UART package */
+var UART = xdc.loadPackage('ti.drv.uart');    
+
+/* Load the I2C package */
+var I2C = xdc.loadPackage('ti.drv.i2c');    
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "idkAM572x";
+
+/* ================ Cache and MMU configuration ================ */
+
+var Cache1  = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
+var Mmu = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
+
+/* Enable the cache */
+Cache1.enableCache = true;
+
+/* Enable the MMU (Required for L1 data caching) */
+Mmu.enableMMU = true;
+
+/* Map MMC1 regs in MMU */
+var peripheralAttrs = new Mmu.DescriptorAttrs();
+Mmu.initDescAttrsMeta(peripheralAttrs);
+peripheralAttrs.type = Mmu.DescriptorType_BLOCK;  // BLOCK descriptor
+peripheralAttrs.noExecute = true;                 // not executable
+peripheralAttrs.accPerm = 0;                      // read/write at PL1
+peripheralAttrs.attrIndx = 1;                     // MAIR0 Byte1 describes
+                                                  // memory attributes for
+                                                  // each BLOCK MMU entry
+var peripheralBaseAddr = 0x4ae00000;
+// Configure the corresponding MMU page descriptor accordingly
+Mmu.setSecondLevelDescMeta(peripheralBaseAddr,
+                           peripheralBaseAddr,
+                           peripheralAttrs);
+
+var attrs = new Mmu.DescriptorAttrs();
+Mmu.initDescAttrsMeta(attrs);
+attrs.type = Mmu.DescriptorType_BLOCK;
+attrs.noExecute = true;
+attrs.accPerm = 0;
+attrs.attrIndx = 1;
+
+/* Set IO Delay configuration areas as non-cache */
+Mmu.setSecondLevelDescMeta(0x4844a000, 0x4844a000, attrs);
+Mmu.setSecondLevelDescMeta(0x4ae07d00, 0x4ae07d00, attrs);
+
+
+/* ================ Memory sections configuration ================ */
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/fs/fatfs/example/console/am572x/c66/bios/FATFS_Console_evmAM572x_c66xExampleProject.txt b/packages/ti/fs/fatfs/example/console/am572x/c66/bios/FATFS_Console_evmAM572x_c66xExampleProject.txt
new file mode 100644 (file)
index 0000000..67f7ed6
--- /dev/null
@@ -0,0 +1,8 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am57xx/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am572x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am572x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am572x/c66/bios/fatfs_evm.cfg"
+-ccs.setCompilerOptions "-D -mv6600 -g -dSOC_AM572x -devmAM572x -dUSE_BIOS -dC66X -dNSS_GEN2  --diag_warning=225 --diag_warning=994 --diag_warning=262 --diag_suppress=1111 --diag_suppress=827  --diag_suppress=824  --diag_suppress=837  --diag_suppress=1037 --diag_suppress=195 --diag_suppress=77  --diag_suppress=232 -I${PDK_INSTALL_PATH}/ti/fs/fatfs"  -rtsc.enableRtsc
diff --git a/packages/ti/fs/fatfs/example/console/am572x/c66/bios/FATFS_Console_idkAM572x_c66xExampleProject.txt b/packages/ti/fs/fatfs/example/console/am572x/c66/bios/FATFS_Console_idkAM572x_c66xExampleProject.txt
new file mode 100644 (file)
index 0000000..045434b
--- /dev/null
@@ -0,0 +1,8 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am57xx/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am572x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am572x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am572x/c66/bios/fatfs_idk.cfg"
+-ccs.setCompilerOptions "-D -mv6600 -g -dSOC_AM572x -didkAM572x -dUSE_BIOS -dC66X -dNSS_GEN2  --diag_warning=225 --diag_warning=994 --diag_warning=262 --diag_suppress=1111 --diag_suppress=827  --diag_suppress=824  --diag_suppress=837  --diag_suppress=1037 --diag_suppress=195 --diag_suppress=77  --diag_suppress=232 -I${PDK_INSTALL_PATH}/ti/fs/fatfs"  -rtsc.enableRtsc
diff --git a/packages/ti/fs/fatfs/example/console/am572x/c66/bios/fatfs_evm.cfg b/packages/ti/fs/fatfs/example/console/am572x/c66/bios/fatfs_evm.cfg
new file mode 100644 (file)
index 0000000..90cfecc
--- /dev/null
@@ -0,0 +1,124 @@
+/**
+ *  \file   fatfs_evm.cfg
+ *
+ *  \brief  Sysbios config file for fatfs C66X test project on AM572X GP EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 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.
+ *
+ */
+/* ================ General configuration ================ */
+var Memory                      =   xdc.useModule('xdc.runtime.Memory');
+var HeapMem                     =   xdc.useModule('ti.sysbios.heaps.HeapMem');
+var HeapBuf                     =   xdc.useModule('ti.sysbios.heaps.HeapBuf');
+var Log                         =   xdc.useModule('xdc.runtime.Log');
+var Task                        =   xdc.useModule('ti.sysbios.knl.Task');
+var Semaphore                   =   xdc.useModule('ti.sysbios.knl.Semaphore');
+var Hwi                         =   xdc.useModule('ti.sysbios.family.c64p.Hwi');
+var ECM                         =   xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
+var System                      =   xdc.useModule('xdc.runtime.System');
+SysStd                          =   xdc.useModule('xdc.runtime.SysStd');
+var IntXbar                     =   xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+System.SupportProxy             =   SysStd;
+
+/* Create a default system heap using ti.bios.HeapMem. */
+var heapMemParams1              =   new HeapMem.Params;
+heapMemParams1.size             =   8192 * 25;
+heapMemParams1.sectionName      =   "systemHeap";
+Program.global.heap0            =   HeapMem.create(heapMemParams1);
+
+/* This is the default memory heap. */
+Memory.defaultHeapInstance      =   Program.global.heap0;
+Program.sectMap["systemHeap"]   =   Program.platform.stackMemory;
+
+/*
+ * Enable Event Groups here and registering of ISR for specific GEM INTC is done
+ * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs
+ */
+var exception            =     xdc.useModule('ti.sysbios.family.c64p.Exception');
+exception.enablePrint = true;
+
+/* ================ BIOS configuration ================ */
+
+var BIOS                        =   xdc.useModule('ti.sysbios.BIOS'); 
+
+/* Enable BIOS Task Scheduler */
+BIOS.taskEnabled                       =   true;
+
+/* ================ Task configuration ================ */
+
+/* No runtime stack checking is performed */
+Task.checkStackFlag = false;
+
+
+/* Reduce the number of task priorities */
+Task.numPriorities = 4;
+
+
+/* ================ Driver configuration ================ */
+var socType           = "am572x";
+
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+
+/* Load the OSAL package */
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+
+/* Load the UART package */
+var UART = xdc.loadPackage('ti.drv.uart');    
+
+/* Load the I2C package */
+var I2C = xdc.loadPackage('ti.drv.i2c');    
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "evmAM572x";
+
+/* ================ Memory sections configuration ================ */
+Program.sectMap[".text"] = "EXT_RAM";
+Program.sectMap[".const"] = "EXT_RAM";
+Program.sectMap[".plt"] = "EXT_RAM";
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/fs/fatfs/example/console/am572x/c66/bios/fatfs_idk.cfg b/packages/ti/fs/fatfs/example/console/am572x/c66/bios/fatfs_idk.cfg
new file mode 100644 (file)
index 0000000..b72deab
--- /dev/null
@@ -0,0 +1,122 @@
+/**
+ *  \file   fatfs_idk.cfg
+ *
+ *  \brief  Sysbios config file for fatfs C66X test project on AM572X IDK EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 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.
+ *
+ */
+/* ================ General configuration ================ */
+var Memory                      =   xdc.useModule('xdc.runtime.Memory');
+var HeapMem                     =   xdc.useModule('ti.sysbios.heaps.HeapMem');
+var HeapBuf                     =   xdc.useModule('ti.sysbios.heaps.HeapBuf');
+var Log                         =   xdc.useModule('xdc.runtime.Log');
+var Task                        =   xdc.useModule('ti.sysbios.knl.Task');
+var Semaphore                   =   xdc.useModule('ti.sysbios.knl.Semaphore');
+var Hwi                         =   xdc.useModule('ti.sysbios.family.c64p.Hwi');
+var ECM                         =   xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
+var System                      =   xdc.useModule('xdc.runtime.System');
+SysStd                          =   xdc.useModule('xdc.runtime.SysStd');
+var IntXbar                     =   xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+System.SupportProxy             =   SysStd;
+
+/* Create a default system heap using ti.bios.HeapMem. */
+var heapMemParams1              =   new HeapMem.Params;
+heapMemParams1.size             =   8192 * 25;
+heapMemParams1.sectionName      =   "systemHeap";
+Program.global.heap0            =   HeapMem.create(heapMemParams1);
+
+/* This is the default memory heap. */
+Memory.defaultHeapInstance      =   Program.global.heap0;
+Program.sectMap["systemHeap"]   =   Program.platform.stackMemory;
+
+/*
+ * Enable Event Groups here and registering of ISR for specific GEM INTC is done
+ * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs
+ */
+var exception            =     xdc.useModule('ti.sysbios.family.c64p.Exception');
+exception.enablePrint = true;
+
+/* ================ BIOS configuration ================ */
+
+var BIOS                        =   xdc.useModule('ti.sysbios.BIOS'); 
+
+/* Enable BIOS Task Scheduler */
+BIOS.taskEnabled                       =   true;
+
+/* ================ Task configuration ================ */
+
+/* No runtime stack checking is performed */
+Task.checkStackFlag = false;
+
+
+/* Reduce the number of task priorities */
+Task.numPriorities = 4;
+
+
+/* ================ Driver configuration ================ */
+var socType           = "am572x";
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+/* Load the OSAL package */
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+
+/* Load the UART package */
+var UART = xdc.loadPackage('ti.drv.uart');    
+
+/* Load the I2C package */
+var I2C = xdc.loadPackage('ti.drv.i2c');    
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "idkAM572x";
+
+/* ================ Memory sections configuration ================ */
+Program.sectMap[".text"] = "EXT_RAM";
+Program.sectMap[".const"] = "EXT_RAM";
+Program.sectMap[".plt"] = "EXT_RAM";
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/fs/fatfs/example/console/am574x/armv7/bios/FATFS_Console_idkAM574x_armExampleProject.txt b/packages/ti/fs/fatfs/example/console/am574x/armv7/bios/FATFS_Console_idkAM574x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..662d142
--- /dev/null
@@ -0,0 +1,9 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am57xx/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am574x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am574x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am574x/armv7/bios/fatfs_idk.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -DDRA7xx -DSOC_AM574x -DidkAM574x -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/fs/fatfs "  -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/fs/fatfs/example/console/am574x/armv7/bios/fatfs_idk.cfg b/packages/ti/fs/fatfs/example/console/am574x/armv7/bios/fatfs_idk.cfg
new file mode 100644 (file)
index 0000000..a00ad71
--- /dev/null
@@ -0,0 +1,229 @@
+/**
+ *  \file   fatfs_idk.cfg
+ *
+ *  \brief  Sysbios config file for fatfs example project on AM574X IDK EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 2017 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 Log = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
+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 ti_sysbios_family_arm_gic_Hwi = xdc.useModule('ti.sysbios.family.arm.gic.Hwi');
+var Cache = xdc.useModule('ti.sysbios.hal.Cache');
+var IntXbar    = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+/*
+ * 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 = 0x20000;
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/* Circular buffer size for System_printf() */
+SysMin.bufSize = 0x200;
+System.SupportProxy = SysMin;
+
+/*
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 16;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+if (Program.build.target.$name.match(/gnu/)) {
+    if (Program.build.target.$name.match(/A8F/) ||
+        Program.build.target.$name.match(/A9F/) ||
+        Program.build.target.$name.match(/A15F/)) {
+        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+    }
+}
+
+/* ================ BIOS configuration ================ */
+
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+/*
+ * Build a custom SYS/BIOS library from sources.
+ */
+BIOS.libType = BIOS.LibType_Custom;
+
+/*
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x1000;
+
+
+/* No runtime stack checking is performed */
+Task.checkStackFlag = false;
+
+/* Reduce the number of task priorities */
+Task.numPriorities = 4;
+
+/* ================ Driver configuration ================ */
+var socType           = "am574x";
+
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+/* Load the OSAL package */
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+
+/* Load the UART package */
+var UART = xdc.loadPackage('ti.drv.uart');    
+
+/* Load the I2C package */
+var I2C = xdc.loadPackage('ti.drv.i2c');    
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "idkAM574x";
+
+/* ================ Cache and MMU configuration ================ */
+
+var Cache1  = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
+var Mmu = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
+
+/* Enable the cache */
+Cache1.enableCache = true;
+
+/* Enable the MMU (Required for L1 data caching) */
+Mmu.enableMMU = true;
+
+/* Map MMC1 regs in MMU */
+var peripheralAttrs = new Mmu.DescriptorAttrs();
+Mmu.initDescAttrsMeta(peripheralAttrs);
+peripheralAttrs.type = Mmu.DescriptorType_BLOCK;  // BLOCK descriptor
+peripheralAttrs.noExecute = true;                 // not executable
+peripheralAttrs.accPerm = 0;                      // read/write at PL1
+peripheralAttrs.attrIndx = 1;                     // MAIR0 Byte1 describes
+                                                  // memory attributes for
+                                                  // each BLOCK MMU entry
+var peripheralBaseAddr = 0x4ae00000;
+// Configure the corresponding MMU page descriptor accordingly
+Mmu.setSecondLevelDescMeta(peripheralBaseAddr,
+                           peripheralBaseAddr,
+                           peripheralAttrs);
+
+var attrs = new Mmu.DescriptorAttrs();
+Mmu.initDescAttrsMeta(attrs);
+attrs.type = Mmu.DescriptorType_BLOCK;
+attrs.noExecute = true;
+attrs.accPerm = 0;
+attrs.attrIndx = 1;
+
+/* Set IO Delay configuration areas as non-cache */
+Mmu.setSecondLevelDescMeta(0x4844a000, 0x4844a000, attrs);
+Mmu.setSecondLevelDescMeta(0x4ae07d00, 0x4ae07d00, attrs);
+
+
+/* ================ Memory sections configuration ================ */
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/fs/fatfs/example/console/am574x/c66/bios/FATFS_Console_idkAM574x_c66xExampleProject.txt b/packages/ti/fs/fatfs/example/console/am574x/c66/bios/FATFS_Console_idkAM574x_c66xExampleProject.txt
new file mode 100644 (file)
index 0000000..cd8878a
--- /dev/null
@@ -0,0 +1,8 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/mmcsd/soc/am57xx/MMCSD_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/uart/soc/am574x/UART_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/gpio/soc/am574x/GPIO_soc.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/am574x/c66/bios/fatfs_idk.cfg"
+-ccs.setCompilerOptions "-D -mv6600 -g -dSOC_AM574x -didkAM574x -dUSE_BIOS -dC66X -dNSS_GEN2  --diag_warning=225 --diag_warning=994 --diag_warning=262 --diag_suppress=1111 --diag_suppress=827  --diag_suppress=824  --diag_suppress=837  --diag_suppress=1037 --diag_suppress=195 --diag_suppress=77  --diag_suppress=232 -I${PDK_INSTALL_PATH}/ti/fs/fatfs"  -rtsc.enableRtsc
diff --git a/packages/ti/fs/fatfs/example/console/am574x/c66/bios/fatfs_idk.cfg b/packages/ti/fs/fatfs/example/console/am574x/c66/bios/fatfs_idk.cfg
new file mode 100644 (file)
index 0000000..ce9ae26
--- /dev/null
@@ -0,0 +1,122 @@
+/**
+ *  \file   fatfs_idk.cfg
+ *
+ *  \brief  Sysbios config file for fatfs C66X test project on AM574X IDK EVM.
+ *
+ */
+
+/*
+ * Copyright (C) 2017 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 Memory                      =   xdc.useModule('xdc.runtime.Memory');
+var HeapMem                     =   xdc.useModule('ti.sysbios.heaps.HeapMem');
+var HeapBuf                     =   xdc.useModule('ti.sysbios.heaps.HeapBuf');
+var Log                         =   xdc.useModule('xdc.runtime.Log');
+var Task                        =   xdc.useModule('ti.sysbios.knl.Task');
+var Semaphore                   =   xdc.useModule('ti.sysbios.knl.Semaphore');
+var Hwi                         =   xdc.useModule('ti.sysbios.family.c64p.Hwi');
+var ECM                         =   xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
+var System                      =   xdc.useModule('xdc.runtime.System');
+SysStd                          =   xdc.useModule('xdc.runtime.SysStd');
+var IntXbar                     =   xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+System.SupportProxy             =   SysStd;
+
+/* Create a default system heap using ti.bios.HeapMem. */
+var heapMemParams1              =   new HeapMem.Params;
+heapMemParams1.size             =   8192 * 25;
+heapMemParams1.sectionName      =   "systemHeap";
+Program.global.heap0            =   HeapMem.create(heapMemParams1);
+
+/* This is the default memory heap. */
+Memory.defaultHeapInstance      =   Program.global.heap0;
+Program.sectMap["systemHeap"]   =   Program.platform.stackMemory;
+
+/*
+ * Enable Event Groups here and registering of ISR for specific GEM INTC is done
+ * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs
+ */
+var exception            =     xdc.useModule('ti.sysbios.family.c64p.Exception');
+exception.enablePrint = true;
+
+/* ================ BIOS configuration ================ */
+
+var BIOS                        =   xdc.useModule('ti.sysbios.BIOS'); 
+
+/* Enable BIOS Task Scheduler */
+BIOS.taskEnabled                       =   true;
+
+/* ================ Task configuration ================ */
+
+/* No runtime stack checking is performed */
+Task.checkStackFlag = false;
+
+
+/* Reduce the number of task priorities */
+Task.numPriorities = 4;
+
+
+/* ================ Driver configuration ================ */
+var socType           = "am574x";
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
+
+/* Load the OSAL package */
+var osType = "tirtos"
+var Osal = xdc.useModule('ti.osal.Settings');
+Osal.osType = osType;
+Osal.socType = socType;
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+
+/* Load the UART package */
+var UART = xdc.loadPackage('ti.drv.uart');    
+
+/* Load the I2C package */
+var I2C = xdc.loadPackage('ti.drv.i2c');    
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "idkAM574x";
+
+/* ================ Memory sections configuration ================ */
+Program.sectMap[".text"] = "EXT_RAM";
+Program.sectMap[".const"] = "EXT_RAM";
+Program.sectMap[".plt"] = "EXT_RAM";
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/fs/fatfs/example/console/am65xx/a53/fatfsConsole_a53.cfg b/packages/ti/fs/fatfs/example/console/am65xx/a53/fatfsConsole_a53.cfg
new file mode 100644 (file)
index 0000000..b994cdc
--- /dev/null
@@ -0,0 +1,211 @@
+
+/* =============================================================================
+ *   Copyright (c) Texas Instruments Incorporated 2018-Present
+ *
+ *  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.
+ */
+var Defaults = xdc.useModule('xdc.runtime.Defaults');
+var Diags = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Log = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
+var Main = xdc.useModule('xdc.runtime.Main');
+var Memory = xdc.useModule('xdc.runtime.Memory')
+var System = xdc.useModule('xdc.runtime.System');
+var Text = xdc.useModule('xdc.runtime.Text');
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+var Task = xdc.useModule('ti.sysbios.knl.Task');
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
+var HeapMem     = xdc.useModule ("ti.sysbios.heaps.HeapMem");
+
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+var Hwi = xdc.useModule('ti.sysbios.family.arm.gicv3.Hwi');
+
+var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
+var SysMin = xdc.useModule('xdc.runtime.SysMin');
+BIOS.clockEnabled = true;
+
+/* Enable SMP mode in BIOS if SMP is enabled from makefile */
+var smp = java.lang.System.getenv("SMP")
+if(smp == 'enable')
+{
+    xdc.print("Enabling BIOS SMP mode");
+       BIOS.smpEnabled = true;
+}
+
+/* Enable cache */
+var Cache = xdc.module("ti.sysbios.hal.Cache");
+if(smp == null || smp == '')
+{
+    Cache.CacheProxy = xdc.useModule("ti.sysbios.family.arm.v8a.Cache");
+}
+
+/*
+ * Direct CIO to UART
+ */
+/* System.SupportProxy = SysUart; */
+System.SupportProxy = SysMin;
+
+/*
+ * 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;
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/* Create default heap and hook it into Memory */
+var heapMemParams = new HeapMem.Params;
+heapMemParams.size = 16384*3;
+var heap0 = HeapMem.create(heapMemParams);
+
+Memory.defaultHeapInstance = heap0;
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ *
+ * BIOS.heapSize = 0x2000; */
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x4000;
+
+Task.defaultStackSize = 0x4000;
+
+/*
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 32;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+BIOS.libType = BIOS.LibType_Custom;
+BIOS.cpuFreq.lo = 800000000;
+BIOS.cpuFreq.hi = 0;
+
+
+var Timer = xdc.useModule('ti.sysbios.family.arm.v8a.Timer');
+Timer.intFreq.lo = 200000000;
+Timer.intFreq.hi = 0;
+
+var dmTimer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
+for (var i = 0; i < 12; i++) {
+    dmTimer.intFreqs[i].lo = 25000000;
+    dmTimer.intFreqs[i].hi = 0;
+}
+
+var Mmu = xdc.useModule("ti.sysbios.family.arm.v8a.Mmu");
+Mmu.enableMMU = true;
+
+Mmu.initFunc = "&InitMmu";
+Mmu.tableArrayLen = 24;
+
+/* ================ Driver configuration ================ */
+
+var task0Params = new Task.Params();
+task0Params.priority = 5;
+task0Params.instance.name = "task0";
+task0Params.stackSize = 16*1024;
+
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+Clock.tickPeriod = 1000;
+
+var Load = xdc.useModule('ti.sysbios.utils.Load');
+ // Load.common$.logger = loggerBuf0;
+var Diags = xdc.useModule('xdc.runtime.Diags');
+Load.common$.diags_USER4 = Diags.ALWAYS_ON;
+
+/* allocate a config-params object */
+var HeapParam = new HeapMem.Params;
+
+/* optionally assign per-instance configs */
+HeapParam.size = 200000;
+
+/* create an instance-object */
+Program.global.myHeap = HeapMem.create(HeapParam);
+
+
+var Load = xdc.useModule('ti.sysbios.utils.Load');
+ // Load.common$.logger = loggerBuf0;
+var Diags = xdc.useModule('xdc.runtime.Diags');
+Load.common$.diags_USER4 = Diags.ALWAYS_ON;
+
+// Program.sectMap[".text"] = "DDR";
+// Program.sectMap[".ti_sysbios_family_arm_v8a_Mmu_tableArray"] = "DDR";
+Program.sectMap[".ti_sysbios_family_arm_v8a_Mmu_tableArray"] = "MSMC_SRAM";
+//Program.sectMap[".c_int00"] = "MSMC_SRAM";
diff --git a/packages/ti/fs/fatfs/example/console/am65xx/r5/fatfsConsole_r5.cfg b/packages/ti/fs/fatfs/example/console/am65xx/r5/fatfsConsole_r5.cfg
new file mode 100644 (file)
index 0000000..db66b20
--- /dev/null
@@ -0,0 +1,154 @@
+
+/* =============================================================================
+ *   Copyright (c) Texas Instruments Incorporated 2018-Present
+ *
+ *  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.
+ */
+var Defaults = xdc.useModule('xdc.runtime.Defaults');
+var Diags = xdc.useModule('xdc.runtime.Diags');
+var Error = xdc.useModule('xdc.runtime.Error');
+var Log = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
+var Main = xdc.useModule('xdc.runtime.Main');
+var Memory = xdc.useModule('xdc.runtime.Memory')
+var System = xdc.useModule('xdc.runtime.System');
+var Text = xdc.useModule('xdc.runtime.Text');
+var Clock = xdc.useModule('ti.sysbios.knl.Clock');
+var Task = xdc.useModule('ti.sysbios.knl.Task');
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
+var HeapMem     = xdc.useModule ("ti.sysbios.heaps.HeapMem");
+
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+var Hwi = xdc.useModule('ti.sysbios.family.arm.v7r.keystone3.Hwi');
+var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
+var SysMin = xdc.useModule('xdc.runtime.SysMin');
+BIOS.clockEnabled = true;
+/* Enable cache */
+var Cache = xdc.useModule('ti.sysbios.family.arm.v7r.Cache');
+Cache.enableCache = true;
+/*
+ * Direct CIO to UART
+ */
+/* System.SupportProxy = SysUart; */
+System.SupportProxy = SysMin;
+/* 
+ * 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;
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/* Create default heap and hook it into Memory */
+var heapMemParams = new HeapMem.Params;
+heapMemParams.size = 16384*3;
+var heap0 = HeapMem.create(heapMemParams);
+
+Memory.defaultHeapInstance = heap0;
+
+/*
+ * 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;
+ */
+
+/* 
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/* 
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ *
+ * BIOS.heapSize = 0x2000; */
+
+/* System stack size (used by ISRs and Swis) */
+Program.stack = 0x4000;
+
+Task.defaultStackSize = 0x4000;
+
+/* 
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 32;
+var logger0 = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger = logger0;
+Main.common$.diags_INFO = Diags.ALWAYS_ON;
+
+BIOS.libType = BIOS.LibType_Custom;
+
+/* Disable Timer frequency check */
+var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
+Timer.checkFrequency = false;
+
+/*
+ * Initialize MPU and enable it
+ *
+ * Note: MPU must be enabled and properly configured for caching to work.
+ */
+xdc.loadCapsule("mpu.xs");
+
diff --git a/packages/ti/fs/fatfs/example/console/am65xx/r5/mpu.xs b/packages/ti/fs/fatfs/example/console/am65xx/r5/mpu.xs
new file mode 100644 (file)
index 0000000..bd89bbe
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+/*
+ *  ======== event_MPU.xs ========
+ *  MPU Settings for SIMMAXWELL device's Cortex-R5F
+ */
+
+/*
+ *  -------------------------------------------------------------------------------------------------------------
+ * | Id | Base Address | Size | En | Cacheable                                 | XN | AccPerm             | Mask |
+ * |-------------------------------------------------------------------------------------------------------------|
+ * | 0  | 0x00000000   | 4GB  | T  | Strongly Ordered, Shareable               | T  | RW at PL 1          | 0x0  |
+ * |----|--------------|------|----|-------------------------------------------|----|---------------------|------|
+ * | 1  | 0x00000000   | 1K   | T  | Write-Back, Write-Allocate, Non-Shareable | F  | RW at PL 1          | 0x0  |
+ * |----|--------------|------|----|-------------------------------------------|----|---------------------|------|
+ * | 2  | 0x41000000   | 32K  | T  | Write-Back, Write-Allocate, Non-Shareable | F  | RW at PL 1          | 0x0  |
+ * |----|--------------|------|----|-------------------------------------------|----|---------------------|------|
+ * | 3  | 0x41010000   | 32K  | T  | Write-Back, Write-Allocate, Non-Shareable | F  | RW at PL 1          | 0x0  |
+ * |----|--------------|------|----|-------------------------------------------|----|---------------------|------|
+ * | 4  | 0x41C00000   | 512K | T  | Write-Back, Write-Allocate, Non-Shareable | F  | RW at PL 1          | 0x0  |
+ *  -------------------------------------------------------------------------------------------------------------
+ */
+
+/*
+ * Note: Marking a region as shareable will cause the region to behave as outer shareable with write through
+ *       no write-allocate caching policy irrespective of the actual cache policy set. Therefore, only select
+ *       regions that are actually shared outside the R5 CPUSS must be marked as shared.
+ */
+
+var MPU = xdc.useModule('ti.sysbios.family.arm.MPU');
+MPU.enableMPU = true;
+MPU.enableBackgroundRegion = true;
+
+var attrs = new MPU.RegionAttrs();
+MPU.initRegionAttrsMeta(attrs);
+
+attrs.enable = true;
+attrs.bufferable = false;
+attrs.cacheable = false;
+attrs.shareable = true;
+attrs.noExecute = true;
+attrs.accPerm = 1;          /* RW at PL1 */
+attrs.tex = 0;
+attrs.subregionDisableMask = 0;
+MPU.setRegionMeta(0, 0x00000000, MPU.RegionSize_4G, attrs);
+
+attrs.enable = true;
+attrs.bufferable = true;
+attrs.cacheable = true;
+attrs.shareable = false;
+attrs.noExecute = false;
+attrs.accPerm = 1;          /* RW at PL1 */
+attrs.tex = 1;
+attrs.subregionDisableMask = 0;
+MPU.setRegionMeta(1, 0x00000000, MPU.RegionSize_32K, attrs);
+
+attrs.enable = true;
+attrs.bufferable = true;
+attrs.cacheable = true;
+attrs.shareable = false;
+attrs.noExecute = false;
+attrs.accPerm = 1;          /* RW at PL1 */
+attrs.tex = 1;
+attrs.subregionDisableMask = 0;
+MPU.setRegionMeta(2, 0x41000000, MPU.RegionSize_32K, attrs);
+
+attrs.enable = true;
+attrs.bufferable = true;
+attrs.cacheable = true;
+attrs.shareable = false;
+attrs.noExecute = false;
+attrs.accPerm = 1;          /* RW at PL1 */
+attrs.tex = 1;
+attrs.subregionDisableMask = 0x0;
+MPU.setRegionMeta(3, 0x41010000, MPU.RegionSize_32K, attrs);
+
+attrs.enable = true;
+attrs.bufferable = true;
+attrs.cacheable = true;
+attrs.shareable = false;
+attrs.noExecute = false;
+attrs.accPerm = 1;          /* RW at PL1 */
+attrs.tex = 1;
+attrs.subregionDisableMask = 0;
+MPU.setRegionMeta(4, 0x41C00000, MPU.RegionSize_512K, attrs);
+
+attrs.enable = true;
+attrs.bufferable = true;
+attrs.cacheable = true;
+attrs.shareable = false;
+attrs.noExecute = false;
+attrs.accPerm = 1;          /* RW at PL1 */
+attrs.tex = 1;
+attrs.subregionDisableMask = 0;
+MPU.setRegionMeta(4, 0x4F800000, MPU.RegionSize_512K, attrs);
+
+
+attrs.enable = true;
+attrs.bufferable = true;
+attrs.cacheable = true;
+attrs.shareable = false;
+attrs.noExecute = false;
+attrs.accPerm = 1;          /* RW at PL1 */
+attrs.tex = 1;
+attrs.subregionDisableMask = 0;
+MPU.setRegionMeta(5, 0x70000000, MPU.RegionSize_2M, attrs);
+
+
+attrs.enable = true;
+attrs.bufferable = true;
+attrs.cacheable = true;
+attrs.shareable = false;
+attrs.noExecute = false;
+attrs.accPerm = 1;          /* RW at PL1 */
+attrs.tex = 1;
+attrs.subregionDisableMask = 0;
+MPU.setRegionMeta(6, 0x04000000, MPU.RegionSize_2M, attrs);
diff --git a/packages/ti/fs/fatfs/example/console/dra7xx/armv7/bios/FATFS_Console_evmDRA72x_armExampleProject.txt b/packages/ti/fs/fatfs/example/console/dra7xx/armv7/bios/FATFS_Console_evmDRA72x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..bb0fd93
--- /dev/null
@@ -0,0 +1,7 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/dra7xx/armv7/bios/fatfs.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -DSOC_DRA72x -DevmDRA72x -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/fs/fatfs "  -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 "
+-rtsc.setConfiguroOptions "--cfgArgs {SOC:\"dra72x\", BOARD:\"evmDRA72x\"}"
diff --git a/packages/ti/fs/fatfs/example/console/dra7xx/armv7/bios/FATFS_Console_evmDRA75x_armExampleProject.txt b/packages/ti/fs/fatfs/example/console/dra7xx/armv7/bios/FATFS_Console_evmDRA75x_armExampleProject.txt
new file mode 100644 (file)
index 0000000..48d0cdb
--- /dev/null
@@ -0,0 +1,7 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/dra7xx/armv7/bios/fatfs.cfg"
+-ccs.setCompilerOptions "-c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -DSOC_DRA75x -DevmDRA75x -g -gstrict-dwarf -Wall -MMD -MP -I${PDK_INSTALL_PATH}/ti/fs/fatfs "  -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 "
+-rtsc.setConfiguroOptions "--cfgArgs {SOC:\"dra75x\", BOARD:\"evmDRA75x\"}"
diff --git a/packages/ti/fs/fatfs/example/console/dra7xx/armv7/bios/fatfs.cfg b/packages/ti/fs/fatfs/example/console/dra7xx/armv7/bios/fatfs.cfg
new file mode 100644 (file)
index 0000000..ad9bf30
--- /dev/null
@@ -0,0 +1,241 @@
+/**
+ *  \file   fatfs.cfg
+ *
+ *  \brief  Sysbios config file for fatfs example project on DRA7xx EVMs.
+ *
+ */
+
+/*
+ * Copyright (C) 2017 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 Log       = xdc.useModule('xdc.runtime.Log');
+var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
+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 ti_sysbios_family_arm_gic_Hwi = xdc.useModule('ti.sysbios.family.arm.gic.Hwi');
+var Cache     = xdc.useModule('ti.sysbios.hal.Cache');
+var IntXbar   = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
+
+var SourceDir = xdc.useModule('xdc.cfg.SourceDir');
+SourceDir.outputDir = "src";
+
+/*
+ * 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 = 0x20000;
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/*
+ * 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;
+ */
+
+/* Circular buffer size for System_printf() */
+SysMin.bufSize      = 0x200;
+System.SupportProxy = SysMin;
+
+/*
+ * Create and install logger for the whole system
+ */
+var loggerBufParams = new LoggerBuf.Params();
+loggerBufParams.numEntries = 16;
+var logger0         = LoggerBuf.create(loggerBufParams);
+Defaults.common$.logger    = logger0;
+Main.common$.diags_INFO    = Diags.ALWAYS_ON;
+
+if (Program.build.target.$name.match(/ gnu /))
+{
+    if (Program.build.target.$name.match(/ A8F /) ||
+        Program.build.target.$name.match(/ A9F /) ||
+        Program.build.target.$name.match(/ A15F /))
+    {
+        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
+    }
+}
+
+/* ================ BIOS configuration ================ */
+
+var BIOS = xdc.useModule('ti.sysbios.BIOS');
+/*
+ * Build a custom SYS/BIOS library from sources.
+ */
+BIOS.libType = BIOS.LibType_Custom;
+
+/*
+ * The BIOS module will create the default heap for the system.
+ * Specify the size of this default heap.
+ */
+BIOS.heapSize = 0x1000;
+
+/* No runtime stack checking is performed */
+Task.checkStackFlag = false;
+
+/* Reduce the number of task priorities */
+Task.numPriorities = 4;
+
+/* ================ Driver configuration ================ */
+var soc   = Program.build.cfgArgs.SOC.toLowerCase();
+var board = Program.build.cfgArgs.BOARD;
+xdc.print("# !!!  Current soc is [" + soc + "] !!!");
+xdc.print("# !!!  Current board is [" + board + "] !!!");
+
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = soc;
+
+/* Load the OSAL package */
+var osType = "tirtos";
+var Osal   = xdc.useModule('ti.osal.Settings');
+Osal.osType  = osType;
+Osal.socType = soc;
+
+/* Load the MMCSD package */
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');
+Mmcsd.Settings.socType = soc;
+
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');
+
+/* Load the GPIO package */
+var GPIO = xdc.loadPackage('ti.drv.gpio');
+GPIO.Settings.socType = soc;
+
+/* Load the UART package */
+var UART = xdc.loadPackage('ti.drv.uart');
+UART.Settings.socType = soc;
+
+/* Load the I2C package */
+var I2C = xdc.loadPackage('ti.drv.i2c');
+I2C.Settings.socType = soc;
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = board;
+
+/* ================ Cache and MMU configuration ================ */
+
+var Cache1 = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
+var Mmu    = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
+
+/* Enable the cache */
+Cache1.enableCache = true;
+
+/* Enable the MMU (Required for L1 data caching) */
+Mmu.enableMMU = true;
+
+/* Map MMC1 regs in MMU */
+var peripheralAttrs = new Mmu.DescriptorAttrs();
+Mmu.initDescAttrsMeta(peripheralAttrs);
+peripheralAttrs.type      = Mmu.DescriptorType_BLOCK; /* BLOCK descriptor */
+peripheralAttrs.noExecute = true;                     /* not executable */
+peripheralAttrs.accPerm   = 0;                        /* read/write at PL1 */
+peripheralAttrs.attrIndx  = 1;                        /* MAIR0 Byte1 describes */
+                                                      /* memory attributes for */
+                                                      /* each BLOCK MMU entry */
+var peripheralBaseAddr = 0x4ae00000;
+/* Configure the corresponding MMU page descriptor accordingly */
+Mmu.setSecondLevelDescMeta(peripheralBaseAddr,
+                           peripheralBaseAddr,
+                           peripheralAttrs);
+
+var attrs = new Mmu.DescriptorAttrs();
+Mmu.initDescAttrsMeta(attrs);
+attrs.type      = Mmu.DescriptorType_BLOCK;
+attrs.noExecute = true;
+attrs.accPerm   = 0;
+attrs.attrIndx  = 1;
+
+/* Set IO Delay configuration areas as non-cache */
+Mmu.setSecondLevelDescMeta(0x4844a000, 0x4844a000, attrs);
+Mmu.setSecondLevelDescMeta(0x4ae07d00, 0x4ae07d00, attrs);
+
+/* ================ Memory sections configuration ================ */
+Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
+Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
diff --git a/packages/ti/fs/fatfs/example/console/dra7xx/c66/bios/FATFS_Console_evmDRA72x_c66xExampleProject.txt b/packages/ti/fs/fatfs/example/console/dra7xx/c66/bios/FATFS_Console_evmDRA72x_c66xExampleProject.txt
new file mode 100644 (file)
index 0000000..f74869d
--- /dev/null
@@ -0,0 +1,6 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/dra7xx/c66/bios/fatfs.cfg"
+-ccs.setCompilerOptions "-D -mv6600 -g -dSOC_DRA72x -devmDRA72x --diag_warning=225 --diag_warning=994 --diag_warning=262 --diag_suppress=1111 --diag_suppress=827  --diag_suppress=824  --diag_suppress=837  --diag_suppress=1037 --diag_suppress=195 --diag_suppress=77  --diag_suppress=232 -I${PDK_INSTALL_PATH}/ti/fs/fatfs"  -rtsc.enableRtsc
+-rtsc.setConfiguroOptions "--cfgArgs {SOC:\"dra72x\", BOARD:\"evmDRA72x\"}"
diff --git a/packages/ti/fs/fatfs/example/console/dra7xx/c66/bios/FATFS_Console_evmDRA75x_c66xExampleProject.txt b/packages/ti/fs/fatfs/example/console/dra7xx/c66/bios/FATFS_Console_evmDRA75x_c66xExampleProject.txt
new file mode 100644 (file)
index 0000000..2bf33a1
--- /dev/null
@@ -0,0 +1,6 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/dra7xx/c66/bios/fatfs.cfg"
+-ccs.setCompilerOptions "-D -mv6600 -g -dSOC_DRA75x -devmDRA75x --diag_warning=225 --diag_warning=994 --diag_warning=262 --diag_suppress=1111 --diag_suppress=827  --diag_suppress=824  --diag_suppress=837  --diag_suppress=1037 --diag_suppress=195 --diag_suppress=77  --diag_suppress=232 -I${PDK_INSTALL_PATH}/ti/fs/fatfs"  -rtsc.enableRtsc
+-rtsc.setConfiguroOptions "--cfgArgs {SOC:\"dra75x\", BOARD:\"evmDRA75x\"}"
diff --git a/packages/ti/fs/fatfs/example/console/dra7xx/c66/bios/FATFS_Console_evmDRA78x_c66xExampleProject.txt b/packages/ti/fs/fatfs/example/console/dra7xx/c66/bios/FATFS_Console_evmDRA78x_c66xExampleProject.txt
new file mode 100644 (file)
index 0000000..7d3ea3c
--- /dev/null
@@ -0,0 +1,6 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/dra7xx/c66/bios/fatfs.cfg"
+-ccs.setCompilerOptions "-D -mv6600 -g -dSOC_DRA78x -devmDRA78x --diag_warning=225 --diag_warning=994 --diag_warning=262 --diag_suppress=1111 --diag_suppress=827  --diag_suppress=824  --diag_suppress=837  --diag_suppress=1037 --diag_suppress=195 --diag_suppress=77  --diag_suppress=232 -I${PDK_INSTALL_PATH}/ti/fs/fatfs"  -rtsc.enableRtsc
+-rtsc.setConfiguroOptions "--cfgArgs {SOC:\"dra78x\", BOARD:\"evmDRA78x\"}"
diff --git a/packages/ti/fs/fatfs/example/console/dra7xx/c66/bios/fatfs.cfg b/packages/ti/fs/fatfs/example/console/dra7xx/c66/bios/fatfs.cfg
new file mode 100644 (file)
index 0000000..c43ac5d
--- /dev/null
@@ -0,0 +1,144 @@
+/**\r
+ *  \file   fatfs.cfg\r
+ *\r
+ *  \brief  Sysbios config file for fatfs C66X test project on DRA7xx EVMs.\r
+ *\r
+ */\r
+\r
+/*\r
+ * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ *\r
+ * Redistributions of source code must retain the above copyright\r
+ * notice, this list of conditions and the following disclaimer.\r
+ *\r
+ * Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the\r
+ * documentation and/or other materials provided with the\r
+ * distribution.\r
+ *\r
+ * Neither the name of Texas Instruments Incorporated nor the names of\r
+ * its contributors may be used to endorse or promote products derived\r
+ * from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ */\r
+/* ================ General configuration ================ */\r
+var Memory    = xdc.useModule('xdc.runtime.Memory');\r
+var HeapMem   = xdc.useModule('ti.sysbios.heaps.HeapMem');\r
+var HeapBuf   = xdc.useModule('ti.sysbios.heaps.HeapBuf');\r
+var Log       = xdc.useModule('xdc.runtime.Log');\r
+var Task      = xdc.useModule('ti.sysbios.knl.Task');\r
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');\r
+var ECM       = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');\r
+var Hwi       = xdc.useModule('ti.sysbios.hal.Hwi');\r
+var System    = xdc.useModule('xdc.runtime.System');\r
+var SysStd    = xdc.useModule('xdc.runtime.SysStd');\r
+var IntXbar   = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');\r
+System.SupportProxy = SysStd;\r
+\r
+var SourceDir = xdc.useModule('xdc.cfg.SourceDir');\r
+SourceDir.outputDir = "src";\r
+\r
+/* Create a default system heap using ti.bios.HeapMem. */\r
+var heapMemParams1         = new HeapMem.Params;\r
+heapMemParams1.size        = 8192 * 25;\r
+heapMemParams1.sectionName = "systemHeap";\r
+Program.global.heap0       = HeapMem.create(heapMemParams1);\r
+\r
+/* This is the default memory heap. */\r
+Memory.defaultHeapInstance    = Program.global.heap0;\r
+Program.sectMap["systemHeap"] = Program.platform.stackMemory;\r
+\r
+/*\r
+ * Enable Event Groups here and registering of ISR for specific GEM INTC is done\r
+ * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs\r
+ */\r
+var exception         = xdc.useModule('ti.sysbios.family.c64p.Exception');\r
+exception.enablePrint = true;\r
+\r
+/* ================ BIOS configuration ================ */\r
+\r
+var BIOS = xdc.useModule('ti.sysbios.BIOS');\r
+\r
+/* Enable BIOS Task Scheduler */\r
+BIOS.taskEnabled = true;\r
+\r
+/* ================ Task configuration ================ */\r
+\r
+/* No runtime stack checking is performed */\r
+Task.checkStackFlag = false;\r
+\r
+/* Reduce the number of task priorities */\r
+Task.numPriorities = 4;\r
+\r
+/* ================ Driver configuration ================ */\r
+var soc   = Program.build.cfgArgs.SOC.toLowerCase();\r
+var board = Program.build.cfgArgs.BOARD;\r
+xdc.print("# !!!  Current soc is [" + soc + "] !!!");\r
+xdc.print("# !!!  Current board is [" + board + "] !!!");\r
+\r
+/*use CSL package*/\r
+var Csl = xdc.loadPackage('ti.csl');\r
+Csl.Settings.deviceType = soc;\r
+\r
+/* Load the OSAL package */\r
+var osType = "tirtos";\r
+var Osal = xdc.useModule('ti.osal.Settings');\r
+Osal.osType = osType;\r
+Osal.socType = soc;\r
+\r
+/* Load the MMCSD package */\r
+var Mmcsd = xdc.loadPackage('ti.drv.mmcsd');\r
+Mmcsd.Settings.socType = soc;\r
+\r
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');\r
+\r
+/* Load the GPIO package */\r
+var GPIO = xdc.loadPackage('ti.drv.gpio');\r
+GPIO.Settings.socType = soc;\r
+\r
+/* Load the UART package */\r
+var UART = xdc.loadPackage('ti.drv.uart');\r
+UART.Settings.socType = soc;\r
+\r
+/* Load the I2C package */\r
+var I2C = xdc.loadPackage('ti.drv.i2c');\r
+I2C.Settings.socType = soc;\r
+\r
+/* Load the Board package and set the board name */\r
+var Board = xdc.loadPackage('ti.board');\r
+Board.Settings.boardName = board;\r
+\r
+/* ================ Memory sections configuration ================ */\r
+Program.sectMap[".text"] = "EXT_RAM";\r
+Program.sectMap[".const"] = "EXT_RAM";\r
+Program.sectMap[".plt"] = "EXT_RAM";\r
+\r
+if (soc == "dra72x" || soc == "dra75x")\r
+{\r
+    /* Place IODELAY code in OCMC_RAM1 as DDR exeuction of this code will lead to\r
+     * failures.\r
+     */\r
+    Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";\r
+    Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";\r
+}\r
+\r
+/* Align DSP entry point address according to the SBL requirements */\r
+Program.sectMap[".text:_c_int00"] = new Program.SectionSpec();\r
+Program.sectMap[".text:_c_int00"].loadSegment = "EXT_RAM";\r
+Program.sectMap[".text:_c_int00"].loadAlign = 0x400;\r
diff --git a/packages/ti/fs/fatfs/example/console/dra7xx/m4/bios/FATFS_Console_evmDRA72x_m4ExampleProject.txt b/packages/ti/fs/fatfs/example/console/dra7xx/m4/bios/FATFS_Console_evmDRA72x_m4ExampleProject.txt
new file mode 100644 (file)
index 0000000..b0b8e7d
--- /dev/null
@@ -0,0 +1,7 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/dra7xx/m4/bios/fatfs.cfg"
+-ccs.setCompilerOptions "-qq -pdsw255 -mv7M4 --float_support=vfplib --abi=eabi -g -DSOC_DRA72x -DevmDRA72x -Dti_targets_arm_elf_M4 -I${PDK_INSTALL_PATH}/ti/drv/mmcsd "  -rtsc.enableRtsc
+-ccs.setLinkerOptions "--strict_compatibility=on"
+-rtsc.setConfiguroOptions "--cfgArgs {SOC:\"dra72x\", BOARD:\"evmDRA72x\"}"
diff --git a/packages/ti/fs/fatfs/example/console/dra7xx/m4/bios/FATFS_Console_evmDRA75x_m4ExampleProject.txt b/packages/ti/fs/fatfs/example/console/dra7xx/m4/bios/FATFS_Console_evmDRA75x_m4ExampleProject.txt
new file mode 100644 (file)
index 0000000..32f025c
--- /dev/null
@@ -0,0 +1,7 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/dra7xx/m4/bios/fatfs.cfg"
+-ccs.setCompilerOptions "-qq -pdsw255 -mv7M4 --float_support=vfplib --abi=eabi -g -DSOC_DRA75x -DevmDRA75x -Dti_targets_arm_elf_M4 -I${PDK_INSTALL_PATH}/ti/drv/mmcsd "  -rtsc.enableRtsc
+-ccs.setLinkerOptions "--strict_compatibility=on"
+-rtsc.setConfiguroOptions "--cfgArgs {SOC:\"dra75x\", BOARD:\"evmDRA75x\"}"
diff --git a/packages/ti/fs/fatfs/example/console/dra7xx/m4/bios/FATFS_Console_evmDRA78x_m4ExampleProject.txt b/packages/ti/fs/fatfs/example/console/dra7xx/m4/bios/FATFS_Console_evmDRA78x_m4ExampleProject.txt
new file mode 100644 (file)
index 0000000..d21265b
--- /dev/null
@@ -0,0 +1,7 @@
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/main_console.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/src/FATFS_log.c"
+-ccs.linkFile "PDK_INSTALL_PATH/ti/fs/fatfs/example/console/dra7xx/m4/bios/fatfs.cfg"
+-ccs.setCompilerOptions "-qq -pdsw255 -mv7M4 --float_support=vfplib --abi=eabi -g -DSOC_DRA78x -DevmDRA78x -Dti_targets_arm_elf_M4 -I${PDK_INSTALL_PATH}/ti/drv/mmcsd "  -rtsc.enableRtsc
+-ccs.setLinkerOptions "--strict_compatibility=on"
+-rtsc.setConfiguroOptions "--cfgArgs {SOC:\"dra78x\", BOARD:\"evmDRA78x\"}"
diff --git a/packages/ti/fs/fatfs/example/console/dra7xx/m4/bios/fatfs.cfg b/packages/ti/fs/fatfs/example/console/dra7xx/m4/bios/fatfs.cfg
new file mode 100644 (file)
index 0000000..d0da2e0
--- /dev/null
@@ -0,0 +1,233 @@
+/**\r
+ *  \file   fatfs.cfg\r
+ *\r
+ *  \brief  Sysbios config file for mmcsd M4 example project on DRA7x EVMs.\r
+ *\r
+ */\r
+\r
+/*\r
+ * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ *\r
+ * Redistributions of source code must retain the above copyright\r
+ * notice, this list of conditions and the following disclaimer.\r
+ *\r
+ * Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the\r
+ * documentation and/or other materials provided with the\r
+ * distribution.\r
+ *\r
+ * Neither the name of Texas Instruments Incorporated nor the names of\r
+ * its contributors may be used to endorse or promote products derived\r
+ * from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ */\r
+/* ================ General configuration ================ */\r
+var Main      = xdc.useModule('xdc.runtime.Main');\r
+var System    = xdc.useModule('xdc.runtime.System');\r
+var Task      = xdc.useModule('ti.sysbios.knl.Task');\r
+var Mailbox   = xdc.useModule('ti.sysbios.knl.Mailbox');\r
+var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');\r
+var Timer     = xdc.useModule('ti.sysbios.hal.Timer');\r
+var IntXbar   = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');\r
+\r
+var SourceDir = xdc.useModule('xdc.cfg.SourceDir');\r
+SourceDir.outputDir = "src";\r
+\r
+/* ================ BIOS configuration ================ */\r
+\r
+var BIOS = xdc.useModule('ti.sysbios.BIOS');\r
+\r
+/*\r
+ * Create and install logger for the whole system\r
+ */\r
+BIOS.libType = BIOS.LibType_Custom;\r
+/*\r
+ * The BIOS module will create the default heap for the system.\r
+ * Specify the size of this default heap.\r
+ */\r
+BIOS.heapSize = 0xA0000;\r
+\r
+/* ================ Driver configuration ================ */\r
+var soc   = Program.build.cfgArgs.SOC.toLowerCase();\r
+var board = Program.build.cfgArgs.BOARD;\r
+xdc.print("# !!!  Current soc is [" + soc + "] !!!");\r
+xdc.print("# !!!  Current board is [" + board + "] !!!");\r
+\r
+/*use CSL package*/\r
+var Csl = xdc.loadPackage('ti.csl');\r
+Csl.Settings.deviceType = soc;\r
+\r
+/* Load the Osal package */\r
+var osType           = "tirtos";\r
+var Osal             = xdc.loadPackage('ti.osal');\r
+Osal.Settings.osType  = osType;\r
+Osal.Settings.socType = soc;\r
+\r
+/* Load the mmcsd package */\r
+var Mmcsd             = xdc.loadPackage('ti.drv.mmcsd');\r
+Mmcsd.Settings.socType = soc;\r
+\r
+/* Load the fatfs package */\r
+var Fatfs = xdc.loadPackage('ti.fs.fatfs');\r
+\r
+/* Load the GPIO package */\r
+var GPIO = xdc.loadPackage('ti.drv.gpio');\r
+GPIO.Settings.socType = soc;\r
+\r
+/* Load the UART package */\r
+var UART = xdc.loadPackage('ti.drv.uart');\r
+UART.Settings.socType = soc;\r
+\r
+/* Load the I2C package */\r
+var I2C = xdc.loadPackage('ti.drv.i2c');\r
+I2C.Settings.socType = soc;\r
+\r
+/* Load the Board package and set the board name */\r
+var Board = xdc.loadPackage('ti.board');\r
+Board.Settings.boardName = board;\r
+\r
+/* ================ Cache and MMU configuration ================ */\r
+\r
+/* Enable cache */\r
+var Cache = xdc.useModule('ti.sysbios.hal.unicache.Cache');\r
+Cache.enableCache = true;\r
+\r
+/* Use AMMU module */\r
+var AMMU = xdc.useModule('ti.sysbios.hal.ammu.AMMU');\r
+\r
+/* Large PAGE */\r
+AMMU.largePages[0].pageEnabled = AMMU.Enable_YES;\r
+AMMU.largePages[0].logicalAddress = 0x40000000;\r
+AMMU.largePages[0].translatedAddress = 0x40000000;\r
+AMMU.largePages[0].translationEnabled = AMMU.Enable_YES;\r
+AMMU.largePages[0].size = AMMU.Large_512M;\r
+AMMU.largePages[0].L1_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.largePages[0].L1_posted = AMMU.PostedPolicy_NON_POSTED;\r
+AMMU.largePages[0].L2_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.largePages[0].L2_posted = AMMU.PostedPolicy_NON_POSTED;\r
+\r
+AMMU.largePages[1].pageEnabled = AMMU.Enable_YES;\r
+AMMU.largePages[1].logicalAddress = 0x80000000;\r
+AMMU.largePages[1].translatedAddress = 0x80000000;\r
+AMMU.largePages[1].translationEnabled = AMMU.Enable_YES;\r
+AMMU.largePages[1].size = AMMU.Large_512M;\r
+AMMU.largePages[1].L1_writePolicy = AMMU.WritePolicy_WRITE_BACK;\r
+AMMU.largePages[1].L1_allocate = AMMU.AllocatePolicy_ALLOCATE;\r
+AMMU.largePages[1].L1_cacheable = AMMU.CachePolicy_CACHEABLE;\r
+AMMU.largePages[1].L1_posted = AMMU.PostedPolicy_POSTED;\r
+AMMU.largePages[1].L2_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.largePages[1].L2_posted = AMMU.PostedPolicy_NON_POSTED;\r
+\r
+AMMU.largePages[2].pageEnabled = AMMU.Enable_YES;\r
+AMMU.largePages[2].logicalAddress = 0xA0000000;\r
+AMMU.largePages[2].translatedAddress = 0xA0000000;\r
+AMMU.largePages[2].translationEnabled = AMMU.Enable_YES;\r
+AMMU.largePages[2].size = AMMU.Large_512M;\r
+AMMU.largePages[2].L1_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.largePages[2].L1_posted = AMMU.PostedPolicy_NON_POSTED;\r
+AMMU.largePages[2].L2_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.largePages[2].L2_posted = AMMU.PostedPolicy_NON_POSTED;\r
+\r
+AMMU.largePages[3].pageEnabled = AMMU.Enable_YES;\r
+AMMU.largePages[3].logicalAddress = 0x60000000;\r
+AMMU.largePages[3].translatedAddress = 0x40000000;\r
+AMMU.largePages[3].translationEnabled = AMMU.Enable_YES;\r
+AMMU.largePages[3].size = AMMU.Large_512M;\r
+AMMU.largePages[3].L1_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.largePages[3].L1_posted = AMMU.PostedPolicy_NON_POSTED;\r
+AMMU.largePages[3].L2_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.largePages[3].L2_posted = AMMU.PostedPolicy_NON_POSTED;\r
+\r
+/* Medium Page */\r
+AMMU.mediumPages[0].pageEnabled = AMMU.Enable_YES;\r
+AMMU.mediumPages[0].logicalAddress = 0x00300000;\r
+AMMU.mediumPages[0].translatedAddress = 0x40300000;\r
+AMMU.mediumPages[0].translationEnabled = AMMU.Enable_YES;\r
+AMMU.mediumPages[0].size = AMMU.Medium_256K;\r
+\r
+AMMU.mediumPages[1].pageEnabled = AMMU.Enable_YES;\r
+AMMU.mediumPages[1].logicalAddress = 0x00400000;\r
+AMMU.mediumPages[1].translatedAddress = 0x40400000;\r
+AMMU.mediumPages[1].translationEnabled = AMMU.Enable_YES;\r
+AMMU.mediumPages[1].size = AMMU.Medium_256K;\r
+AMMU.mediumPages[1].L1_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.mediumPages[1].L1_posted = AMMU.PostedPolicy_POSTED;\r
+AMMU.mediumPages[1].L2_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.mediumPages[1].L2_posted = AMMU.PostedPolicy_NON_POSTED;\r
+\r
+/* Small Page */\r
+AMMU.smallPages[0].pageEnabled = AMMU.Enable_YES;\r
+AMMU.smallPages[0].logicalAddress = 0x00000000;\r
+AMMU.smallPages[0].translatedAddress = 0x55020000;\r
+AMMU.smallPages[0].translationEnabled = AMMU.Enable_YES;\r
+AMMU.smallPages[0].size = AMMU.Small_16K;\r
+AMMU.smallPages[0].volatileQualifier = AMMU.Volatile_FOLLOW;\r
+AMMU.smallPages[0].L1_cacheable = AMMU.CachePolicy_CACHEABLE;\r
+AMMU.smallPages[0].L1_posted = AMMU.PostedPolicy_NON_POSTED;\r
+AMMU.smallPages[0].L2_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.smallPages[0].L2_posted = AMMU.PostedPolicy_NON_POSTED;\r
+\r
+AMMU.smallPages[1].pageEnabled = AMMU.Enable_YES;\r
+AMMU.smallPages[1].logicalAddress = 0x40000000;\r
+AMMU.smallPages[1].translatedAddress = 0x55080000;\r
+AMMU.smallPages[1].translationEnabled = AMMU.Enable_YES;\r
+AMMU.smallPages[1].size = AMMU.Small_16K;\r
+AMMU.smallPages[1].volatileQualifier = AMMU.Volatile_FOLLOW;\r
+AMMU.smallPages[1].L1_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.smallPages[1].L1_posted = AMMU.PostedPolicy_NON_POSTED;\r
+AMMU.smallPages[1].L2_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.smallPages[1].L2_posted = AMMU.PostedPolicy_NON_POSTED;\r
+\r
+AMMU.smallPages[2].pageEnabled = AMMU.Enable_YES;\r
+AMMU.smallPages[2].logicalAddress = 0x00004000;\r
+AMMU.smallPages[2].translatedAddress = 0x55024000;\r
+AMMU.smallPages[2].translationEnabled = AMMU.Enable_YES;\r
+AMMU.smallPages[2].size = AMMU.Small_16K;\r
+AMMU.smallPages[2].L1_cacheable = AMMU.CachePolicy_CACHEABLE;\r
+AMMU.smallPages[2].L1_posted = AMMU.PostedPolicy_NON_POSTED;\r
+AMMU.smallPages[2].L2_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.smallPages[2].L2_posted = AMMU.PostedPolicy_NON_POSTED;\r
+\r
+AMMU.smallPages[3].pageEnabled = AMMU.Enable_YES;\r
+AMMU.smallPages[3].logicalAddress = 0x00008000;\r
+AMMU.smallPages[3].translatedAddress = 0x55028000;\r
+AMMU.smallPages[3].translationEnabled = AMMU.Enable_YES;\r
+AMMU.smallPages[3].size = AMMU.Small_16K;\r
+AMMU.smallPages[3].L1_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.smallPages[3].L1_posted = AMMU.PostedPolicy_NON_POSTED;\r
+AMMU.smallPages[3].L2_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.smallPages[3].L2_posted = AMMU.PostedPolicy_NON_POSTED;\r
+\r
+AMMU.smallPages[4].pageEnabled = AMMU.Enable_YES;\r
+AMMU.smallPages[4].logicalAddress = 0x20000000;\r
+AMMU.smallPages[4].translatedAddress = 0x55020000;\r
+AMMU.smallPages[4].translationEnabled = AMMU.Enable_YES;\r
+AMMU.smallPages[4].size = AMMU.Small_16K;\r
+AMMU.smallPages[4].L1_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.smallPages[4].L1_posted = AMMU.PostedPolicy_NON_POSTED;\r
+AMMU.smallPages[4].L2_cacheable = AMMU.CachePolicy_NON_CACHEABLE;\r
+AMMU.smallPages[4].L2_posted = AMMU.PostedPolicy_NON_POSTED;\r
+\r
+/* ================ Memory sections configuration ================ */\r
+if (soc == "dra72x" || soc == "dra75x")\r
+{\r
+    Program.linkTemplate = xdc.findFile("ti/build/dra7xx/linkcmd.xdt");\r
+    Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1_VIRT";\r
+    Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1_VIRT";\r
+}\r
diff --git a/packages/ti/fs/fatfs/example/console/makefile b/packages/ti/fs/fatfs/example/console/makefile
new file mode 100755 (executable)
index 0000000..3e3cfac
--- /dev/null
@@ -0,0 +1,87 @@
+# Makefile for FATFS unit test app
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make
+export DISABLE_RECURSE_DEPS
+
+ifeq ($(SMP), enable)
+    #Name of the directory created under packages/ti/binary/
+    APP_NAME = FATFS_Console_SMP_TestApp
+    # Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
+    LOCAL_APP_NAME = FATFS_Console_$(BOARD)_$(CORE)_SMP_TestApp
+else
+    #Name of the directory created under packages/ti/binary/
+    APP_NAME = FATFS_Console_TestApp
+    # Name of the binary if different from the default (APP_NAME)_$(BOARD_$(CORE)_<build_profile>
+    LOCAL_APP_NAME = FATFS_Console_$(BOARD)_$(CORE)TestApp
+endif
+
+ifeq ($(SOC),$(filter $(SOC), am65xx))
+SRCDIR = ./src ../
+INCDIR = ./src
+# Common source files across all platforms and cores
+SRCS_COMMON += main_console.c FATFS_log.c fs_shell_app_utils.c
+
+ifeq ($(CORE),$(filter $(CORE), mpu1_0))
+# Enable XDC build for application by providing XDC CFG File per core
+XDC_CFG_FILE_$(CORE) = ./am65xx/a53/fatfsConsole_a53.cfg
+endif
+
+ifeq ($(CORE),$(filter $(CORE), mcu1_0))
+# Enable XDC build for application by providing XDC CFG File per core
+XDC_CFG_FILE_$(CORE) = ./am65xx/r5/fatfsConsole_r5.cfg
+endif
+
+endif
+
+ifeq ($(SOC),$(filter $(SOC), j721e))
+SRCDIR = ./src ../
+INCDIR = ./src
+# Common source files across all platforms and cores
+SRCS_COMMON += main_console.c FATFS_log.c fs_shell_app_utils.c
+
+XDC_CFG_FILE_$(CORE) = $(PDK_INSTALL_PATH)/ti/build/$(SOC)/sysbios_$(ISA).cfg
+endif
+
+# List all the external components/interfaces, whose interface header files
+# need to be included for this component
+INCLUDE_EXTERNAL_INTERFACES = bios xdc pdk
+
+# List all the components required by the application
+COMP_LIST_COMMON = csl osal_tirtos mmcsd gpio uart board fatfs_indp
+
+ifeq ($(SOC),$(filter $(SOC), am65xx j721e))
+COMP_LIST_COMMON += sciclient i2c
+endif
+
+CFLAGS_FATFS_UT =
+
+
+# EVM build
+ifeq ($(BOARD),$(filter $(BOARD), am65xx-evm))
+CFLAGS_FATFS_UT += -Dam65xx_evm
+endif
+
+# am65xx build
+ifeq ($(BOARD),$(filter $(BOARD), am65xx-sim))
+CFLAGS_FATFS_UT    += -Dam65xx_sim
+endif
+
+PACKAGE_SRCS_COMMON = ../
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) $(CFLAGS_FATFS_UT)
+
+# Core/SoC/platform specific source files and CFLAGS
+# Example:
+#   SRCS_<core/SoC/platform-name> =
+#   CFLAGS_LOCAL_<core/SoC/platform-name> =
+
+# 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/fs/fatfs/example/console/src/FATFS_log.c b/packages/ti/fs/fatfs/example/console/src/FATFS_log.c
new file mode 100644 (file)
index 0000000..b1d4f60
--- /dev/null
@@ -0,0 +1,115 @@
+/**
+ *  \file   I2C_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/runtime/System.h>
+#include <stdio.h>
+
+/* BIOS Header files */
+#include <ti/sysbios/BIOS.h>
+#include <ti/sysbios/family/arm/a15/Cache.h>
+#include <ti/csl/hw_types.h>
+/* TI-RTOS Header files */
+#include <ti/drv/uart/UART.h>
+#include <ti/drv/uart/UART_stdio.h>
+#if !defined(SOC_AM65XX) && !defined(SOC_J721E)
+#include <ti/csl/soc/am572x/src/cslr_control_core_pad_io.h>
+#endif
+
+/**********************************************************************
+ ************************** Macros ************************************
+ **********************************************************************/
+#define SOC_CORE_PAD_IO_REGISTERS_BASE                     (0x4a003400U)
+
+
+/**********************************************************************
+ ************************** Internal functions ************************
+ **********************************************************************/
+/* board init function */
+void Board_initUART(void);
+
+/**********************************************************************
+ ************************** Global Variables **************************
+ **********************************************************************/
+
+
+/*
+ *  ======== ConsoleUtilsInit ========
+ */
+void ConsoleUtilsInit(void)
+{
+    /* Call board init functions */
+    Board_initUART();
+
+    UART_stdioInit(0);
+}
+
+/*
+ *  ======== Board_initUART ========
+ */
+void Board_initUART(void) {
+#if !defined(SOC_AM65XX) && !defined(SOC_J721E)
+          HW_WR_REG32((SOC_CORE_PAD_IO_REGISTERS_BASE + CSL_CONTROL_CORE_PAD_IO_PAD_UART1_RXD),
+            (CSL_CONTROL_CORE_PAD_IO_PAD_UART1_RXD_UART1_RXD_INPUTENABLE_MASK |
+                    CSL_CONTROL_CORE_PAD_IO_PAD_UART1_RXD_UART1_RXD_SLEWCONTROL_MASK |
+                    CSL_CONTROL_CORE_PAD_IO_PAD_UART1_RXD_UART1_RXD_PULLTYPESELECT_MASK));
+
+        /* TXD */
+        HW_WR_REG32((SOC_CORE_PAD_IO_REGISTERS_BASE + CSL_CONTROL_CORE_PAD_IO_PAD_UART1_TXD),
+            (CSL_CONTROL_CORE_PAD_IO_PAD_UART1_TXD_UART1_TXD_INPUTENABLE_MASK |
+                    CSL_CONTROL_CORE_PAD_IO_PAD_UART1_TXD_UART1_TXD_SLEWCONTROL_MASK |
+                    CSL_CONTROL_CORE_PAD_IO_PAD_UART1_TXD_UART1_TXD_PULLTYPESELECT_MASK));
+
+        /* RTSN */
+        HW_WR_REG32((SOC_CORE_PAD_IO_REGISTERS_BASE + CSL_CONTROL_CORE_PAD_IO_PAD_UART1_RTSN),
+            (CSL_CONTROL_CORE_PAD_IO_PAD_UART1_RTSN_UART1_RTSN_INPUTENABLE_MASK |
+                    CSL_CONTROL_CORE_PAD_IO_PAD_UART1_RTSN_UART1_RTSN_PULLTYPESELECT_MASK));
+
+        /* CTSN */
+        HW_WR_REG32((SOC_CORE_PAD_IO_REGISTERS_BASE + CSL_CONTROL_CORE_PAD_IO_PAD_UART1_CTSN),
+            (CSL_CONTROL_CORE_PAD_IO_PAD_UART1_CTSN_UART1_CTSN_INPUTENABLE_MASK |
+                    CSL_CONTROL_CORE_PAD_IO_PAD_UART1_CTSN_UART1_CTSN_PULLTYPESELECT_MASK));
+#endif
+}
+
+
diff --git a/packages/ti/fs/fatfs/example/console/src/FATFS_log.h b/packages/ti/fs/fatfs/example/console/src/FATFS_log.h
new file mode 100644 (file)
index 0000000..ea3614d
--- /dev/null
@@ -0,0 +1,80 @@
+/**
+ *  \file   FATFS_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 _FATFS_LOG_H
+#define _FATFS_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>
+#if !defined(SOC_AM65XX) && !defined(SOC_J721E)
+#include <ti/csl/soc/am572x/src/cslr_control_core_pad_io.h>
+#endif
+
+/**********************************************************************
+ ************************** 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 FATFS_log                UART_printf
+#else
+#define FATFS_log                printf
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FATFS_LOG_H */
diff --git a/packages/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c b/packages/ti/fs/fatfs/example/console/src/fs_shell_app_utils.c
new file mode 100644 (file)
index 0000000..0004f3f
--- /dev/null
@@ -0,0 +1,1121 @@
+/**
+ *  \file  fs_shell_app_utils.c
+ *
+ *  \brief This file implements file system shell interface.
+ *
+ *  \copyright Copyright (C) 2013-2018 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 Files                                  */
+/* ========================================================================== */
+
+#include <ti/csl/tistdtypes.h>
+#include "string.h"
+#include "stdio.h"
+#include <ti/csl/csl_error.h>
+#include <ti/fs/fatfs/ff.h>
+#include "FATFS_log.h"
+#include "fs_shell_app_utils.h"
+
+/* ========================================================================== */
+/*                           Macros & Typedefs                                */
+/* ========================================================================== */
+
+/*****************************************************************************
+Defines the size of the buffers that hold the path, or temporary data from
+the memory card.  There are two buffers allocated of this size.  The buffer
+size must be large enough to hold the longest expected full path name,
+including the file name, and a trailing null character.
+******************************************************************************/
+#define FS_SHELL_APP_UTILS_PATH_BUF_SIZE   512
+
+/* Defines size of the buffers that hold temporary data. */
+#define FS_SHELL_APP_UTILS_DATA_BUF_SIZE   512
+/*****************************************************************************
+Defines the size of the buffer that holds the command line.
+******************************************************************************/
+#define FS_SHELL_APP_UTILS_CMD_CMD_BUF_SIZE    512
+
+/*****************************************************************************
+Defines the help message for cat.
+******************************************************************************/
+#define FS_SHELL_APP_UTILS_CMD_INFO_CAT                                            \
+        "  : Show contents of a text file : cat <FILENAME> \n"                 \
+                  "       Write to a file : cat <INPUTFILE> > <OUTPUTFILE> \n" \
+                   "       Read from UART : cat dev.UART \n"                   \
+                  "       Write from UART : cat dev.UART > <OUTPUTFILE>"
+#define FS_SHELL_APP_UTILS_CMD_INFO_HELP  " : Display list of commands"
+#define FS_SHELL_APP_UTILS_CMD_INFO_LS  "   : Display list of files"
+#define FS_SHELL_APP_UTILS_CMD_INFO_CD     ": Change directory"
+#define FS_SHELL_APP_UTILS_CMD_INFO_MKDIR  ": Create directory"
+#define FS_SHELL_APP_UTILS_CMD_INFO_PWD  "  : Show current working directory"
+#define FS_SHELL_APP_UTILS_CMD_INFO_RM  "   : Delete a file or an empty directory"
+#ifdef MULTI_PARTITION
+#define FS_SHELL_APP_UTILS_CMD_INFO_EXIT    ": Exit the shell/console"
+#endif
+
+/* ========================================================================== */
+/*                         Structures and Enums                               */
+/* ========================================================================== */
+
+
+/* ========================================================================== */
+/*                 Internal Function Declarations                             */
+/* ========================================================================== */
+
+/**
+ *  \brief  Process a command line string into arguments and execute the command.
+ *          This function will take the supplied command line string and break it
+ *          up into individual arguments.  The first argument is treated as a
+ *          command and is searched for in the command table. If the command is
+ *          found, then the command function is called and all of the command line
+ *          arguments are passed in the normal argc, argv form.
+ *
+ *  \param  pCmdLine points to a string that contains a command line that was
+ *                  obtained by an application by some means.
+ *
+ *  \param  pCmdList points to a list of command entries used to process command
+ *                  line that was obtained by an application by some means.
+ *
+ *  \return Returns the status of execution of command line.
+ *          Following are possible values.
+ *          - CMDLINE_BAD_CMD if the command is not found,
+ *          - CMDLINE_TOO_MANY_ARGS if there are more arguments than can be parsed.
+ *          Otherwise it returns the code that was returned by the command function.
+ *
+ */
+int32_t FSShellAppUtilsCmdExecute(uint8_t *pCmdLine,
+                                         fsShellAppUtilsCmdEntry_t *pCmdList);
+
+/**
+ *  \brief   This function implements the "ls" command.
+ *
+ *  \param   argc   Number of arguments.
+ *  \param   argv   Arguments required to execute "ls" command.
+ *                  - First argument shall be "ls".
+ *                  - Ignore other arguments.
+ *
+ *  \return  CSL_SOK on success else error code.
+ *
+ **/
+int32_t FSShellAppUtilsCmdLs(int32_t argc, char *argv[]);
+
+/**
+ *  \brief   This function implements the "cd"/"chdir" command.
+ *
+ *  \param   argc   Number of arguments.
+ *  \param   argv   Arguments required to execute "cd"/"chdir" command.
+ *                  - First argument shall be "cd"/"chdir".
+ *                  - Second argument specifies the directory to be changed as
+ *                    current working directory.
+ *                    It shall be in one of the following format
+ *                      - file or directory name that is in current directory
+ *                        ("mydir").
+ *                      - file or directory name that is in current drive
+ *                        ("/my/path/to/my-dir").
+ *                      - fully specified path of file or directory with drive
+ *                        number/name ("drive:/my/path/to/my-dir").
+ *                  - Ignore other arguments.
+ *
+ *  \return  CSL_SOK on success else error code.
+ *
+ **/
+int32_t FSShellAppUtilsCmdCd(int32_t argc, char *argv[]);
+
+/**
+ *  \brief   This function implements the "pwd" command. It prints the current
+ *           working directory.
+ *
+ *  \param   argc   Number of arguments.
+ *  \param   argv   Arguments required to execute "pwd" command.
+ *                  - First argument shall be "pwd".
+ *                  - Ignore other arguments.
+ *
+ *  \return  CSL_SOK on success else error code.
+ *
+ **/
+int32_t FSShellAppUtilsCmdPwd(int32_t argc, char *argv[]);
+
+/**
+ *  \brief   This function implements the "mkdir" command.
+ *
+ *  \param   argc   Number of arguments.
+ *  \param   argv   Arguments required to execute "mkdir" command.
+ *                  - First argument shall be "mkdir".
+ *                  - Second argument specifies the new directory to be created.
+ *                    It shall be in one of the following format
+ *                      - file or directory name that is in current directory
+ *                        ("mydir").
+ *                      - file or directory name that is in current drive
+ *                        ("/my/path/to/my-dir").
+ *                      - fully specified path of file or directory with drive
+ *                        number/name ("drive:/my/path/to/my-dir").
+ *                  - Ignore other arguments.
+ *
+ *  \return  CSL_SOK on success else error code.
+ *
+ **/
+int32_t FSShellAppUtilsCmdMkDir(int32_t argc, char *argv[]);
+
+/**
+ *  \brief   This function implements the "rm" command.
+ *
+ *  \param   argc   Number of arguments.
+ *  \param   argv   Arguments required to execute "rm" command.
+ *                  - First argument shall be "rm".
+ *                  - Second argument specifies the file or working directory to
+ *                    be deleted. It shall be in one of the following format
+ *                      - file or directory name that is in current directory
+ *                        ("my-dir-file").
+ *                      - file or directory name that is in current drive
+ *                        ("/my/path/to/my-dir-file").
+ *                      - fully specified path of file or directory with drive
+ *                        number/name ("drive:/my/path/to/my-dir-file").
+ *                  - Ignore other arguments.
+ *
+ *  \return  CSL_SOK on success else error code.
+ *
+ **/
+int32_t FSShellAppUtilsCmdRm(int32_t argc, char *argv[]);
+
+/**
+ *  \brief   This function implements the "cat" command.
+ *
+ *  \param   argc   Number of arguments.
+ *  \param   argv   Arguments required to execute "cat" command.
+ *                  - First argument shall be "cat".
+ *                  - Second argument specifies the source of data or file to be
+ *                    read from.
+ *                    It shall be in one of the following format
+ *                      - file name that is in current directory ("myfile").
+ *                      - file that is in current drive ("/my/path/to/my-file").
+ *                      - fully specified path of file with drive number/name
+ *                        ("drive:/my/path/to/my-file").
+ *                      - "dev.UART" to read input from UART through xmodem
+ *                        protocol.
+ *                  - Third argument shall be ">" to perform write operation else
+ *                    read operation is performed.
+ *                  - Fouth argument specifies the file to which the data read
+ *                    shall be written.
+ *                    It shall be in one of the following format
+ *                      - file name that is in current directory ("myfile").
+ *                      - file that is in current drive ("/my/path/to/my-file").
+ *                      - fully specified path of file with drive number/name
+ *                        ("drive:/my/path/to/my-file").
+ *                  - Ignore other arguments.
+ *
+ *  \return  CSL_SOK on success else error code.
+ *
+ **/
+int32_t FSShellAppUtilsCmdCat(int32_t argc, char *argv[]);
+
+/**
+ *  \brief   This function provides help information on supported commands.
+ *
+ *  \param   argc   Number of arguments.
+ *  \param   argv   Arguments required provide help info on supported commands.
+ *                  - First argument shall be "help"/"h"/"?".
+ *                  - Ignore other arguments.
+ *
+ *  \return  CSL_SOK on success else error code.
+ *
+ **/
+int32_t FSShellAppUtilsCmdHelp(int32_t argc, char *argv[]);
+
+#ifdef MULTI_PARTITION
+/**
+ *  \brief   This function exits from the console and return to main menu.
+ *
+ *  \param   argc   Number of arguments.
+ *  \param   argv   Arguments required to execute "exit" command.
+ *                  - First argument shall be "exit".
+ *                  - Ignore other arguments.
+ *
+ *  \return  CSL_SOK on success else error code.
+ *
+ **/
+int32_t FSShellAppUtilsCmdExit(int32_t argc, char *argv[]);
+#endif
+
+/* ========================================================================== */
+/*                            Global Variables Declarations                   */
+/* ========================================================================== */
+#ifdef MULTI_PARTITION
+uint32_t gFsExitStatus = 0;
+#endif
+
+static DIR gFsShellAppUtilsDirObj;
+
+static FILINFO gFsShellAppUtilsFileInfo;
+
+volatile uint32_t gFsShellAppUtilsCurState = FS_SHELL_APP_UTILS_STATE_MAX;
+
+/*****************************************************************************
+A temporary data buffer used when manipulating file paths, or reading data
+from the memory card.
+******************************************************************************/
+static FIL gFsShellAppUtilsReadFileObj  __attribute__ ((aligned (SOC_CACHELINE_SIZE)));
+
+/*****************************************************************************
+A temporary data buffer used when manipulating file paths, or reading data
+from the memory card.
+******************************************************************************/
+static FIL gFsShellAppUtilsWriteFileObj  __attribute__ ((aligned (SOC_CACHELINE_SIZE)));
+
+/*****************************************************************************
+A temporary data buffer used when manipulating file paths, or reading data
+from the memory card.
+******************************************************************************/
+static char gFsShellAppUtilsTempPath[FS_SHELL_APP_UTILS_PATH_BUF_SIZE]
+                      __attribute__ ((aligned (SOC_CACHELINE_SIZE)));
+
+/*****************************************************************************
+A temporary data buffer used for reading data from or writing data
+to the memory card.
+******************************************************************************/
+static char gFsShellAppUtilsCwd[FS_SHELL_APP_UTILS_DATA_BUF_SIZE]
+                             __attribute__ ((aligned (SOC_CACHELINE_SIZE)));
+
+/*****************************************************************************
+A temporary data buffer used for reading data from or writing data
+to the memory card.
+******************************************************************************/
+static char gFsShellAppUtilsDataBuf[FS_SHELL_APP_UTILS_DATA_BUF_SIZE]
+                             __attribute__ ((aligned (SOC_CACHELINE_SIZE)));
+
+/*******************************************************************************
+**
+** This is the table that holds the command names, implementing functions, and
+** brief description.
+**
+*******************************************************************************/
+fsShellAppUtilsCmdEntry_t gFsShellAppUtilsCmdTable[] =
+{
+    { "help",     &FSShellAppUtilsCmdHelp,  FS_SHELL_APP_UTILS_CMD_INFO_HELP},
+    { "ls",       &FSShellAppUtilsCmdLs,    FS_SHELL_APP_UTILS_CMD_INFO_LS},
+    { "cd",       &FSShellAppUtilsCmdCd,    FS_SHELL_APP_UTILS_CMD_INFO_CD},
+    { "mkdir",    &FSShellAppUtilsCmdMkDir, FS_SHELL_APP_UTILS_CMD_INFO_MKDIR},
+    { "rm",       &FSShellAppUtilsCmdRm,    FS_SHELL_APP_UTILS_CMD_INFO_RM},
+    { "pwd",      &FSShellAppUtilsCmdPwd,   FS_SHELL_APP_UTILS_CMD_INFO_PWD},
+    { "cat",      &FSShellAppUtilsCmdCat,   FS_SHELL_APP_UTILS_CMD_INFO_CAT},
+#ifdef MULTI_PARTITION
+    { "exit",     &FSShellAppUtilsCmdExit,  FS_SHELL_APP_UTILS_CMD_INFO_EXIT},
+#endif
+    { 0, 0, 0 }
+};
+
+uint8_t gFsShellAppUtilsRxBuf[80U];
+
+/* ========================================================================== */
+/*                          Function Declarations                             */
+/* ========================================================================== */
+
+int32_t FSShellAppUtilsInit(void)
+{
+
+    return(FS_SHELL_APP_UTILS_CMD_STATUS_INVALID);
+}
+
+/* For checking if the media is still inserted */
+volatile uint8_t fs_is_media_inserted=1;
+
+#ifdef MULTI_PARTITION
+int32_t FSShellAppUtilsProcess(char *path)
+#else
+int32_t FSShellAppUtilsProcess(void)
+#endif
+{
+    uint32_t spinProcess = TRUE;
+    int32_t retStat = CSL_ESYS_FAIL;
+    uint8_t inputChar = 0U;
+    uint8_t inputCharIdx = 0U;
+
+    do
+    {
+        switch(gFsShellAppUtilsCurState)
+        {
+            case FS_SHELL_APP_UTILS_STATE_HELP:
+            {
+                /* On completion jump to next state. */
+                if(FR_OK == f_opendir(&gFsShellAppUtilsDirObj, gFsShellAppUtilsCwd))
+                {
+                    FATFS_log("TEST PASS.\n");
+                    FATFS_log("%s>", gFsShellAppUtilsCwd);
+                    gFsShellAppUtilsCurState = FS_SHELL_APP_UTILS_STATE_READ_COMMAND;
+                    spinProcess = TRUE;
+                    retStat = CSL_SOK;
+                }
+                /* Exit on error. */
+                else
+                {
+                    FATFS_log("%s>", "UNKNOWN");
+                    gFsShellAppUtilsCurState = FS_SHELL_APP_UTILS_STATE_MAX;
+                    spinProcess = TRUE;
+                    retStat = CSL_ESYS_FAIL;
+                }
+                break;
+            }
+
+            case FS_SHELL_APP_UTILS_STATE_READ_COMMAND:
+            {
+                if(FR_OK == f_opendir(&gFsShellAppUtilsDirObj, gFsShellAppUtilsCwd))
+                {
+                    //scanf("%s", gFsShellAppUtilsRxBuf);
+                    //UART_gets(gFsShellAppUtilsRxBuf, 80U);
+                    //gets(gFsShellAppUtilsRxBuf);
+                    //fflush(stdin);
+                   inputCharIdx = 0U;
+
+                    do
+                    {
+                        /*
+                        ** Read the next character from the UART.
+                        */
+                        inputChar = UART_getc();
+
+                        /*
+                        ** See if this character is a backspace and there is at least one
+                        ** character in the input line.
+                        */
+                        if((inputChar == '\b') && (inputCharIdx != 0))
+                        {
+                            /*
+                            ** Erase the last character from the input line.
+                            */
+                            UART_printf("\b \b");
+                            inputCharIdx--;
+                            gFsShellAppUtilsRxBuf[inputCharIdx] = '\0';
+                        }
+
+                        /*
+                        ** See if this character is a newline.
+                        */
+                        else if((inputChar == '\r') || (inputChar == '\n'))
+                        {
+                            /*
+                            ** Return to the caller.
+                            */
+                            UART_printf("\n");
+                            break;
+                        }
+
+                        /*
+                        ** See if this is a printable ASCII character.
+                        */
+                        else if((inputChar >= ' ') && (inputChar <= '~') &&
+                                (inputCharIdx < (sizeof(gFsShellAppUtilsRxBuf) - 1)))
+                        {
+                            /*
+                            ** Add this character to the input buffer.
+                            */
+                            gFsShellAppUtilsRxBuf[inputCharIdx++] = inputChar;
+                            gFsShellAppUtilsRxBuf[inputCharIdx] = '\0';
+                            UART_printf("%c", inputChar);
+                        }
+                    } while (1);
+
+                    gFsShellAppUtilsCurState = FS_SHELL_APP_UTILS_STATE_EXECUTE_COMMAND;
+                    spinProcess = TRUE;
+                    retStat = CSL_SOK;
+                }
+                /* Exit on error. */
+                else
+                {
+                    FATFS_log("%s>", "UNKNOWN");
+                    gFsShellAppUtilsCurState = FS_SHELL_APP_UTILS_STATE_MAX;
+                    spinProcess = TRUE;
+                    retStat = CSL_ESYS_FAIL;
+                }
+                break;
+            }
+
+            case FS_SHELL_APP_UTILS_STATE_EXECUTE_COMMAND:
+            {
+                /* On completion jump to next state. */
+                if(FR_OK == f_opendir(&gFsShellAppUtilsDirObj, gFsShellAppUtilsCwd))
+                {
+                    FSShellAppUtilsCmdExecute(gFsShellAppUtilsRxBuf, gFsShellAppUtilsCmdTable);
+                    gFsShellAppUtilsCurState = FS_SHELL_APP_UTILS_STATE_HELP;
+#ifdef MULTI_PARTITION
+                    if(gFsExitStatus)
+                    {
+                        gFsShellAppUtilsCurState = FS_SHELL_APP_UTILS_STATE_MAX;
+                        spinProcess = FALSE;
+                        gFsExitStatus = 0;
+                    }
+#else
+                    spinProcess = TRUE;
+#endif
+                    retStat = CSL_SOK;
+                }
+                /* Exit on error. */
+                else
+                {
+                    FATFS_log("%s>", "UNKNOWN");
+                    gFsShellAppUtilsCurState = FS_SHELL_APP_UTILS_STATE_MAX;
+                    spinProcess = TRUE;
+                    retStat = CSL_ESYS_FAIL;
+                }
+                break;
+            }
+
+            case FS_SHELL_APP_UTILS_STATE_MAX:
+            default:
+            {
+#ifdef MULTI_PARTITION
+                strcpy(gFsShellAppUtilsCwd, path);
+#else
+                strcpy(gFsShellAppUtilsCwd, "0:");
+#endif
+
+                if(FR_OK == f_opendir(&gFsShellAppUtilsDirObj, gFsShellAppUtilsCwd))
+                {
+                    gFsShellAppUtilsCurState = FS_SHELL_APP_UTILS_STATE_HELP;
+                    spinProcess = TRUE;
+                    retStat = CSL_SOK;
+                }
+                else
+                {
+                    spinProcess = TRUE;
+                    gFsShellAppUtilsCurState = FS_SHELL_APP_UTILS_STATE_MAX;
+                    retStat = CSL_ESYS_FAIL;
+                    break;
+                }
+            }
+        }
+
+    } while( (TRUE == spinProcess) && (fs_is_media_inserted == 1) );
+
+    return retStat;
+}
+
+/* -------------------------------------------------------------------------- */
+/*                 Internal Function Definitions                              */
+/* -------------------------------------------------------------------------- */
+
+int32_t FSShellAppUtilsCmdExecute(uint8_t *pCmdLine,
+                                         fsShellAppUtilsCmdEntry_t *pCmdList)
+{
+    int32_t retStatus = CSL_ESYS_FAIL;
+    static uint8_t *argv[FSSHELLAPPUTILS_CMDLINE_MAX_ARGS + 1U];
+    uint8_t *pChar;
+    int32_t argc;
+    uint32_t findArg = TRUE;
+
+    /*
+        * Initialize the argument counter, and point to the beginning of the
+     * command line string.
+        */
+    argc = 0U;
+    pChar = pCmdLine;
+
+    /* Advance through the command line until a zero character is found. */
+    while(*pChar)
+    {
+        /*
+                * If there is a space, then replace it with a zero, and set the flag
+         * to search for the next argument.
+                */
+        if(*pChar == ' ')
+        {
+            *pChar = 0;
+            findArg = TRUE;
+        }
+
+        /*
+         * Otherwise it is not a space, so it must be a character that is part
+         * of an argument.
+                */
+        else
+        {
+            /*
+                        * If findArg is set, then that means we are looking for the start
+             * of the next argument.
+                        */
+            if(TRUE == findArg)
+            {
+                /*
+                                * As long as the maximum number of arguments has not been
+                 * reached, then save the pointer to the start of this new arg
+                 * in the argv array, and increment the count of args, argc.
+                                */
+                if(argc < FSSHELLAPPUTILS_CMDLINE_MAX_ARGS)
+                {
+                    argv[argc] = pChar;
+                    argc++;
+                    findArg = FALSE;
+                    retStatus = CSL_SOK;
+                }
+
+                /*
+                                * The maximum number of arguments has been reached so return
+                 * the error.
+                                */
+                else
+                {
+                    FATFS_log("Too many arguments for command processor!\n");
+                    retStatus = CSL_ESYS_FAIL;
+                    break;
+                }
+            }
+        }
+
+        /* Advance to the next character in the command line. */
+        pChar++;
+    }
+
+    /* If one or more arguments was found, then process the command. */
+    if((CSL_SOK == retStatus) && (0U != argc))
+    {
+        /*
+                * Search through the command table until a null command string is
+         * found, which marks the end of the table.
+                */
+        while(pCmdList->pCmd)
+        {
+            /*
+                        * If this command entry command string matches argv[0], then call
+             * the function for this command, passing the command line
+             * arguments.
+                        */
+            if(!strcmp((const char *)argv[0], (const char *)pCmdList->pCmd))
+            {
+                retStatus = pCmdList->pfnCmd(argc, (char **)argv);
+            }
+
+            /* Not found, so advance to the next entry. */
+            pCmdList++;
+        }
+    }
+
+    /*
+        * Fall through to here means that no matching command was found, so return
+     * an error.
+        */
+    return retStatus;
+}
+
+static int32_t FSShellAppUtilsFrmtPath(char* inputPath, char* outputPath)
+{
+    int32_t retStat = CSL_ESYS_FAIL;
+    uint32_t drvLen = 0U; /* relative path */
+
+    /* Append the input path. */
+    strcpy(outputPath, "");
+
+    /* Look for drive separator. */
+    drvLen = strcspn(inputPath, ":");
+
+    /*
+     * If path contains driver name.
+     */
+    if (drvLen < strlen(inputPath))
+    {
+        /* Append the input path. */
+        strcpy(outputPath, inputPath);
+
+        retStat = CSL_SOK;
+    }
+    /*
+     * If the first character is /, then this is a fully specified path, and it
+     * should just be used as-is.
+     */
+    else
+    {
+        /* Look for drive separator. */
+        drvLen = strcspn(gFsShellAppUtilsCwd, ":");
+
+        /*
+         * If path contains driver name.
+         */
+        if (drvLen < strlen(gFsShellAppUtilsCwd))
+        {
+            if('/' == *inputPath)
+            {
+                /*
+                 * Make sure the new path with drive number [X:] is not bigger than the
+                 * cwd buffer. It need to include a drive number, separator and a
+                 * trailing null character.
+                 */
+                if((strlen(inputPath) + drvLen + 1U + 1U) <= sizeof(gFsShellAppUtilsCwd))
+                {
+                    if(0U != strlen(gFsShellAppUtilsCwd))
+                    {
+                        /* Copy the current drive into the output buffer. */
+                        strncpy(outputPath, gFsShellAppUtilsCwd, drvLen + 1U);
+
+                        outputPath[drvLen + 1U] = '\0';
+
+                        if(strlen(inputPath) > 1U)
+                        {
+                            /* Append the input path. */
+                            strcat(outputPath, inputPath);
+                        }
+
+                        retStat = CSL_SOK;
+                    }
+                }
+                else
+                {
+                    retStat = CSL_ESYS_FAIL;
+                }
+            }
+            else
+            {
+                /*
+                 * Test to make sure that when the new additional path is added on to
+                 * the current path, there is room in the buffer for the full new path.
+                 * It needs to include a new separator, and a trailing null character.
+                 */
+                if((strlen(gFsShellAppUtilsCwd) + strlen(inputPath) + 1U + 1U) <= sizeof(gFsShellAppUtilsCwd))
+                {
+                    /*
+                     * Append the current working directory to relative path.
+                     */
+                    strcat(outputPath, gFsShellAppUtilsCwd);
+                    strcat(outputPath, "/");
+                    strcat(outputPath, inputPath);
+
+                    retStat = CSL_SOK;
+                }
+                else
+                {
+                    retStat = CSL_ESYS_FAIL;
+                }
+            }
+        }
+        else
+        {
+            retStat = FALSE;
+        }
+    }
+
+    return retStat;
+}
+
+int32_t FSShellAppUtilsCmdLs(int32_t argc, char *argv[])
+{
+    uint32_t totalSize = 0U;
+    uint32_t fileCount = 0U;
+    uint32_t dirCount = 0U;
+    FRESULT fresult;
+    FATFS *pFatFs;
+
+    /* Open the current directory for access. */
+    fresult = f_opendir(&gFsShellAppUtilsDirObj, gFsShellAppUtilsCwd);
+
+    /* Enter loop to enumerate through all directory entries. */
+    while(FR_OK == fresult)
+    {
+        /* Read an entry from the directory. */
+        fresult = f_readdir(&gFsShellAppUtilsDirObj, &gFsShellAppUtilsFileInfo);
+
+        /* Check for error and return if there is a problem. */
+        if(FR_OK == fresult)
+        {
+            /* If the file name is blank, then this is the end of the listing. */
+            if('\0' == gFsShellAppUtilsFileInfo.fname[0])
+            {
+                break;
+            }
+
+            /* If the attribute is directory, then increment the directory count. */
+            if(AM_DIR == (gFsShellAppUtilsFileInfo.fattrib & AM_DIR))
+            {
+                dirCount++;
+            }
+
+            /*
+             * Otherwise, it is a file.  Increment the file count, and add in the
+             * file size to the total.
+             */
+            else
+            {
+                fileCount++;
+                totalSize += gFsShellAppUtilsFileInfo.fsize;
+            }
+
+            /*
+             * Print the entry information on a single line with formatting to show
+             * the attributes, date, time, size, and name.
+             */
+            FATFS_log("%c%c%c%c%c %u/%02u/%02u %02u:%02u %9u  %s\n",
+                               (gFsShellAppUtilsFileInfo.fattrib & AM_DIR) ? 'D' : '-',
+                               (gFsShellAppUtilsFileInfo.fattrib & AM_RDO) ? 'R' : '-',
+                               (gFsShellAppUtilsFileInfo.fattrib & AM_HID) ? 'H' : '-',
+                               (gFsShellAppUtilsFileInfo.fattrib & AM_SYS) ? 'S' : '-',
+                               (gFsShellAppUtilsFileInfo.fattrib & AM_ARC) ? 'A' : '-',
+                               (gFsShellAppUtilsFileInfo.fdate >> 9) + 1980,
+                               (gFsShellAppUtilsFileInfo.fdate >> 5) & 15,
+                                gFsShellAppUtilsFileInfo.fdate & 31,
+                               (gFsShellAppUtilsFileInfo.ftime >> 11),
+                               (gFsShellAppUtilsFileInfo.ftime >> 5) & 63,
+                                gFsShellAppUtilsFileInfo.fsize,
+                                gFsShellAppUtilsFileInfo.fname);
+        }
+    }
+
+    /* Check for error and return if there is a problem. */
+    if(FR_OK == fresult)
+    {
+        /* Print summary lines showing the file, dir, and size totals. */
+        FATFS_log("\n%4u File(s),%10u bytes total\n%4u Dir(s)",
+                           fileCount, totalSize, dirCount);
+
+        /* Get the free space. */
+        fresult = f_getfree("/", (DWORD *)&totalSize, &pFatFs);
+
+        /* Check for error and return if there is a problem. */
+        if(FR_OK == fresult)
+        {
+            /* Display the amount of free space that was calculated. */
+            FATFS_log(", %10uK bytes free\n", totalSize * pFatFs->csize / 2);
+        }
+    }
+
+    /* Return status. */
+    return fresult;
+}
+
+int32_t FSShellAppUtilsCmdRm(int32_t argc, char *argv[])
+{
+    int32_t retStat = CSL_ESYS_FAIL;
+    FRESULT fresult;
+
+    /*
+     * Format the path of file/folder to be removed with drive and absolute path.
+     */
+    retStat = FSShellAppUtilsFrmtPath(argv[1U], gFsShellAppUtilsTempPath);
+
+    if (CSL_SOK == retStat)
+    {
+        /* Remove file or directory path is in gFsShellAppUtilsTempPath. */
+        fresult = f_unlink(gFsShellAppUtilsTempPath);
+
+        /* Check status. Inform user and return. */
+        if(fresult != FR_OK)
+        {
+            retStat = CSL_ESYS_FAIL;
+        }
+    }
+
+    /* Return status. */
+    return retStat;
+}
+
+int32_t FSShellAppUtilsCmdMkDir(int32_t argc, char *argv[])
+{
+    int32_t retStat = CSL_ESYS_FAIL;
+    FRESULT fresult;
+
+    /*
+     * Format the path of folder to be created with drive and absolute path.
+     */
+    retStat = FSShellAppUtilsFrmtPath(argv[1U], gFsShellAppUtilsTempPath);
+
+    if (CSL_SOK == retStat)
+    {
+        /* Create new directory at the path in chTmpBuf. */
+        fresult = f_mkdir(gFsShellAppUtilsTempPath);
+
+        /* Check for the status of create directory.  Inform user and return. */
+        if(FR_OK != fresult)
+        {
+            FATFS_log("mkdir: %s\n", gFsShellAppUtilsTempPath);
+            retStat = CSL_ESYS_FAIL;
+        }
+    }
+
+    /* Return status. */
+    return retStat;
+}
+
+int32_t FSShellAppUtilsCmdCd(int32_t argc, char *argv[])
+{
+    int32_t retStat = CSL_ESYS_FAIL;
+    FRESULT fresult;
+
+    /*
+     * Format the path of folder to be created with drive and absolute path.
+     */
+    retStat = FSShellAppUtilsFrmtPath(argv[1U], gFsShellAppUtilsTempPath);
+
+    if (CSL_SOK == retStat)
+    {
+        /*
+         * At this point, a candidate new directory path is in chTmpBuf.  Try to
+         * open it to make sure it is valid.
+         */
+        fresult = f_opendir(&gFsShellAppUtilsDirObj, gFsShellAppUtilsTempPath);
+
+        /* If it can't be opened, then it is a bad path.  Inform user and return. */
+        if(FR_OK != fresult)
+        {
+            FATFS_log("cd: %s\n", gFsShellAppUtilsTempPath);
+            retStat = CSL_ESYS_FAIL;
+        }
+
+        /* Otherwise, it is a valid new path, so copy it into the CWD. */
+        else
+        {
+            strncpy(gFsShellAppUtilsCwd, gFsShellAppUtilsTempPath, sizeof(gFsShellAppUtilsCwd));
+        }
+    }
+
+    /* Return status. */
+    return retStat;
+}
+
+int32_t FSShellAppUtilsCmdPwd(int32_t argc, char *argv[])
+{
+    /* Print the CWD to the console. */
+    FATFS_log("%s\n", gFsShellAppUtilsCwd);
+
+    return CSL_SOK;
+}
+
+int32_t FSShellAppUtilsCmdCat(int32_t argc, char *argv[])
+{
+    FRESULT fresultRead = FR_NOT_READY;
+    FRESULT fresultWrite = FR_NOT_READY;
+    uint32_t bytesWrite = 0;
+    uint32_t flagWrite = FALSE;
+    uint32_t usBytesRead = 0;
+    uint32_t flagRead = FALSE;
+    int32_t retStat = CSL_ESYS_FAIL;
+
+    strcpy(gFsShellAppUtilsTempPath, "");
+
+    /*
+     * Format the path of folder to be created with drive and absolute path.
+     */
+    retStat = FSShellAppUtilsFrmtPath(argv[1U], gFsShellAppUtilsTempPath);
+
+    if (CSL_SOK == retStat)
+    {
+        /* Open the file for reading. */
+        fresultRead = f_open(&gFsShellAppUtilsReadFileObj, gFsShellAppUtilsTempPath, FA_READ);
+
+        /* If there was some problem opening the file, then return an error. */
+        if(fresultRead != FR_OK)
+        {
+            FATFS_log("Fail to open file for read !!!!\n");
+            retStat = CSL_ESYS_FAIL;
+        }
+        else
+        {
+            flagRead = TRUE;
+        }
+    }
+
+    if (CSL_SOK == retStat)
+    {
+        /*
+         * Check for arguments if requested for copy to another file.
+         * Copy the current path to the temporary buffer for new file creation.
+         */
+        if(argc >= 4)
+        {
+            if(0U == strcmp(argv[2], ">"))
+            {
+                strcpy(gFsShellAppUtilsTempPath, "");
+
+                /*
+                 * Format the path of folder to be created with drive and absolute path.
+                 */
+                retStat = FSShellAppUtilsFrmtPath(argv[3U], gFsShellAppUtilsTempPath);
+
+                if (CSL_SOK == retStat)
+                {
+                    fresultWrite = f_open(&gFsShellAppUtilsWriteFileObj, gFsShellAppUtilsTempPath,
+                                                               FA_WRITE|FA_OPEN_ALWAYS);
+
+                    if(fresultWrite != FR_OK)
+                    {
+                        FATFS_log("Fail to open file for write !!!!\n");
+                        retStat = CSL_ESYS_FAIL;
+                    }
+                    else
+                    {
+                        flagWrite = TRUE;
+                    }
+                }
+            }
+        }
+    }
+
+    if (CSL_SOK == retStat)
+    {
+        /*
+         * Enter a loop to repeatedly read data from the file and display it,
+         * until the end of the file is reached.
+         */
+        do
+        {
+            /*
+             * Read a block of data from the file.  Read as much as can fit in
+             * temporary buffer, including a space for the trailing null.
+             */
+            fresultRead = f_read(&gFsShellAppUtilsReadFileObj, gFsShellAppUtilsDataBuf,
+                                 sizeof(gFsShellAppUtilsDataBuf) - 1, &usBytesRead);
+
+            /*
+             * If there was an error reading, then print a newline and return
+             * error to the user.
+             */
+            if(fresultRead != FR_OK)
+            {
+                FATFS_log("Fail to read from file !!!!\n");
+                retStat = CSL_ESYS_FAIL;
+            }
+
+            /*
+             * Write the data to the destination file user has selected.
+             * If there was an error writing, then print a newline and return
+             * error to the user.
+             */
+            if(TRUE == flagWrite)
+            {
+                fresultWrite = f_write(&gFsShellAppUtilsWriteFileObj, gFsShellAppUtilsDataBuf,
+                                       usBytesRead, &bytesWrite);
+
+                if(fresultWrite != FR_OK)
+                {
+                    FATFS_log("Fail to write into file !!!!\n");
+                    retStat = CSL_ESYS_FAIL;
+                }
+            }
+            else
+
+            {
+                /*
+                 * Null terminate the last block that was read to make it a null
+                 * terminated string that can be used with FATFS_log.
+                 */
+                gFsShellAppUtilsDataBuf[usBytesRead] = 0;
+
+                /* Print the last chunk of the file that was received. */
+                FATFS_log("%s",gFsShellAppUtilsDataBuf);
+            }
+
+            /*
+             * Continue reading until less than the full number of bytes are
+             * read. That means the end of the buffer was reached.
+             */
+        }
+        while(usBytesRead == (sizeof(gFsShellAppUtilsDataBuf) - 1));
+    }
+
+       /*
+        * Close the Read file.
+        * If there was an error writing, then print a newline and return the
+        * error to the user.
+        */
+       if(TRUE == flagRead)
+       {
+               fresultRead = f_close(&gFsShellAppUtilsReadFileObj);
+
+               if(fresultRead != FR_OK)
+               {
+            FATFS_log("Fail to close read file !!!!\n");
+            retStat = CSL_ESYS_FAIL;
+               }
+       }
+
+       /*
+        * Close the Write file.
+        * If there was an error writing, then print a newline and return the
+        * error to the user.
+        */
+       if(TRUE == flagWrite)
+       {
+               fresultWrite = f_close(&gFsShellAppUtilsWriteFileObj);
+
+               if(fresultWrite != FR_OK)
+               {
+            FATFS_log("Fail to close write file !!!!\n");
+            retStat = CSL_ESYS_FAIL;
+               }
+       }
+
+    /* Return success. */
+    return retStat;
+}
+
+int32_t FSShellAppUtilsCmdHelp(int32_t argc, char *argv[])
+{
+    fsShellAppUtilsCmdEntry_t *pEntry;
+
+    /*
+    ** Print some header text.
+    */
+    FATFS_log("\nAvailable commands\n");
+    FATFS_log("------------------\n");
+
+    /*
+    ** Point at the beginning of the command table.
+    */
+    pEntry = &gFsShellAppUtilsCmdTable[0];
+
+    /*
+    ** Enter a loop to read each entry from the command table.  The end of the
+    ** table has been reached when the command name is NULL.
+    */
+    while(pEntry->pCmd)
+    {
+        /*
+        ** Print the command name and the brief description.
+        */
+        FATFS_log("%s%s\n", pEntry->pCmd, pEntry->pHelp);
+
+        /*
+        ** Advance to the next entry in the table.
+        */
+        pEntry++;
+    }
+
+    /* Return success. */
+    return(0);
+}
+
+#ifdef MULTI_PARTITION
+int32_t FSShellAppUtilsCmdExit(int32_t argc, char *argv[])
+{
+       gFsExitStatus =1;
+    return CSL_SOK;
+}
+#endif
diff --git a/packages/ti/fs/fatfs/example/console/src/fs_shell_app_utils.h b/packages/ti/fs/fatfs/example/console/src/fs_shell_app_utils.h
new file mode 100644 (file)
index 0000000..09df7d0
--- /dev/null
@@ -0,0 +1,211 @@
+/**
+ *  \file  app_utils_fs_shell.h
+ *
+ *  \brief This file provides structure, api, variable and macro required to
+ *         use user interface example utils.
+ *
+ *  \copyright Copyright (C) 2013-2018 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 APP_UTILS_FS_SHELL_H_
+#define APP_UTILS_FS_SHELL_H_
+
+/* ========================================================================== */
+/*                             Include Files                                  */
+/* ========================================================================== */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ========================================================================== */
+/*                           Macros & Typedefs                                */
+/* ========================================================================== */
+
+#define SOC_CACHELINE_SIZE                             (64U)
+
+/** \brief Maximum number of characters user can input. */
+#define UI_APP_UTILS_MAX_INPUT_SIZE                      (80U)
+
+/** \brief Help message to navigate to parent page or home page. */
+#define UI_APP_UTILS_PAGE_HELP       (" 0 - Home; (carriage return) - Back")
+
+/** \brief Defines maximum number of arguments that can be parsed in command line. */
+#define FSSHELLAPPUTILS_CMDLINE_MAX_ARGS               (8U)
+
+/** \brief Defines the value that is returned if the command is not found. */
+#define FSSHELLAPPUTILS_CMDLINE_BAD_CMD                (-1)
+
+/** \brief Defines the value that is returned if there are too many arguments. */
+#define FSSHELLAPPUTILS_CMDLINE_TOO_MANY_ARGS          (-2)
+
+#define FS_SHELL_APP_UTILS_CACHELINE_SIZE 32
+
+/* ========================================================================== */
+/*                         Structures and Enums                               */
+/* ========================================================================== */
+
+/**
+ *  \brief Enumerates execution status user interface.
+ */
+typedef enum fsShellAppUtilsStatus
+{
+    FS_SHELL_APP_UTILS_STATUS_MIN,
+    /**< Maximum configurations for type of page item. */
+    FS_SHELL_APP_UTILS_STATUS_COMPLETE = FS_SHELL_APP_UTILS_STATUS_MIN,
+    /**< Page entry is execute type. */
+    FS_SHELL_APP_UTILS_STATUS_INPROGRESS,
+    /**< Page entry is of navigation type. */
+    FS_SHELL_APP_UTILS_STATUS_ERROR,
+    /**< Page entry is of navigation type. */
+    FS_SHELL_APP_UTILS_STATUS_MAX = FS_SHELL_APP_UTILS_STATUS_ERROR
+    /**< Maximum configurations for type of page item. */
+} fsShellAppUtilsStatus_t;
+
+/**
+ *  \brief Structure defining application console interface.
+ *
+ *  These parameters are used to navigate, configure and execute the application
+ *  on console interface.
+ */
+typedef struct fsShellAppUtilsConsoleInterface
+{
+    uint32_t opMode;
+    /**< User interface operating mode. #fsShellAppUtilsConsoleMode_t. */
+    uint8_t* pRxConsoleBuf;
+    /**< Buffer to store the user input. */
+    uint32_t readStatus;
+    /**< Buffer to store the user input. */
+} fsShellAppUtilsConsoleInterface_t;
+
+/**
+ *  \brief Enumerates configurations for type of page item.
+ */
+typedef enum fsShellAppUtilsState
+{
+    FS_SHELL_APP_UTILS_STATE_HELP,
+    /**< Page entry is execute type. */
+    FS_SHELL_APP_UTILS_STATE_READ_COMMAND,
+    /**< Page entry is of configuration type. */
+    FS_SHELL_APP_UTILS_STATE_EXECUTE_COMMAND,
+    /**< Page entry is of configuration type. */
+    FS_SHELL_APP_UTILS_STATE_MAX
+    /**< Maximum configurations for type of page item. */
+} fsShellAppUtilsState_t;
+
+/**
+ *  \brief Enumerates configurations for type of page item.
+ */
+typedef enum fsShellAppUtilsCmdStatus
+{
+    FS_SHELL_APP_UTILS_CMD_STATUS_PASS,
+    /**< Page entry is execute type. */
+    FS_SHELL_APP_UTILS_CMD_STATUS_TOO_MANY_ARG,
+    /**< Page entry is of configuration type. */
+    FS_SHELL_APP_UTILS_CMD_STATUS_FAIL,
+    /**< Page entry is of configuration type. */
+    FS_SHELL_APP_UTILS_CMD_STATUS_INVALID
+    /**< Maximum configurations for type of page item. */
+} fsShellAppUtilsCmdStatus_t;
+
+/**
+ *  \brief Structure defining the commands supported for command line operation.
+ *
+ *  These parameters are used to decode and execute command line entry.
+ */
+typedef struct fsShellAppUtilsCmdEntry
+{
+    const char *pCmd;
+    /**< A pointer to a string containing the name of the command. */
+    int32_t (*pfnCmd) (int32_t argc, char *argv[]);
+    /**< A function pointer to the implementation of the command. */
+    const char *pHelp;
+    /**< A pointer to a string of brief help text for the command. */
+} fsShellAppUtilsCmdEntry_t;
+
+/* ========================================================================== */
+/*                            Global Variables Declarations                   */
+/* ========================================================================== */
+extern volatile uint8_t fs_is_media_inserted;
+
+/* ========================================================================== */
+/*                          Function Declarations                             */
+/* ========================================================================== */
+
+/**
+ *  \brief   This API configures mode of operation for user interface application utils.
+ *
+ *  \param   configType Index for Page to be displayed.
+ *           Following are possible values.
+ *           - FSSHELLAPPUTILSCONFIGTYPE_BLOCKING - Blocking type
+ *           - FSSHELLAPPUTILSCONFIGTYPE_NON_BLOCKING - Non blocking type
+ *
+ *  \return  S_PASS on success else error code.
+ *
+ **/
+int32_t FSShellAppUtilsInit(void);
+
+/**
+ *  \brief  Process a command line string into arguments and execute the command.
+ *          This function will take the supplied command line string and break it
+ *          up into individual arguments.  The first argument is treated as a
+ *          command and is searched for in the command table. If the command is
+ *          found, then the command function is called and all of the command line
+ *          arguments are passed in the normal argc, argv form.
+ *
+ *  \param  pCmdLine points to a string that contains a command line that was
+ *                  obtained by an application by some means.
+ *
+ *  \param  pCmdList points to a list of command entries used to process command
+ *                  line that was obtained by an application by some means.
+ *
+ *  \return Returns the status of execution of command line.
+ *          Following are possible values.
+ *          - FSSHELLAPPUTILS_CMDLINE_BAD_CMD if the command is not found,
+ *          - FSSHELLAPPUTILS_CMDLINE_TOO_MANY_ARGS if there are more arguments than can be parsed.
+ *          Otherwise it returns the code that was returned by the command function.
+ *
+ */
+#ifdef MULTI_PARTITION
+int32_t FSShellAppUtilsProcess(char *path);
+#else
+int32_t FSShellAppUtilsProcess(void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* #ifndef APP_UTILS_FS_SHELL_H_ */
diff --git a/packages/ti/fs/fatfs/example/console/src/main_console.c b/packages/ti/fs/fatfs/example/console/src/main_console.c
new file mode 100644 (file)
index 0000000..042463d
--- /dev/null
@@ -0,0 +1,440 @@
+/**
+ *  \file   main_console.c
+ *
+ *  \brief  Example application main file. This application demonstrates
+ *          the file operations on FAT formatted MMCSD device.
+ *
+ */
+
+/*
+ * Copyright (C) 2014-2018 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/runtime/System.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <ti/sysbios/knl/Task.h>
+
+/* BIOS Header files */
+#include <ti/sysbios/BIOS.h>
+#include <xdc/runtime/Error.h>
+
+/* TI-RTOS Header files */
+#include <ti/csl/cslr_device.h>
+#include "FATFS_log.h"
+#include <ti/fs/fatfs/diskio.h>
+#include <ti/fs/fatfs/FATFS.h>
+#include <ti/drv/mmcsd/MMCSD.h>
+#include <ti/fs/fatfs/example/console/src/fs_shell_app_utils.h>
+
+#include <ti/board/board.h>
+#ifndef SIMULATOR
+#include <ti/drv/gpio/GPIO.h>
+#include <ti/drv/gpio/soc/GPIO_soc.h>
+#endif
+
+/* GPIO is used to check the pin (SDCD) whether the SD Card is inserted
+ * or not. However in case of AM65XX there is no GPIO pin to check the
+ * SDCD. Hence this feature , i.e using GPIO to check the SD card insert
+ * is disabled. Same is the case with J7 and Simulator (J7). Here the demo
+ * assumes that the SD card is inserted */
+#if !(defined(SOC_AM65XX) || defined(SOC_J721E) || defined(SIMULATOR))
+#define FATFS_GPIO_ENABLED 1
+#endif
+
+#ifndef FATFS_GPIO_ENABLED
+#ifndef GPIO_PIN_MMC_SDCD_ACTIVE_STATE
+#define GPIO_PIN_MMC_SDCD_ACTIVE_STATE 1
+#endif
+#endif
+
+/**********************************************************************
+ ************************** Macros ************************************
+ **********************************************************************/
+#define MMCSD_INSTANCE_MMCSD            (0U)
+#ifdef CONSOLE_EMMC
+#define MMCSD_INSTANCE_EMMC             (1U)
+
+#define GPIO_PIN_VAL_LOW                (0U)
+#define GPIO_PIN_VAL_HIGH               (1U)
+#endif
+
+/**********************************************************************
+ ************************** Internal functions ************************
+ **********************************************************************/
+#ifdef MULTI_PARTITION
+#ifdef CONSOLE_EMMC
+static void EmmcsReset(void);
+static void delay(unsigned int delayValue);
+#endif
+
+static int16_t mainMenu();
+#endif
+/**********************************************************************
+ ************************** Global Variables **************************
+ **********************************************************************/
+
+#ifdef MULTI_PARTITION
+extern PARTITION VolToPart[];
+#endif
+
+/* ON Board LED pins which are connected to GPIO pins. */
+typedef enum GPIO_PIN {
+    GPIO_PIN_MMC_SDCD      = 0U,
+#ifdef CONSOLE_EMMC
+    GPIO_PIN_EMMC_RST,
+#endif
+    GPIO_PIN_COUNT
+}GPIO_PIN;
+
+#ifdef FATFS_GPIO_ENABLED
+/* GPIO Driver board specific pin configuration structure */
+GPIO_PinConfig gpioPinConfigs[] = {
+    /* Output pin : AM335X_ICE V2_LD_PIN */
+    GPIO_DEVICE_CONFIG(GPIO_MMC_SDCD_PORT_NUM, GPIO_MMC_SDCD_PIN_NUM) |
+    GPIO_CFG_IN_INT_BOTH_EDGES | GPIO_CFG_INPUT,
+#ifdef CONSOLE_EMMC
+    GPIO_DEVICE_CONFIG(GPIO_EMMC_RST_PORT_NUM, GPIO_EMMC_RST_PIN_NUM) | GPIO_CFG_OUTPUT,
+#endif
+};
+
+/* GPIO Driver call back functions */
+GPIO_CallbackFxn gpioCallbackFunctions[] = {
+    NULL,
+};
+
+#if (defined(SOC_AM65XX)||defined(SOC_J721E))
+GPIO_v0_Config GPIO_v0_config = {
+    gpioPinConfigs,
+    gpioCallbackFunctions,
+    sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
+    sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
+    0,
+};
+#else
+/* GPIO Driver configuration structure */
+GPIO_v1_Config GPIO_v1_config = {
+    gpioPinConfigs,
+    gpioCallbackFunctions,
+    sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
+    sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
+    0,
+};
+#endif
+#endif
+
+/* MMCSD function table for MMCSD implementation */
+FATFS_DrvFxnTable FATFS_drvFxnTable = {
+    MMCSD_close,
+    MMCSD_control,
+    MMCSD_init,
+    MMCSD_open,
+    MMCSD_write,
+    MMCSD_read
+};
+
+/* FATFS configuration structure */
+FATFS_HwAttrs FATFS_initCfg[_VOLUMES] =
+{
+#if defined (SOC_AM65XX) || defined (SOC_J721E)
+    {  /* MMC1 is SD card  for AM65xx GP EVM */
+        1U
+    },
+#else
+    {
+        0U
+    },
+#endif
+    {
+        1U
+    },
+    {
+        2U
+    },
+    {
+        3U
+    }
+};
+
+/* FATFS objects */
+FATFS_Object FATFS_objects[_VOLUMES];
+
+/* FATFS configuration structure */
+const FATFSConfigList FATFS_config = {
+    {
+        &FATFS_drvFxnTable,
+        &FATFS_objects[0],
+        &FATFS_initCfg[0]
+    },
+
+    {
+         &FATFS_drvFxnTable,
+         &FATFS_objects[1],
+         &FATFS_initCfg[1]
+    },
+
+    {
+         &FATFS_drvFxnTable,
+         &FATFS_objects[2],
+         &FATFS_initCfg[2]
+    },
+
+    {NULL, NULL, NULL},
+
+    {NULL, NULL, NULL}
+};
+
+FATFS_Handle fatfsHandle = NULL;
+
+#ifdef CONSOLE_EMMC
+FATFS_Handle eMMCFatfsHandle = NULL;
+#endif
+
+Uint32 fatfsShellProcessFlag = 0;
+Uint32 fs_media_needs_initialization=0;
+Uint32 fs_media_needs_close=0;
+
+#ifdef MULTI_PARTITION
+/* Main Menu Function */
+static int16_t mainMenu()
+{
+    int16_t i=0,drive_partition=5;
+    while(1)
+    {
+        for(i=0;(VolToPart[i].pd != FATFS_DFLT_VOLUME_PD) && i < FATFS_NUM_OF_PARTITIONS; i++)
+        {
+            FATFS_log("\n%x:/",i);
+        }
+
+        FATFS_log("\r\nSelect drive : ");
+        /* Get drive_partition */
+        UART_scanFmt("%d\n",&drive_partition);
+
+        if (drive_partition < 4)
+        {
+            return drive_partition;
+        }
+        else
+        {
+            FATFS_log("\r\nEnter Valid drive_partition\r\n");
+        }
+   }
+}
+#endif
+
+/* Callback function */
+void AppGpioCallbackFxn(void);
+
+/*
+ *  ======== test function ========
+ */
+void fatfs_console(UArg arg0, UArg arg1)
+{
+#ifdef MULTI_PARTITION
+    int16_t option = 0;
+    char drivePath[3];
+#endif
+
+#ifdef FATFS_GPIO_ENABLED
+    /* GPIO initialization */
+    GPIO_init();
+
+    /* Set the callback function */
+    GPIO_setCallback(GPIO_PIN_MMC_SDCD, AppGpioCallbackFxn);
+
+    /* Enable GPIO interrupt on the specific gpio pin */
+    GPIO_enableInt(GPIO_PIN_MMC_SDCD);
+#endif
+
+#ifdef CONSOLE_EMMC
+    EmmcsReset();
+#endif
+
+    /* MMCSD FATFS initialization */
+    FATFS_init();
+
+#if !defined(FATFS_GPIO_ENABLED)
+    FATFS_log ("\nPlease ensure SD card is inserted before running this demo\r\n");
+    fs_is_media_inserted = 1;
+    if(1)
+#else
+    if (GPIO_PIN_MMC_SDCD_ACTIVE_STATE == GPIO_read(GPIO_PIN_MMC_SDCD))
+#endif
+    {
+        FATFS_open(MMCSD_INSTANCE_MMCSD, NULL, &fatfsHandle);
+        fatfsShellProcessFlag = 1;
+        fs_is_media_inserted = 1;
+
+    }
+    else
+    {
+        FATFS_log ("\nPlease insert card.\r\n");
+        fs_is_media_inserted = 0;
+    }
+
+#ifdef CONSOLE_EMMC
+    if(FATFS_OK != FATFS_open(MMCSD_INSTANCE_EMMC, NULL, &eMMCFatfsHandle))
+    {
+        FATFS_log("\n eMMC Fails to open \n");
+    }
+#endif
+    while(1)
+    {
+        /* Check for any media state changes and initialize/close FATFS accordingly.
+         * Please note that this is checked*/
+
+        if(fs_media_needs_initialization) {
+
+            FATFS_log("\nMedia Inserted..Initializing..\n");
+            FATFS_open(MMCSD_INSTANCE_MMCSD, NULL, &fatfsHandle);
+            fatfsShellProcessFlag = 1;
+            fs_media_needs_initialization=0;
+        }
+
+        if(fs_media_needs_close) {
+            FATFS_close(fatfsHandle);
+            fatfsShellProcessFlag = 0;
+            fs_media_needs_close=0;
+            FATFS_log("\nMedia Removed..Please insert media..\n");
+        }
+
+        if (0 != fatfsShellProcessFlag)
+        {
+#ifdef MULTI_PARTITION
+            option = mainMenu();
+            snprintf(drivePath, 3, "%d:", option);
+            FSShellAppUtilsProcess(drivePath);
+#else
+            FSShellAppUtilsProcess();
+            fatfsShellProcessFlag = 0;
+#endif
+
+        }
+    }
+}
+
+
+#ifndef BARE_METAL
+#if (defined(SOC_AM65XX) || defined(SOC_J721E)) && (defined(BUILD_MPU) || defined (__C7100__))
+extern void Osal_initMmuDefault(void);
+void InitMmu(void)
+{
+    Osal_initMmuDefault();
+}
+#endif
+#endif
+
+
+/*
+ *  ======== main ========
+ */
+int main(void)
+{
+       Task_Handle task;
+       Error_Block eb;
+    /* Call board init functions */
+    Board_initCfg boardCfg;
+    boardCfg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_UART_STDIO | BOARD_INIT_MODULE_CLOCK;
+
+#if (defined(SOC_AM65XX)||defined(SOC_J721E)) &&  defined(__TI_ARM_V7R4__)
+    /* Clear it until the issue is resolved */
+    boardCfg &= ~(BOARD_INIT_MODULE_CLOCK);
+#endif
+
+    Board_init(boardCfg);
+
+    Error_init(&eb);
+    task = Task_create(fatfs_console, NULL, &eb);
+    if (task == NULL) {
+        System_printf("Task_create() failed!\n");
+        BIOS_exit(0);
+    }
+
+    /* Start BIOS */
+    BIOS_start();
+
+    return (0);
+}
+
+
+void media_open()
+{
+    FATFS_open(MMCSD_INSTANCE_MMCSD, NULL, &fatfsHandle);
+    fatfsShellProcessFlag = 1;
+}
+void media_close()
+{
+    FATFS_close(fatfsHandle);
+    fatfsShellProcessFlag = 0;
+}
+
+#ifdef FATFS_GPIO_ENABLED
+/*
+ *  ======== Callback function ========
+ */
+void AppGpioCallbackFxn(void)
+{
+    if (GPIO_PIN_MMC_SDCD_ACTIVE_STATE == GPIO_read(GPIO_PIN_MMC_SDCD))
+    {
+        fs_is_media_inserted=1; /* The media has been inserted now */
+        fs_media_needs_initialization=1; /* Need to initialize FATFS with the media */
+    }
+    else
+    {
+        fs_is_media_inserted=0;/*  The media has been ejected now */
+        fs_media_needs_close=1; /* Need to close FATFS with the media */
+    }
+}
+#endif
+
+#ifdef CONSOLE_EMMC
+static void EmmcsReset(void)
+{
+    /* EMMC reset */
+    GPIO_write(GPIO_PIN_EMMC_RST, GPIO_PIN_VAL_LOW);
+    delay(100);
+    GPIO_write(GPIO_PIN_EMMC_RST, GPIO_PIN_VAL_HIGH);
+    delay(100);
+}
+
+/*
+ *  ======== Delay function ========
+ */
+static void delay(unsigned int delayValue)
+{
+    volatile uint32_t delay1 = delayValue*10000;
+    while (delay1--) ;
+}
+#endif
diff --git a/packages/ti/fs/fatfs/fatfs_component.mk b/packages/ti/fs/fatfs/fatfs_component.mk
new file mode 100644 (file)
index 0000000..9d4915a
--- /dev/null
@@ -0,0 +1,201 @@
+#
+# Copyright (c) 2016 - 2019, 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: fatfs_component.mk
+#       This file is component include make file of FATFS 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
+#                             board and the compiled obj/lib has to be kept
+#                             under <board> directory
+#                             "no" or "" or if this variable is not defined: means
+#                             this module has no board dependent code and hence
+#                             the obj/libs are not kept under <board> 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 ($(fatfs_component_make_include), )
+
+# under other list
+drvfatfs_BOARDLIST       = am65xx_evm am65xx_idk j721e_sim j721e_evm
+drvfatfs_SOCLIST           = am574x am572x am571x am437x am335x dra72x dra75x dra78x k2g omapl137 omapl138 am65xx j721e
+drvfatfs_am574x_CORELIST   = c66x a15_0 ipu1_0
+drvfatfs_am572x_CORELIST   = c66x a15_0 ipu1_0
+drvfatfs_am571x_CORELIST   = c66x a15_0 ipu1_0
+drvfatfs_dra72x_CORELIST   = c66x a15_0 ipu1_0
+drvfatfs_dra75x_CORELIST   = c66x a15_0 ipu1_0
+drvfatfs_dra78x_CORELIST   = c66x ipu1_0
+drvfatfs_am437x_CORELIST   = a9host
+drvfatfs_am335x_CORELIST   = a8host
+drvfatfs_k2g_CORELIST      = c66x a15_0
+drvfatfs_omapl137_CORELIST = arm9_0 c674x
+drvfatfs_omapl138_CORELIST = arm9_0 c674x
+drvfatfs_am65xx_CORELIST   = mpu1_0 mcu1_0
+drvfatfs_j721e_CORELIST   = $(DEFAULT_j721e_CORELIST)
+############################
+# uart package
+# List of components included under uart lib
+# The components included here are built and will be part of uart lib
+############################
+fatfs_LIB_LIST = fatfs_indp fatfs_multi_indp fatfs_profile_indp
+drvfatfs_LIB_LIST = $(fatfs_LIB_LIST)
+fatfs_EXAMPLE_LIST = 
+
+#
+# FATFS Modules
+#
+
+# FATFS LIB DEVICE INDEPENDENT
+fatfs_indp_COMP_LIST = fatfs_indp
+fatfs_indp_RELPATH = ti/fs/fatfs
+fatfs_indp_PATH = $(PDK_FATFS_COMP_PATH)
+fatfs_indp_LIBNAME = ti.fs.fatfs
+export fatfs_indp_LIBNAME
+fatfs_indp_LIBPATH = $(fatfs_indp_PATH)/lib
+export fatfs_indp_LIBPATH
+fatfs_indp_OBJPATH = $(fatfs_indp_RELPATH)/fatfs_indp
+export fatfs_indp_OBJPATH
+fatfs_indp_MAKEFILE = -f build/makefile_indp.mk
+export fatfs_indp_MAKEFILE
+fatfs_indp_BOARD_DEPENDENCY = no
+fatfs_indp_CORE_DEPENDENCY = no
+fatfs_indp_SOC_DEPENDENCY = no
+export fatfs_indp_COMP_LIST
+export fatfs_indp_BOARD_DEPENDENCY
+export fatfs_indp_CORE_DEPENDENCY
+export fatfs_indp_SOC_DEPENDENCY
+fatfs_indp_PKG_LIST = fatfs_indp
+export fatfs_indp_PKG_LIST
+fatfs_indp_INCLUDE = $(fatfs_indp_PATH)
+fatfs_indp_SOCLIST = $(drvfatfs_SOCLIST)
+export fatfs_indp_SOCLIST
+fatfs_indp_$(SOC)_CORELIST = $(drvfatfs_$(SOC)_CORELIST)
+export fatfs_indp_$(SOC)_CORELIST
+
+# FATFS PROFILING SOC INDEPENDENT LIB
+fatfs_profile_indp_COMP_LIST = fatfs_profile_indp
+fatfs_profile_indp_RELPATH = ti/fs/fatfs
+fatfs_profile_indp_PATH = $(PDK_FATFS_COMP_PATH)
+fatfs_profile_indp_LIBNAME = ti.fs.fatfs.profiling
+export fatfs_profile_indp_LIBNAME
+fatfs_profile_indp_LIBPATH = $(fatfs_profile_indp_PATH)/lib
+export fatfs_profile_indp_LIBPATH
+fatfs_profile_indp_OBJPATH = $(fatfs_profile_indp_RELPATH)/fatfs_profile_indp
+export fatfs_profile_indp_OBJPATH
+fatfs_profile_indp_MAKEFILE = -f build/makefile_profile_indp.mk
+export fatfs_profile_indp_MAKEFILE
+fatfs_profile_indp_BOARD_DEPENDENCY = no
+fatfs_profile_indp_CORE_DEPENDENCY = no
+fatfs_profile_indp_SOC_DEPENDENCY = no
+export fatfs_profile_indp_COMP_LIST
+export fatfs_profile_indp_BOARD_DEPENDENCY
+export fatfs_profile_indp_CORE_DEPENDENCY
+export fatfs_profile_indp_SOC_DEPENDENCY
+fatfs_profile_indp_PKG_LIST = fatfs_profile_indp
+export fatfs_profile_indp_PKG_LIST
+fatfs_profile_indp_INCLUDE = $(fatfs_profile_indp_PATH)
+fatfs_profile_indp_SOCLIST = am574x am572x am571x am437x am335x dra72x dra75x dra78x k2g omapl137 omapl138
+export fatfs_profile_indp_SOCLIST
+fatfs_profile_indp_$(SOC)_CORELIST = $(drvfatfs_$(SOC)_CORELIST)
+export fatfs_profile_indp_$(SOC)_CORELIST
+
+# EMMC Readwrite test
+FATFS_Console_TestApp_COMP_LIST = FATFS_Console_TestApp
+FATFS_Console_TestApp_RELPATH = ti/fs/fatfs/example/console
+FATFS_Console_TestApp_PATH = $(PDK_FATFS_COMP_PATH)/example/console
+FATFS_Console_TestApp_BOARD_DEPENDENCY = yes
+FATFS_Console_TestApp_CORE_DEPENDENCY = no
+FATFS_Console_TestApp_XDC_CONFIGURO = yes
+export FATFS_Console_TestApp_COMP_LIST
+export FATFS_Console_TestApp_BOARD_DEPENDENCY
+export FATFS_Console_TestApp_CORE_DEPENDENCY
+export FATFS_Console_TestApp_XDC_CONFIGURO
+FATFS_Console_TestApp_PKG_LIST = FATFS_Console_TestApp
+FATFS_Console_TestApp_INCLUDE = $(FATFS_Console_TestApp_PATH)
+FATFS_Console_TestApp_BOARDLIST = $(drvfatfs_BOARDLIST)
+export FATFS_Console_TestApp_BOARDLIST
+FATFS_Console_TestApp_$(SOC)_CORELIST = $(drvfatfs_$(SOC)_CORELIST)
+export FATFS_Console_TestApp_$(SOC)_CORELIST
+
+fatfs_EXAMPLE_LIST += FATFS_Console_TestApp
+
+# EMMC Readwrite test with SMP enabled
+FATFS_Console_SMP_TestApp_COMP_LIST = FATFS_Console_SMP_TestApp
+FATFS_Console_SMP_TestApp_RELPATH = ti/fs/fatfs/example/console
+FATFS_Console_SMP_TestApp_PATH = $(PDK_FATFS_COMP_PATH)/example/console
+FATFS_Console_SMP_TestApp_MAKEFILE = -f makefile SMP=enable
+FATFS_Console_SMP_TestApp_BOARD_DEPENDENCY = yes
+FATFS_Console_SMP_TestApp_CORE_DEPENDENCY = no
+FATFS_Console_SMP_TestApp_XDC_CONFIGURO = yes
+export FATFS_Console_SMP_TestApp_COMP_LIST
+export FATFS_Console_SMP_TestApp_BOARD_DEPENDENCY
+export FATFS_Console_SMP_TestApp_CORE_DEPENDENCY
+export FATFS_Console_SMP_TestApp_XDC_CONFIGURO
+FATFS_Console_SMP_TestApp_PKG_LIST = FATFS_Console_SMP_TestApp
+FATFS_Console_SMP_TestApp_INCLUDE = $(FATFS_Console_SMP_TestApp_PATH)
+FATFS_Console_SMP_TestApp_BOARDLIST = am65xx_idk
+export FATFS_Console_SMP_TestApp_BOARDLIST
+FATFS_Console_SMP_TestApp_$(SOC)_CORELIST = mpu1_0
+export FATFS_Console_SMP_TestApp_$(SOC)_CORELIST
+
+fatfs_EXAMPLE_LIST += FATFS_Console_SMP_TestApp
+
+export drvfatfs_LIB_LIST
+export fatfs_LIB_LIST
+export fatfs_EXAMPLE_LIST
+
+drvfatfs_EXAMPLE_LIST = $(fatfs_EXAMPLE_LIST)
+export drvfatfs_EXAMPLE_LIST
+
+fatfs_component_make_include := 1
+endif
diff --git a/packages/ti/fs/fatfs/ff.h b/packages/ti/fs/fatfs/ff.h
new file mode 100644 (file)
index 0000000..5fbb379
--- /dev/null
@@ -0,0 +1,386 @@
+/*---------------------------------------------------------------------------/\r
+/  FatFs - FAT file system module include R0.12     (C)ChaN, 2016\r
+/----------------------------------------------------------------------------/\r
+/ FatFs module is a free software that opened under license policy of\r
+/ following conditions.\r
+/\r
+/ Copyright (C) 2016, ChaN, all right reserved.\r
+/\r
+/ 1. Redistributions of source code must retain the above copyright notice,\r
+/    this condition and the following disclaimer.\r
+/\r
+/ This software is provided by the copyright holder and contributors "AS IS"\r
+/ and any warranties related to this software are DISCLAIMED.\r
+/ The copyright owner or contributors be NOT LIABLE for any damages caused\r
+/ by use of this software.\r
+/---------------------------------------------------------------------------*/\r
+\r
+\r
+#ifndef _FATFS\r
+#define _FATFS 88100   /* Revision ID */\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include "integer.h"   /* Basic integer types */\r
+#include "ffconf.h"            /* FatFs configuration options */\r
+#if _FATFS != _FFCONF\r
+#error Wrong configuration file (ffconf.h).\r
+#endif\r
+\r
+\r
+\r
+/* Definitions of volume management */\r
+\r
+#if _MULTI_PARTITION           /* Multiple partition configuration */\r
+typedef struct {\r
+       BYTE pd;        /* Physical drive number */\r
+       BYTE pt;        /* Partition: 0:Auto detect, 1-4:Forced partition) */\r
+} PARTITION;\r
+extern PARTITION VolToPart[];  /* Volume - Partition resolution table */\r
+#define LD2PD(vol) (VolToPart[vol].pd) /* Get physical drive number */\r
+#define LD2PT(vol) (VolToPart[vol].pt) /* Get partition index */\r
+\r
+#else                                                  /* Single partition configuration */\r
+#define LD2PD(vol) (BYTE)(vol) /* Each logical drive is bound to the same physical drive number */\r
+#define LD2PT(vol) 0                   /* Find first valid partition or in SFD */\r
+\r
+#endif\r
+\r
+\r
+\r
+/* Type of path name strings on FatFs API */\r
+\r
+#if _LFN_UNICODE                       /* Unicode string */\r
+#if _USE_LFN == 0\r
+#error _LFN_UNICODE must be 0 at non-LFN cfg.\r
+#endif\r
+#ifndef _INC_TCHAR\r
+typedef WCHAR TCHAR;\r
+#define _T(x) L ## x\r
+#define _TEXT(x) L ## x\r
+#endif\r
+\r
+#else                                          /* ANSI/OEM string */\r
+#ifndef _INC_TCHAR\r
+typedef char TCHAR;\r
+#define _T(x) x\r
+#define _TEXT(x) x\r
+#endif\r
+\r
+#endif\r
+\r
+\r
+\r
+/* File system object structure (FATFS) */\r
+\r
+typedef struct {\r
+       BYTE    fs_type;                /* File system type (0:N/A) */\r
+       BYTE    drv;                    /* Physical drive number */\r
+       BYTE    n_fats;                 /* Number of FATs (1 or 2) */\r
+       BYTE    wflag;                  /* win[] flag (b0:dirty) */\r
+       BYTE    fsi_flag;               /* FSINFO flags (b7:disabled, b0:dirty) */\r
+       WORD    id;                             /* File system mount ID */\r
+       WORD    n_rootdir;              /* Number of root directory entries (FAT12/16) */\r
+       WORD    csize;                  /* Cluster size [sectors] */\r
+#if _MAX_SS != _MIN_SS\r
+       WORD    ssize;                  /* Sector size (512, 1024, 2048 or 4096) */\r
+#endif\r
+#if _FS_EXFAT\r
+       BYTE*   dirbuf;                 /* Directory entry block scratchpad buffer */\r
+#endif\r
+#if _FS_REENTRANT\r
+       _SYNC_t sobj;                   /* Identifier of sync object */\r
+#endif\r
+#if !_FS_READONLY\r
+       DWORD   last_clst;              /* Last allocated cluster */\r
+       DWORD   free_clst;              /* Number of free clusters */\r
+#endif\r
+#if _FS_RPATH != 0\r
+       DWORD   cdir;                   /* Current directory start cluster (0:root) */\r
+#if _FS_EXFAT\r
+       DWORD   cdc_scl;                /* Containing directory start cluster (invalid when cdir is 0) */\r
+       DWORD   cdc_size;               /* b31-b8:Size of containing directory, b7-b0: Chain status */\r
+       DWORD   cdc_ofs;                /* Offset in the containing directory (invalid when cdir is 0) */\r
+#endif\r
+#endif\r
+       DWORD   n_fatent;               /* Number of FAT entries (number of clusters + 2) */\r
+       DWORD   fsize;                  /* Size of an FAT [sectors] */\r
+       DWORD   volbase;                /* Volume base sector */\r
+       DWORD   fatbase;                /* FAT base sector */\r
+       DWORD   dirbase;                /* Root directory base sector/cluster */\r
+       DWORD   database;               /* Data base sector */\r
+       DWORD   winsect;                /* Current sector appearing in the win[] */\r
+\r
+#if defined(__GNUC__) || defined(gcc) || \\r
+    defined(__aarch64__) || defined (__TI_ARM_V7R4__) || defined(__ARM_ARCH_7A__) || defined (__TI_ARM_V7M4__) || defined (__TI_ARM_V5__)\r
+    BYTE    win[_MAX_SS] __attribute__ ((aligned (128U)));  /* Disk access window for Directory, \r
+                                                            FAT (and file data at tiny cfg) */\r
+#else\r
+    BYTE    win[_MAX_SS];  /* Disk access window for Directory,\r
+                              FAT (and file data at tiny cfg) */\r
+#if !(defined(_TMS320C6X) || defined(__C7100__))\r
+    #warning this win buffer needs to be cache-line aligned\r
+#endif\r
+\r
+#endif\r
+\r
+} FATFS;\r
+\r
+\r
+\r
+/* Type of file size variables and object identifier */\r
+\r
+#if _FS_EXFAT\r
+#if _USE_LFN == 0\r
+#error LFN must be enabled when enable exFAT\r
+#endif\r
+typedef QWORD FSIZE_t;\r
+#else\r
+typedef DWORD FSIZE_t;\r
+#endif\r
+\r
+\r
+\r
+/* Object ID and allocation information (_FDID) */\r
+\r
+typedef struct {\r
+       FATFS*  fs;                     /* Pointer to the owner file system object */\r
+       WORD    id;                     /* Owner file system mount ID */\r
+       BYTE    attr;           /* Object attribute */\r
+       BYTE    stat;           /* Objec