Merge remote-tracking branch 'origin/dev_pasdk_govind_pasdk53IpDataDebug' into dev_pa...
authorFrank Livingston <frank-livingston@ti.com>
Fri, 17 Feb 2017 23:48:46 +0000 (17:48 -0600)
committerFrank Livingston <frank-livingston@ti.com>
Fri, 17 Feb 2017 23:48:46 +0000 (17:48 -0600)
pasdk/common/evmc66x_gpio_dbg.c [new file with mode: 0644]
pasdk/common/evmc66x_gpio_dbg.h [new file with mode: 0644]
pasdk/test_arm/.cproject
pasdk/test_dsp/application/itopo/evmk2g/atboot.c
pasdk/test_dsp/framework/audioStreamInpProc.c
pasdk/test_dsp/framework/itopo/params.c
pasdk/test_dsp/sap/audio_dc_cfg.c
pasdk/test_dsp/sap/sap.c
pasdk/test_dsp/sap/sap_d10.c

diff --git a/pasdk/common/evmc66x_gpio_dbg.c b/pasdk/common/evmc66x_gpio_dbg.c
new file mode 100644 (file)
index 0000000..cab90dc
--- /dev/null
@@ -0,0 +1,505 @@
+/*
+ * Copyright (c) 2010-2015, 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   evmc66x_gpio.c
+ *
+ * \brief  This file contains the lower level functions to access GPIO
+ *
+ *****************************************************************************/
+
+/************************
+ * Include Files
+ ************************/
+
+#include "evmc66x_gpio_dbg.h"
+//#include "platform_internal.h"
+
+//#if (PLATFORM_GPIO_IN)
+
+/**
+ * \brief  This function performs different control operations on GPIO
+ *
+ * \param   gpioPortNumber [IN]     GPIO port number
+ * \param   pinNum         [IN]     GPIO pin number
+ * \param   ctrlCmd        [IN]     Command to indicate action to perform
+ * \n                               Use below macros as input for 'ctrlCmd'
+ * \n        GPIO_CTRL_SET_DIR       - Command to set GPIO pin direction
+ * \n        GPIO_CTRL_SET_OUTPUT    - Command to set GPIO pin output
+ * \n        GPIO_CTRL_CLEAR_OUTPUT  - Command to clear GPIO pin output
+ * \n        GPIO_CTRL_READ_INPUT    - Command to read GPIO pin input
+ * \n        GPIO_CTRL_SET_RE_INTR   - Command to set rising edge interrupt
+ * \n        GPIO_CTRL_CLEAR_RE_INTR - Command to clear rising edge interrupt
+ * \n        GPIO_CTRL_SET_FE_INTR   - Command to set falling edge interrupt
+ * \n        GPIO_CTRL_CLEAR_FE_INTR - Command to clear falling edge interrupt
+ *
+ * \param   ctrlData       [IN/OUT] Data to be manipulated by the command
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+static GPIO_RET GPIO_ctrl(uint8_t gpioPortNumber, uint8_t pinNum,
+                          uint8_t ctrlCmd, void *ctrlData)
+{
+       GPIO_RET       retVal;
+    uint8_t        bankIndex;
+    uint8_t        bitPos;
+    CSL_GpioHandle hGpio;
+    GpioDirection  direction;
+
+    retVal = GPIO_RET_OK;
+
+    if(pinNum < GPIO_MAX_NUMBER)
+    {
+               hGpio = GPIOGetRegBaseAddr(gpioPortNumber);
+               if(hGpio != NULL)
+               {
+                       bankIndex = pinNum / GPIO_PINS_PER_BANK;
+                       bitPos    = pinNum % GPIO_PINS_PER_BANK;
+
+                       switch(ctrlCmd)
+                       {
+                               /* Command to set GPIO pin direction */
+                case GPIO_CTRL_SET_DIR:
+                        direction = *((GpioDirection*)ctrlData);
+                                        if     (direction == GPIO_IN)
+                                        {
+                                               hGpio->BANK_REGISTERS[bankIndex].DIR |= 1 << bitPos;
+                                        }
+                                        else
+                                        {
+                                               hGpio->BANK_REGISTERS[bankIndex].DIR &= ~(1 << bitPos);
+                                        }
+                        break;
+
+                               /* Command to set GPIO pin output */
+                case GPIO_CTRL_SET_OUTPUT:
+                        hGpio->BANK_REGISTERS[bankIndex].SET_DATA = 1 << bitPos;
+                        break;
+
+                               /* Command to clear GPIO pin output */
+                case GPIO_CTRL_CLEAR_OUTPUT:
+                        hGpio->BANK_REGISTERS[bankIndex].CLR_DATA = 1 << bitPos;
+                        break;
+
+                               /* Command to read GPIO pin input */
+                case GPIO_CTRL_READ_INPUT:
+                        *(uint8_t*)ctrlData =
+                              CSL_FEXTR (hGpio->BANK_REGISTERS[bankIndex].IN_DATA,
+                                         bitPos, bitPos);
+                        break;
+
+                               /* Command to set rising edge interrupt */
+                case GPIO_CTRL_SET_RE_INTR:
+                        CSL_FINSR (hGpio->BANK_REGISTERS[bankIndex].SET_RIS_TRIG,
+                                   bitPos, bitPos, 1);
+                        break;
+
+                               /* Command to clear rising edge interrupt */
+                case GPIO_CTRL_CLEAR_RE_INTR:
+                        hGpio->BANK_REGISTERS[bankIndex].CLR_RIS_TRIG |= 1 << pinNum;
+                        break;
+
+                               /* Command to set falling edge interrupt */
+                case GPIO_CTRL_SET_FE_INTR:
+                        CSL_FINSR (hGpio->BANK_REGISTERS[bankIndex].SET_FAL_TRIG,
+                                   bitPos, bitPos, 1);
+                        break;
+
+                               /* Command to clear falling edge interrupt */
+                case GPIO_CTRL_CLEAR_FE_INTR:
+                        hGpio->BANK_REGISTERS[bankIndex].CLR_FAL_TRIG |=  1 << pinNum;
+                        break;
+
+                default:
+                        retVal = GPIO_RET_FAIL;
+                        break;
+                       }
+               }
+               else
+               {
+                       retVal = INVALID_GPIO_PORT;
+               }
+       }
+       else
+       {
+               retVal = INVALID_GPIO_NUMBER;
+       }
+
+       return (retVal);
+
+} //gpio_ctrl
+
+/**
+ * \brief  Returns base address of given GPIO port number.
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ *
+ * \return CSL_GpioHandle\n
+ *
+ */
+CSL_GpioHandle GPIOGetRegBaseAddr(uint8_t gpioPortNumber)
+{
+       CSL_GpioHandle addr;
+
+       switch(gpioPortNumber)
+       {
+               case GPIO_PORT_0:
+                       addr = (CSL_GpioHandle)CSL_GPIO_0_REGS;
+                       break;
+
+               case GPIO_PORT_1:
+                       addr = (CSL_GpioHandle)CSL_GPIO_1_REGS;
+                       break;
+
+               default :
+                       addr = NULL;
+                       break;
+       }
+
+       return (addr);
+
+}  //gpioGetRegBaseAddr
+
+/**
+ * \brief  Initializes the GPIO peripheral
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ *
+ */
+GPIO_RET GPIOInit(uint8_t gpioPortNumber)
+{
+       GPIO_RET    retVal;
+    uint8_t     bankNum;
+    uint8_t     pinNum;
+
+       retVal = GPIO_RET_OK;
+
+    if (gpioPortNumber <= GPIO_PORT_1)
+    {
+               /* Disable the GPIO global interrupts */
+               /*for (bankNum = 0; bankNum < GPIO_MAX_BANKS; bankNum++)
+               {
+                       gpioDisableGlobalInterrupt(gpioPortNumber, bankNum);
+               }*/
+
+           /* Clear all falling edge trigger and rising edge trigger */
+          /* for (pinNum = 0; pinNum < GPIO_MAX_NUMBER; pinNum++)
+           {
+            gpioClearFallingEdgeInterrupt(gpioPortNumber, pinNum);
+            gpioClearRisingEdgeInterrupt(gpioPortNumber, pinNum);
+        }*/
+       }
+       else
+       {
+               retVal = INVALID_GPIO_PORT;
+       }
+
+       return (retVal);
+
+} //gpioInit
+
+/**
+ * \brief  This function configures the specified GPIO's direction
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ * \param   direction      [IN]    GPIO pin direction
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+GPIO_RET GPIOSetDirection(uint8_t gpioPortNumber, uint8_t pinNum,
+                          GpioDirection direction)
+{
+       GPIO_RET    retVal;
+
+    retVal = GPIO_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_SET_DIR, &direction);
+
+       return (retVal);
+
+} //gpioSetDirection
+
+/**
+ * \brief  This function sets the specified GPIO's pin state to 1
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+GPIO_RET GPIOSetOutput(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+       GPIO_RET retVal;
+
+    retVal = GPIO_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_SET_OUTPUT, NULL);
+
+       return (retVal);
+
+} //gpioSetOutput
+
+/**
+ * \brief  This function Clears the specified GPIO's pin state to 0
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+GPIO_RET GPIOClearOutput(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+       GPIO_RET retVal;
+
+    retVal = GPIO_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_CLEAR_OUTPUT, NULL);
+
+       return (retVal);
+
+} //gpioClearOutput
+
+/**
+ * \brief  This function gets the specified GPIO's pin state
+ *
+ * The specified GPIO should be configured as input
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      uint32_t - Input state of GPIO if success
+ * \n                          - else GPIO status
+ */
+uint32_t GPIOReadInput(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+    uint8_t  inData = 0;
+    uint32_t retVal;
+
+    retVal = GPIO_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_READ_INPUT, &inData);
+       if(GPIO_RET_OK == retVal)
+       {
+               if( ( inData & GPIO_HIGH ) == GPIO_HIGH )
+               {
+                       retVal = GPIO_HIGH;
+               }
+               else
+               {
+                       retVal = GPIO_LOW;
+               }
+       }
+
+       return(retVal);
+
+} //gpioReadInput
+
+/**
+ * \brief  This function Enables GPIO interrupts to CPU
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   bankNum        [IN]    GPIO bank number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO bank number
+ */
+/*GPIO_RET gpioEnableGlobalInterrupt(uint8_t gpioPortNumber, uint8_t bankNum)
+{
+       GPIO_RET       retVal;
+       CSL_GpioHandle hGpio;
+
+       retVal = GPIO_RET_OK;
+
+       if(bankNum <= GPIO_MAX_BANKS)
+       {
+               hGpio = gpioGetRegBaseAddr(gpioPortNumber);
+               if(hGpio != NULL)
+               {
+                       CSL_GPIO_bankInterruptEnable(hGpio, bankNum);
+               }
+               else
+               {
+                       retVal = INVALID_GPIO_PORT;
+               }
+       }
+       else
+       {
+               retVal = INVALID_GPIO_NUMBER;
+       }
+
+       return (retVal);
+
+} *///gpioEnableGlobalInterrupt
+
+/**
+ * \brief  This function Disables GPIO interrupts to CPU
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   bankNum        [IN]    GPIO bank number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO bank number
+ */
+/*GPIO_RET gpioDisableGlobalInterrupt(uint8_t gpioPortNumber, uint8_t bankNum)
+{
+       GPIO_RET       retVal;
+       CSL_GpioHandle hGpio;
+
+       retVal = GPIO_RET_OK;
+
+       if(bankNum <= GPIO_MAX_BANKS)
+       {
+               hGpio = gpioGetRegBaseAddr(gpioPortNumber);
+               if(hGpio != NULL)
+               {
+                       CSL_GPIO_bankInterruptDisable(hGpio, bankNum);
+               }
+               else
+               {
+                       retVal = INVALID_GPIO_PORT;
+               }
+       }
+       else
+       {
+               retVal = INVALID_GPIO_NUMBER;
+       }
+
+       return (retVal);
+
+} *///gpioDisableGlobalInterrupt
+
+/**
+ * \brief  This function sets specified GPIO's rising edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+/*GPIO_RET gpioSetRisingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+       GPIO_RET retVal;
+
+    retVal = gpio_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_SET_RE_INTR, NULL);
+
+       return (retVal);
+
+} *///gpioSetRisingEdgeInterrupt
+
+/**
+ * \brief  This function clears specified GPIO's rising edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+/*GPIO_RET gpioClearRisingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+       GPIO_RET retVal;
+
+    retVal = gpio_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_CLEAR_RE_INTR, NULL);
+
+       return (retVal);
+
+} *///gpioClearRisingEdgeInterrupt
+
+/**
+ * \brief  This function sets specified GPIO's falling edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+/*GPIO_RET gpioSetFallingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+       GPIO_RET retVal;
+
+    retVal = gpio_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_SET_FE_INTR, NULL);
+
+       return (retVal);
+
+}*/ //gpioSetFallingEdgeInterrupt
+
+/**
+ * \brief  This function clears specified GPIO's falling edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+/*GPIO_RET gpioClearFallingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum)
+{
+       GPIO_RET retVal;
+
+    retVal = gpio_ctrl(gpioPortNumber, pinNum, GPIO_CTRL_CLEAR_FE_INTR, NULL);
+
+       return (retVal);
+}*/
+
+//#endif /* #if PLATFORM_GPIO_IN */
+
+/* Nothing past this point */
diff --git a/pasdk/common/evmc66x_gpio_dbg.h b/pasdk/common/evmc66x_gpio_dbg.h
new file mode 100644 (file)
index 0000000..0a0fab0
--- /dev/null
@@ -0,0 +1,566 @@
+/*
+ * Copyright (c) 2011-2015, 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       evmc66x_gpio.h
+ *
+ * \brief      This file is the header file for GPIO module
+ *
+ ******************************************************************************/
+
+#ifndef        _EVMC66X_GPIO_DBG_H_
+#define        _EVMC66X_GPIO_DBG_H_
+
+
+#include <ti\csl\csl_gpio.h>
+#include <ti\csl\soc\k2g\src\cslr_soc_baseaddress.h>
+/************************
+ * Defines and Macros
+ ************************/
+
+/** GPIO port 0 */
+#define GPIO_PORT_0                               (CSL_GPIO_0)
+/** GPIO port 1 */
+#define GPIO_PORT_1                           (CSL_GPIO_1)
+
+/** GPIO pin number 0 */
+#define GPIO_PIN_0    (0)
+/** GPIO pin number 1 */
+#define GPIO_PIN_1    (1)
+/** GPIO pin number 2 */
+#define GPIO_PIN_2    (2)
+/** GPIO pin number 3 */
+#define GPIO_PIN_3    (3)
+/** GPIO pin number 4 */
+#define GPIO_PIN_4    (4)
+/** GPIO pin number 5 */
+#define GPIO_PIN_5    (5)
+/** GPIO pin number 6 */
+#define GPIO_PIN_6    (6)
+/** GPIO pin number 7 */
+#define GPIO_PIN_7    (7)
+/** GPIO pin number 8 */
+#define GPIO_PIN_8    (8)
+/** GPIO pin number 9 */
+#define GPIO_PIN_9    (9)
+/** GPIO pin number 10 */
+#define GPIO_PIN_10    (10)
+/** GPIO pin number 11 */
+#define GPIO_PIN_11    (11)
+/** GPIO pin number 12 */
+#define GPIO_PIN_12    (12)
+/** GPIO pin number 13 */
+#define GPIO_PIN_13    (13)
+/** GPIO pin number 14 */
+#define GPIO_PIN_14    (14)
+/** GPIO pin number 15 */
+#define GPIO_PIN_15    (15)
+/** GPIO pin number 16 */
+#define GPIO_PIN_16    (16)
+/** GPIO pin number 17 */
+#define GPIO_PIN_17    (17)
+/** GPIO pin number 18 */
+#define GPIO_PIN_18    (18)
+/** GPIO pin number 19 */
+#define GPIO_PIN_19    (19)
+/** GPIO pin number 20 */
+#define GPIO_PIN_20    (20)
+/** GPIO pin number 21 */
+#define GPIO_PIN_21    (21)
+/** GPIO pin number 22 */
+#define GPIO_PIN_22    (22)
+/** GPIO pin number 23 */
+#define GPIO_PIN_23    (23)
+/** GPIO pin number 24 */
+#define GPIO_PIN_24    (24)
+/** GPIO pin number 25 */
+#define GPIO_PIN_25    (25)
+/** GPIO pin number 26 */
+#define GPIO_PIN_26    (26)
+/** GPIO pin number 27 */
+#define GPIO_PIN_27    (27)
+/** GPIO pin number 28 */
+#define GPIO_PIN_28    (28)
+/** GPIO pin number 29 */
+#define GPIO_PIN_29    (29)
+/** GPIO pin number 30 */
+#define GPIO_PIN_30    (30)
+/** GPIO pin number 31 */
+#define GPIO_PIN_31    (31)
+/** GPIO pin number 32 */
+#define GPIO_PIN_32    (32)
+/** GPIO pin number 33 */
+#define GPIO_PIN_33    (33)
+/** GPIO pin number 34 */
+#define GPIO_PIN_34    (34)
+/** GPIO pin number 35 */
+#define GPIO_PIN_35    (35)
+/** GPIO pin number 36 */
+#define GPIO_PIN_36    (36)
+/** GPIO pin number 37 */
+#define GPIO_PIN_37    (37)
+/** GPIO pin number 38 */
+#define GPIO_PIN_38    (38)
+/** GPIO pin number 39 */
+#define GPIO_PIN_39    (39)
+/** GPIO pin number 40 */
+#define GPIO_PIN_40    (40)
+/** GPIO pin number 41 */
+#define GPIO_PIN_41    (41)
+/** GPIO pin number 42 */
+#define GPIO_PIN_42    (42)
+/** GPIO pin number 43 */
+#define GPIO_PIN_43    (43)
+/** GPIO pin number 44 */
+#define GPIO_PIN_44    (44)
+/** GPIO pin number 45 */
+#define GPIO_PIN_45    (45)
+/** GPIO pin number 46 */
+#define GPIO_PIN_46    (46)
+/** GPIO pin number 47 */
+#define GPIO_PIN_47    (47)
+/** GPIO pin number 48 */
+#define GPIO_PIN_48    (48)
+/** GPIO pin number 49 */
+#define GPIO_PIN_49    (49)
+/** GPIO pin number 50 */
+#define GPIO_PIN_50    (50)
+/** GPIO pin number 51 */
+#define GPIO_PIN_51    (51)
+/** GPIO pin number 52 */
+#define GPIO_PIN_52    (52)
+/** GPIO pin number 53 */
+#define GPIO_PIN_53    (53)
+/** GPIO pin number 54 */
+#define GPIO_PIN_54    (54)
+/** GPIO pin number 55 */
+#define GPIO_PIN_55    (55)
+/** GPIO pin number 56 */
+#define GPIO_PIN_56    (56)
+/** GPIO pin number 57 */
+#define GPIO_PIN_57    (57)
+/** GPIO pin number 58 */
+#define GPIO_PIN_58    (58)
+/** GPIO pin number 59 */
+#define GPIO_PIN_59    (59)
+/** GPIO pin number 60 */
+#define GPIO_PIN_60    (60)
+/** GPIO pin number 61 */
+#define GPIO_PIN_61    (61)
+/** GPIO pin number 62 */
+#define GPIO_PIN_62    (62)
+/** GPIO pin number 63 */
+#define GPIO_PIN_63    (63)
+/** GPIO pin number 64 */
+#define GPIO_PIN_64    (64)
+/** GPIO pin number 65 */
+#define GPIO_PIN_65    (65)
+/** GPIO pin number 66 */
+#define GPIO_PIN_66    (66)
+/** GPIO pin number 67 */
+#define GPIO_PIN_67    (67)
+/** GPIO pin number 68 */
+#define GPIO_PIN_68    (68)
+/** GPIO pin number 69 */
+#define GPIO_PIN_69    (69)
+/** GPIO pin number 70 */
+#define GPIO_PIN_70    (70)
+/** GPIO pin number 71 */
+#define GPIO_PIN_71    (71)
+/** GPIO pin number 72 */
+#define GPIO_PIN_72    (72)
+/** GPIO pin number 73 */
+#define GPIO_PIN_73    (73)
+/** GPIO pin number 74 */
+#define GPIO_PIN_74    (74)
+/** GPIO pin number 75 */
+#define GPIO_PIN_75    (75)
+/** GPIO pin number 76 */
+#define GPIO_PIN_76    (76)
+/** GPIO pin number 77 */
+#define GPIO_PIN_77    (77)
+/** GPIO pin number 78 */
+#define GPIO_PIN_78    (78)
+/** GPIO pin number 79 */
+#define GPIO_PIN_79    (79)
+/** GPIO pin number 80 */
+#define GPIO_PIN_80    (80)
+/** GPIO pin number 81 */
+#define GPIO_PIN_81    (81)
+/** GPIO pin number 82 */
+#define GPIO_PIN_82    (82)
+/** GPIO pin number 83 */
+#define GPIO_PIN_83    (83)
+/** GPIO pin number 84 */
+#define GPIO_PIN_84    (84)
+/** GPIO pin number 85 */
+#define GPIO_PIN_85    (85)
+/** GPIO pin number 86 */
+#define GPIO_PIN_86    (86)
+/** GPIO pin number 87 */
+#define GPIO_PIN_87    (87)
+/** GPIO pin number 88 */
+#define GPIO_PIN_88    (88)
+/** GPIO pin number 89 */
+#define GPIO_PIN_89    (89)
+/** GPIO pin number 90 */
+#define GPIO_PIN_90    (90)
+/** GPIO pin number 91 */
+#define GPIO_PIN_91    (91)
+/** GPIO pin number 92 */
+#define GPIO_PIN_92    (92)
+/** GPIO pin number 93 */
+#define GPIO_PIN_93    (93)
+/** GPIO pin number 94 */
+#define GPIO_PIN_94    (94)
+/** GPIO pin number 95 */
+#define GPIO_PIN_95    (95)
+/** GPIO pin number 96 */
+#define GPIO_PIN_96    (96)
+/** GPIO pin number 97 */
+#define GPIO_PIN_97    (97)
+/** GPIO pin number 98 */
+#define GPIO_PIN_98    (98)
+/** GPIO pin number 99 */
+#define GPIO_PIN_99    (99)
+/** GPIO pin number 100 */
+#define GPIO_PIN_100    (100)
+/** GPIO pin number 101 */
+#define GPIO_PIN_101    (101)
+/** GPIO pin number 102 */
+#define GPIO_PIN_102    (102)
+/** GPIO pin number 103 */
+#define GPIO_PIN_103    (103)
+/** GPIO pin number 104 */
+#define GPIO_PIN_104    (104)
+/** GPIO pin number 105 */
+#define GPIO_PIN_105    (105)
+/** GPIO pin number 106 */
+#define GPIO_PIN_106    (106)
+/** GPIO pin number 107 */
+#define GPIO_PIN_107    (107)
+/** GPIO pin number 108 */
+#define GPIO_PIN_108    (108)
+/** GPIO pin number 109 */
+#define GPIO_PIN_109    (109)
+/** GPIO pin number 110 */
+#define GPIO_PIN_110    (110)
+/** GPIO pin number 111 */
+#define GPIO_PIN_111    (111)
+/** GPIO pin number 112 */
+#define GPIO_PIN_112    (112)
+/** GPIO pin number 113 */
+#define GPIO_PIN_113    (113)
+/** GPIO pin number 114 */
+#define GPIO_PIN_114    (114)
+/** GPIO pin number 115 */
+#define GPIO_PIN_115    (115)
+/** GPIO pin number 116 */
+#define GPIO_PIN_116    (116)
+/** GPIO pin number 117 */
+#define GPIO_PIN_117    (117)
+/** GPIO pin number 118 */
+#define GPIO_PIN_118    (118)
+/** GPIO pin number 119 */
+#define GPIO_PIN_119    (119)
+/** GPIO pin number 120 */
+#define GPIO_PIN_120    (120)
+/** GPIO pin number 121 */
+#define GPIO_PIN_121    (121)
+/** GPIO pin number 122 */
+#define GPIO_PIN_122    (122)
+/** GPIO pin number 123 */
+#define GPIO_PIN_123    (123)
+/** GPIO pin number 124 */
+#define GPIO_PIN_124    (124)
+/** GPIO pin number 125 */
+#define GPIO_PIN_125    (125)
+/** GPIO pin number 126 */
+#define GPIO_PIN_126    (126)
+/** GPIO pin number 127 */
+#define GPIO_PIN_127    (127)
+/** GPIO pin number 128 */
+#define GPIO_PIN_128    (128)
+/** GPIO pin number 129 */
+#define GPIO_PIN_129    (129)
+/** GPIO pin number 130 */
+#define GPIO_PIN_130    (130)
+/** GPIO pin number 131 */
+#define GPIO_PIN_131    (131)
+/** GPIO pin number 132 */
+#define GPIO_PIN_132    (132)
+/** GPIO pin number 133 */
+#define GPIO_PIN_133    (133)
+/** GPIO pin number 134 */
+#define GPIO_PIN_134    (134)
+/** GPIO pin number 135 */
+#define GPIO_PIN_135    (135)
+/** GPIO pin number 136 */
+#define GPIO_PIN_136    (136)
+/** GPIO pin number 137 */
+#define GPIO_PIN_137    (137)
+/** GPIO pin number 138 */
+#define GPIO_PIN_138    (138)
+/** GPIO pin number 139 */
+#define GPIO_PIN_139    (139)
+/** GPIO pin number 140 */
+#define GPIO_PIN_140    (140)
+/** GPIO pin number 141 */
+#define GPIO_PIN_141    (141)
+/** GPIO pin number 142 */
+#define GPIO_PIN_142    (142)
+/** GPIO pin number 143 */
+#define GPIO_PIN_143    (143)
+
+/** Number of GPIO pins per bank */
+#define GPIO_PINS_PER_BANK         (32)
+/** Maximum number of GPIO banks */
+#define GPIO_MAX_BANKS             (5)
+
+/** Maximum number of GPIO pins supported per instance */
+#define GPIO_MAX_NUMBER            ((GPIO_MAX_BANKS) * (GPIO_PINS_PER_BANK))
+
+/*
+ * \brief GPIO function returned result
+ */
+/** GPIO pin value is low */
+#define GPIO_LOW                   (0)
+/** GPIO pin value is high */
+#define GPIO_HIGH                  (1)
+/** Requested operation is successful */
+#define GPIO_RET_OK                (0)
+/** Requested operation is failed */
+#define GPIO_RET_FAIL              (1)
+/** Invalid GPIO pin/bank number error */
+#define INVALID_GPIO_NUMBER        (2)
+/** Invalid GPIO direction error */
+#define INVALID_GPIO_DIRECTION     (3)
+/** Invalid GPIO state error */
+#define        INVALID_GPIO_STATE         (4)
+/** Invalid GPIO port number error */
+#define        INVALID_GPIO_PORT          (5)
+
+/** Command to set GPIO pin direction */
+#define GPIO_CTRL_SET_DIR          (0)
+/** Command to set GPIO pin output */
+#define GPIO_CTRL_SET_OUTPUT       (1)
+/** Command to clear GPIO pin output */
+#define GPIO_CTRL_CLEAR_OUTPUT     (2)
+/** Command to read GPIO pin input */
+#define GPIO_CTRL_READ_INPUT       (3)
+/** Command to set rising edge interrupt */
+#define GPIO_CTRL_SET_RE_INTR      (4)
+/** Command to clear rising edge interrupt */
+#define GPIO_CTRL_CLEAR_RE_INTR    (5)
+/** Command to set falling edge interrupt */
+#define GPIO_CTRL_SET_FE_INTR      (6)
+/** Command to clear falling edge interrupt */
+#define GPIO_CTRL_CLEAR_FE_INTR    (7)
+
+/** GPIO function return type */
+typedef uint16_t GPIO_RET;
+
+/**
+ * \brief Options to configure GPIO pin direction
+ */
+typedef enum _GpioDirection
+{
+    GPIO_OUT = 0,  /**< Configures GPIO pin as output */
+    GPIO_IN        /**< Configures GPIO pin as input */
+} GpioDirection;
+
+/************************
+ * Function declarations
+ ************************/
+/**
+ * \brief  Returns base address of given GPIO port number.
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ *
+ * \return CSL_GpioHandle\n
+ *
+ */
+CSL_GpioHandle GPIOGetRegBaseAddr(uint8_t gpioPortNumber);
+
+/**
+ * \brief  Initializes the GPIO peripheral
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ *
+ */
+GPIO_RET GPIOInit(uint8_t gpioPortNumber);
+
+/**
+ * \brief  This function configures the specified GPIO's direction
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ * \param   direction      [IN]    GPIO pin direction
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+GPIO_RET GPIOSetDirection(uint8_t gpioPortNumber, uint8_t pinNum,
+                          GpioDirection direction);
+
+/**
+ * \brief  This function sets the specified GPIO's pin state to 1
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+GPIO_RET GPIOSetOutput(uint8_t gpioPortNumber, uint8_t pinNum);
+
+/**
+ * \brief  This function Clears the specified GPIO's pin state to 0
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ *
+ */
+GPIO_RET GPIOClearOutput(uint8_t gpioPortNumber, uint8_t pinNum);
+
+/**
+ * \brief  This function gets the specified GPIO's pin state
+ *
+ * The specified GPIO should be configured as input
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      uint32_t - Input state of GPIO if success
+ * \n                          - else GPIO status
+ */
+uint32_t GPIOReadInput(uint8_t gpioPortNumber, uint8_t pinNum);
+
+/**
+ * \brief  This function Enables GPIO interrupts to CPU
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   bankNum        [IN]    GPIO bank number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO bank number
+ */
+//GPIO_RET GPIOEnableGlobalInterrupt(uint8_t gpioPortNumber, uint8_t bankNum);
+
+/**
+ * \brief  This function Disables GPIO interrupts to CPU
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   bankNum        [IN]    GPIO bank number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO bank number
+ */
+//GPIO_RET GPIODisableGlobalInterrupt(uint8_t gpioPortNumber, uint8_t bankNum);
+
+/**
+ * \brief  This function sets specified GPIO's rising edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+//GPIO_RET GPIOSetRisingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum);
+
+/**
+ * \brief  This function clears specified GPIO's rising edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+//GPIO_RET GPIOClearRisingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum);
+
+/**
+ * \brief  This function sets specified GPIO's falling edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+//GPIO_RET GPIOSetFallingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum);
+
+/**
+ * \brief  This function clears specified GPIO's falling edge interrupt
+ *
+ * \param   gpioPortNumber [IN]    GPIO port number
+ * \param   pinNum         [IN]    GPIO pin number
+ *
+ * \return
+ * \n      GPIO_RET_OK          - Requested operation is successful
+ * \n      INVALID_GPIO_PORT    - Invalid GPIO port number
+ * \n      INVALID_GPIO_NUMBER  - Invalid GPIO pin number
+ */
+//GPIO_RET GPIOClearFallingEdgeInterrupt(uint8_t gpioPortNumber, uint8_t pinNum);
+
+#endif /* _EVMC66X_GPIO_H_ */
+
+/* Nothing past this point */
index 439426e0dc85b38e99d07d6083028e7bbe32b652..57643d79d14f390df5426166e7b944d241f9dd86 100644 (file)
@@ -11,8 +11,8 @@
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
+                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CPPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/dolby_ip/ddp/Dolby_Digital_Plus_Decoder_Imp/Source_Code/alg&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/dolby_ip/ddp/Dolby_Digital_Plus_Decoder_Imp/Source_Code/include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${PROC_AUDIO_SDK_ROOT}/dolby_ip/mat-thd/Dolby_MAT_Decoder_Imp/Source_Code/alg&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${PDK_INSTALL_PATH}&quot;"/>
                                                                </option>
                                                                <option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.MFLOAT_ABI.576208136" name="Specify if floating point hardware should be used (-mfloat-abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.MFLOAT_ABI" value="hard" valueType="string"/>
                                                                <option id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.OTHER_PREPROC_FLAGS.1983639225" name="Other preprocessor flags (-Xpreprocessor)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_4.0.compilerID.OTHER_PREPROC_FLAGS"/>
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
+                                       <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CPPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
                                        <stringMacro name="AIF2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="CSL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="MMCSD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
                                        <stringMacro name="ICSS_EMAC_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="PDK_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti/processor_audio_sdk_1_00_00_01/psdk_cust/pdk_k2g_1_0_1_0_eng/packages"/>
                                        <stringMacro name="USB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="I2C_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN2_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="IQN_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="PKTLIB_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SRIO_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="DFE_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="PRUSS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SBL_BOOT_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
-                                       <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="FATFS_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="UART_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="NWAL_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
+                                       <stringMacro name="BOARD_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                        <stringMacro name="SPI_INSTALL_PATH" type="VALUE_PATH_DIR" value="C:/ti"/>
                                </macros>
                                <externalSettings/>
index 55da612554d1e3549ba161e93260d4fc76824253..a79a1b31d6b262d3ff30a0a68940b4253abc2578 100644 (file)
@@ -58,7 +58,7 @@ All rights reserved.
     writeVOLOffsetMasterN(0x7fff), \
     writeSYSRecreationModeDirect, \
     writeSYSChannelConfigurationRequestSurround4_1, \
-    execPAIOutAnalog, \
+    execPAIOutNone, \
     execPAIInHDMI
 #else
 //DDP
index b07aa9eb9c2f2ba84c8e3740cbb916a1a7f6e199..7b1dbf891eacd612781ff3f497cc19bd8c421803 100644 (file)
@@ -320,6 +320,9 @@ extern struct {
     IALG_Status *pStatus[512];
 } IACP_STD_BETA_TABLE;
 
+// FL: debug
+#include "evmc66x_pinmux.h"
+#include "evmc66x_gpio_dbg.h"
 
 /*
  *  ======== taskAsipFxn ========
@@ -1914,7 +1917,7 @@ PAF_ASIT_autoProcessing(
     if (nbytes == -DIBERR_SYNC)
     {
         TRACE_TERSE2("PAF_ASIT_autoProcessing: AS%d: SIO_reclaim returned 0x%x, ignoring", as+zMS, nbytes);
-        return 0;
+        return nbytes;
     }
     if (nbytes != sizeof(PAF_InpBufConfig))
     {
@@ -2313,8 +2316,8 @@ PAF_ASIT_decodeProcessing(
             
                 if (errno = pP->fxns->decodeDecode(pP, pQ, pC, sourceSelect, frame, block))
                 {
-                    gAsipDecodeErrCnt++;
-                    TRACE_TERSE1("PAF_ASIT_decodeProcessing: state: DECODE.  decodeDecode err 0x%04x", errno);
+                       gAsipDecodeErrCnt++;
+                       TRACE_TERSE1("PAF_ASIT_decodeProcessing: state: DECODE.  decodeDecode err 0x%04x", errno);
                     break;
                 }
       
index 43b6ef0004f5e57276506d7ee582053d505773b3..79c971955cc4a70928b6ec4059516f1efd972b0b 100644 (file)
@@ -607,7 +607,8 @@ const IALG_MemRec inpMemTabPrimary[] =
 
         // GJ Debug: The below is not required; hence 0
 
-    // IRAM scratch memory for autodetection and stereo PCM input
+#if 0
+       // IRAM scratch memory for autodetection and stereo PCM input
     // High watermark needs are set by the latter:
     // double buffer stereo 32bit PCM input 512 max frame size
     // 1 buffers * 512 samples/buffer * 2 words/sample * 4 bytes/word
@@ -618,11 +619,13 @@ const IALG_MemRec inpMemTabPrimary[] =
         IALG_SCRATCH,                                          // attrs
         NULL,                                                  // base
     }
+#endif
+
 };
 
 const PAF_SIO_IALG_Params inpSioAlgParamsPrimary =
 {
-    2,
+    1,
     inpMemTabPrimary
 };
 
index e4d5fef79d6444ea9bc99f4b614ad32f067e62a7..d391d45e7ea473172fea5968aef4f44a8145a28e 100644 (file)
@@ -44,6 +44,8 @@ All rights reserved.
 #include "vproccmds_a.h"
 #include <stdarg.h>
 #include "string.h"
+#include <xdc/runtime/Log.h>
+
 
 Platform_STATUS audioHDMIConfig(void);
 
@@ -274,7 +276,7 @@ Platform_STATUS audioDirConfig(void)
                }
 
                IFPRINT(platform_write("audioDirConfig : Waiting for DIR to Enter PLL Mode...\n"));
-               platform_delay(1000);
+               platform_delay(10);
                timeout--;
        }
 
@@ -384,12 +386,13 @@ void set_audio_desc(unsigned char var1,unsigned char var2,unsigned char var3,uns
 {
        int ret_val=I2C_RET_OK;
 
-       platform_delay(1000);do{ret_val=alpha_i2c_write(HSDIO_EDID_AUDIO_DESC_FORMAT(var1, var2));}while (ret_val !=I2C_RET_OK);
-       platform_delay(1000);do{ret_val=alpha_i2c_write(HSDIO_EDID_AUDIO_DESC_NUM_CHANNELS(var1, var3));}while (ret_val !=I2C_RET_OK);
-       platform_delay(1000);do{ret_val=alpha_i2c_write(HSDIO_EDID_AUDIO_DESC_SAMPLE_RATES(var1, var4));}while (ret_val !=I2C_RET_OK);
-       platform_delay(1000);do{ret_val=alpha_i2c_write(HSDIO_EDID_AUDIO_DESC_MISC(var1, var5));}while (ret_val !=I2C_RET_OK);
+       platform_delay(10);do{ret_val=alpha_i2c_write(HSDIO_EDID_AUDIO_DESC_FORMAT(var1, var2));}while (ret_val !=I2C_RET_OK);
+       platform_delay(10);do{ret_val=alpha_i2c_write(HSDIO_EDID_AUDIO_DESC_NUM_CHANNELS(var1, var3));}while (ret_val !=I2C_RET_OK);
+       platform_delay(10);do{ret_val=alpha_i2c_write(HSDIO_EDID_AUDIO_DESC_SAMPLE_RATES(var1, var4));}while (ret_val !=I2C_RET_OK);
+       platform_delay(10);do{ret_val=alpha_i2c_write(HSDIO_EDID_AUDIO_DESC_MISC(var1, var5));}while (ret_val !=I2C_RET_OK);
 }
 
+int gI2Ccnt=0;
 
 // Program HDMI CEA / EDID values, as necessary.
 void hrptredid()
@@ -397,14 +400,17 @@ void hrptredid()
        int ret_val=I2C_RET_OK;
 
        do{
-               platform_delay(1000);
+               platform_delay(10);
                ret_val=alpha_i2c_write(HSDIO_EDID_SPEAKER_ALLOCATION_BLOCK(0xFF));
         if (ret_val !=I2C_RET_OK)
-            i2cConfig(HSR4_I2C_PORT_NUM);        
+        {
+               gI2Ccnt++;
+               i2cConfig(HSR4_I2C_PORT_NUM);
+        }
             
        }while (ret_val !=I2C_RET_OK);
 
-       platform_delay(1000);
+       platform_delay(10);
        do{ret_val=alpha_i2c_write(HSDIO_EDID_SPEAKER_ALLOCATION_BLOCK_2(0x7));}while (ret_val !=I2C_RET_OK);
 
        set_audio_desc(0,1,2,0x7f,7);   // PCM 2 channel, 32kHz, 44.1kHz, 48kHz, 88.2kHz, 96kHz, 176.4 KHz, 192 KHz, 16bit, 20bit, 24bit
@@ -429,7 +435,7 @@ void hrptredid()
        set_audio_desc(17,0,0,0,0);
        set_audio_desc(18,0,0,0,0);
        set_audio_desc(19,0,0,0,0);
-       platform_delay(1000);
+       platform_delay(10);
        do{ret_val=alpha_i2c_write(HSDIO_EDID_GO);}while (ret_val !=I2C_RET_OK);
 }
 
@@ -439,14 +445,14 @@ void  hdmi128()
 {
        int ret_val=I2C_RET_OK;
 
-       platform_delay(1000);do{ret_val=alpha_i2c_write(HSDIO_ALERT(HSDIO_ALERT_INPUT_AUDIO_CHANGE_msk));}while (ret_val !=I2C_RET_OK);
-       platform_delay(1000);do{ret_val=alpha_i2c_write(HSDIO_ALERT(HSDIO_ALERT_INPUT_AUDIO_MUTE_msk));}while (ret_val !=I2C_RET_OK);
-       platform_delay(1000);do{ret_val=alpha_i2c_write(HSDIO_AUDIO_MCLK_TO_HOST(HSDIO_AudioMClk_128X));}while (ret_val !=I2C_RET_OK);
-       platform_delay(1000);do{ret_val=alpha_i2c_write(HSDIO_AUDIO_UNMUTE_DELAY_TO_HOST(HSDIO_AudioUnMuteDelay_NO_DELAY));}while (ret_val !=I2C_RET_OK);
-       platform_delay(1000);do{ret_val=alpha_i2c_write(HSDIO_AUDIO_FORMAT_TO_HOST(HSDIO_AudioFmt_I2S));}while (ret_val !=I2C_RET_OK);
-       platform_delay(1000);do{ret_val=alpha_i2c_write(HSDIO_IMPLEMENT_AUDIO_TO_HOST_CMDS);}while (ret_val !=I2C_RET_OK);
-       platform_delay(1000);do{ret_val=alpha_i2c_write(HSDIO_AUDIO_ROUTING(HSDIO_AudioRouting_HSDIOIN_NOOUT));}while (ret_val !=I2C_RET_OK);
-       platform_delay(1000);do{ret_val=alpha_i2c_write(HSDIO_SYS_CFG_GO);}while (ret_val !=I2C_RET_OK);
+       platform_delay(10);do{ret_val=alpha_i2c_write(HSDIO_ALERT(HSDIO_ALERT_INPUT_AUDIO_CHANGE_msk));}while (ret_val !=I2C_RET_OK);
+       //platform_delay(10);do{ret_val=alpha_i2c_write(HSDIO_ALERT(HSDIO_ALERT_INPUT_AUDIO_MUTE_msk));}while (ret_val !=I2C_RET_OK);
+       platform_delay(10);do{ret_val=alpha_i2c_write(HSDIO_AUDIO_MCLK_TO_HOST(HSDIO_AudioMClk_128X));}while (ret_val !=I2C_RET_OK);
+       platform_delay(10);do{ret_val=alpha_i2c_write(HSDIO_AUDIO_UNMUTE_DELAY_TO_HOST(HSDIO_AudioUnMuteDelay_NO_DELAY));}while (ret_val !=I2C_RET_OK);
+       platform_delay(10);do{ret_val=alpha_i2c_write(HSDIO_AUDIO_FORMAT_TO_HOST(HSDIO_AudioFmt_I2S));}while (ret_val !=I2C_RET_OK);
+       platform_delay(10);do{ret_val=alpha_i2c_write(HSDIO_IMPLEMENT_AUDIO_TO_HOST_CMDS);}while (ret_val !=I2C_RET_OK);
+       platform_delay(10);do{ret_val=alpha_i2c_write(HSDIO_AUDIO_ROUTING(HSDIO_AudioRouting_HSDIOIN_NOOUT));}while (ret_val !=I2C_RET_OK);
+       platform_delay(10);do{ret_val=alpha_i2c_write(HSDIO_SYS_CFG_GO);}while (ret_val !=I2C_RET_OK);
 }
 
 //
@@ -529,10 +535,13 @@ unsigned int read_hdmi_samprate()
        Uint8 length;
        int ret_val=7;
 
+       Log_info0("Audio DC CFG: Entered read_hdmi_samprate");
        ret_val=alpha_i2c_write(HSDIO_AUDIO_INPUT_FREQ_STS);
-
        if(!ret_val) i2cRead(HSR4_I2C_PORT_NUM, HSR4_I2C_ADDR,&length,0,1,1);
        if(!ret_val) i2cRead(HSR4_I2C_PORT_NUM, HSR4_I2C_ADDR,&data[0],0,1,length);
+
+       Log_info0("Audio DC CFG: Leaving read_hdmi_samprate");
+
        if(!ret_val) ret_val= data[3]; // indicates sample rate
        else
        ret_val = 0;
index aff66f8a17eb23e6de178d11c7061de6f4b3a3e5..174e76b143bf391df2fac8bab27199d93f33a2a4 100644 (file)
@@ -104,26 +104,48 @@ void swapHdmi(Ptr, int);
 
 
 #ifdef TEST_MULTICHANNEL
-#define SAP_UNDER_LEN 16
+#define SAP_UNDER_LEN 8
 //#define SAP_UNDER_LEN 1024 // GJ: experiment
 #else
 #define SAP_UNDER_LEN 1024
 #endif
 int sap_UNDER[SAP_UNDER_LEN]; // used for underrun
-int sap_OVER = 0;     // used for overrun
+int sap_OVER_1LANE = 0;     // used for overrun
+int sap_OVER_4LANE[4] = {0,0,0,0};      // used for overrun
 
 #ifdef DEBUG
 void DJDBG_SAP_EDMA_dumpParams(int tag_place)
 {
-       unsigned int *ptrPARAM_BASE = (unsigned int *)0x02704000;
-       unsigned int *ptrPARAM0x18 = (unsigned int *)0x02704300; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
+       //unsigned int *ptrPARAM_BASE = (unsigned int *)0x02704000;
+       //unsigned int *ptrPARAM0x18 = (unsigned int *)0x02704300; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
        unsigned int *ptrPARAM0x19 = (unsigned int *)0x02704320; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
+       unsigned int *ptrPARAM0x41 = (unsigned int *)0x027048A0; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
+       unsigned int *ptrPARAM0x42 = (unsigned int *)0x027048C0; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
+       unsigned int *ptrPARAM0x43 = (unsigned int *)0x027048E0; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
+       unsigned int *ptrPARAM0x44 = (unsigned int *)0x02704910; // ((*((EDMA3_CCRL_Regs *) 0x02700000)).PARAMENTRY)[24]
 
-       Log_info5("PARAM0x18a(%d): 0x%x 0x%x 0x%x 0x%x", tag_place, ptrPARAM0x18[0], ptrPARAM0x18[1], ptrPARAM0x18[2], ptrPARAM0x18[3]);
-       Log_info5("PARAM0x18b(%d): 0x%x 0x%x 0x%x 0x%x", tag_place, ptrPARAM0x18[4], ptrPARAM0x18[5], ptrPARAM0x18[6], ptrPARAM0x18[7]);
+       //Log_info5("PARAM0x18a(%d): 0x%x 0x%x 0x%x 0x%x", tag_place, ptrPARAM0x18[0], ptrPARAM0x18[1], ptrPARAM0x18[2], ptrPARAM0x18[3]);
+       //Log_info5("PARAM0x18b(%d): 0x%x 0x%x 0x%x 0x%x", tag_place, ptrPARAM0x18[4], ptrPARAM0x18[5], ptrPARAM0x18[6], ptrPARAM0x18[7]);
 
-       Log_info5("PARAM0x19a(%d): 0x%x 0x%x 0x%x 0x%x", tag_place, ptrPARAM0x19[0], ptrPARAM0x19[1], ptrPARAM0x19[2], ptrPARAM0x19[3]);
-       Log_info5("PARAM0x19b(%d): 0x%x 0x%x 0x%x 0x%x", tag_place, ptrPARAM0x19[4], ptrPARAM0x19[5], ptrPARAM0x19[6], ptrPARAM0x19[7]);
+       Log_info5("PARAM0x19a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x19[0] & 0x200000) >> 21), ((ptrPARAM0x19[0] & 0x100000) >> 20), ((ptrPARAM0x19[0] & 0x3F000) >> 12), ((ptrPARAM0x19[0] & 0x800) >> 11));
+       Log_info5("PARAM0x19b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x19[1], ptrPARAM0x19[2], ptrPARAM0x19[3], ptrPARAM0x19[4]);
+       Log_info4("PARAM0x19b(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x19[5], ptrPARAM0x19[6], ptrPARAM0x19[7]);
+
+       Log_info5("PARAM0x41a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x41[0] & 0x200000) >> 21), ((ptrPARAM0x41[0] & 0x100000) >> 20), ((ptrPARAM0x41[0] & 0x3F000) >> 12), ((ptrPARAM0x41[0] & 0x800) >> 11));
+       Log_info5("PARAM0x41b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x41[1], ptrPARAM0x41[2], ptrPARAM0x41[3], ptrPARAM0x41[4]);
+       Log_info4("PARAM0x41b(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x41[5], ptrPARAM0x41[6], ptrPARAM0x41[7]);
+
+       Log_info5("PARAM0x42a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x42[0] & 0x200000) >> 21), ((ptrPARAM0x42[0] & 0x100000) >> 20), ((ptrPARAM0x42[0] & 0x3F000) >> 12), ((ptrPARAM0x42[0] & 0x800) >> 11));
+       Log_info5("PARAM0x42b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x42[1], ptrPARAM0x42[2], ptrPARAM0x42[3], ptrPARAM0x42[4]);
+       Log_info4("PARAM0x42b(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x42[5], ptrPARAM0x42[6], ptrPARAM0x42[7]);
+
+       Log_info5("PARAM0x43a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x43[0] & 0x200000) >> 21), ((ptrPARAM0x43[0] & 0x100000) >> 20), ((ptrPARAM0x43[0] & 0x3F000) >> 12), ((ptrPARAM0x43[0] & 0x800) >> 11));
+       Log_info5("PARAM0x43b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x43[1], ptrPARAM0x43[2], ptrPARAM0x43[3], ptrPARAM0x43[4]);
+       Log_info4("PARAM0x43b(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x43[5], ptrPARAM0x43[6], ptrPARAM0x43[7]);
+
+       Log_info5("PARAM0x44a(%d): ITCINTEN: 0x%02x, TCINTEN: 0x%02x, TCC: 0x%02x, TCCMODE: %d", tag_place, ((ptrPARAM0x44[0] & 0x200000) >> 21), ((ptrPARAM0x44[0] & 0x100000) >> 20), ((ptrPARAM0x44[0] & 0x3F000) >> 12), ((ptrPARAM0x44[0] & 0x800) >> 11));
+       Log_info5("PARAM0x44b(%d): SRC: 0x%08x, A_B_CNT: 0x%08x, DST: 0x%08x,  SRC_DST_BIDX: 0x%08x", tag_place, ptrPARAM0x44[1], ptrPARAM0x44[2], ptrPARAM0x44[3], ptrPARAM0x44[4]);
+       Log_info4("PARAM0x44b(%d): LINK_BCNTRLD: 0x%08x, SRC_DST_CIDX: 0x%08x, CCNT: 0x%08x", tag_place, ptrPARAM0x44[5], ptrPARAM0x44[6], ptrPARAM0x44[7]);
     //Log_info1("TCC0: ERR reg %x", *((unsigned int *)0x02760120)); //DJDBG
 }
 #endif
@@ -602,7 +624,7 @@ Int SAP_start (DEV2_Handle device)
        // will be serviced and generate an interrupt even before the McASP is enabled.
        pDevExt->runState = 1;
        pDevExt->shutDown = 0;
-       //Log_info0 ("SAP_start runState=1 & ENABLE TRANSFERS");
+       Log_info1 ("SAP: %d, SAP_start runState=1 & ENABLE TRANSFERS", __LINE__);
        // enable interrupts and event servicing for this channel
        EDMA3_DRV_enableTransfer (hEdma, pDevExt->activeEdma, EDMA3_DRV_TRIG_MODE_EVENT);
 
@@ -705,8 +727,8 @@ Int SAP_issue (DEV2_Handle device)
     pDevExt->numQueued += 1;
 
     result = SAP_EDMA_setupXfer (device, pParam->hEdmaParam, parentEdma, pDevExt->errorEdma, pFrame);
-    //Log_info4("SAP_issue.%d, EDMA_setupXfer: Target EDMA: 0x%x, Parent Edma: 0x%x Error Edma: 0x%x",
-    //                __LINE__, pParam->hEdma, parentEdma, pDevExt->errorEdma);
+    Log_info4("SAP_issue.%d, EDMA_setupXfer: Target EDMA: 0x%x, Parent Edma: 0x%x Error Edma: 0x%x",
+                    __LINE__, pParam->hEdmaParam, parentEdma, pDevExt->errorEdma);
 
     /*if ((device->mode != DEV2_INPUT) && (gDmaParamsidx <=16))
        {
@@ -792,6 +814,7 @@ Int SAP_reclaim (DEV2_Handle device)
 
     // idle if necessary
         if (pDevExt->errorState == PAF_SIO_ERROR_FATAL) {
+               Log_info1("SAP_reclaim: PAF_SIO_ERROR_FATAL,  Before Idle for device 0x%x  ", device->mode);
             DEV2_idle (device, 1);
             return SIO2_EBADIO;
         }
@@ -807,6 +830,7 @@ Int SAP_reclaim (DEV2_Handle device)
     }
     //Log_info1("SAP_reclaim: After SEM Pend for mode: 0x%x", device->mode);
 
+#if 0
     // return error (owner must idle)
     if (pDevExt->errorState == PAF_SIO_ERROR_FATAL)
     {
@@ -814,6 +838,7 @@ Int SAP_reclaim (DEV2_Handle device)
         //TRACE_TERSE((&TR_MOD, "SAP_reclaim.%d, PAF_SIO_ERROR_FATAL: 0x%x", __LINE__, pDevExt->errorState));
         return PAF_SIO_ERROR_FATAL;
     }
+#endif
 
 #ifdef SAP_CACHE_SUPPORT
     // invalidate CACHE region if input -- use clean since
@@ -842,6 +867,7 @@ Int SAP_reclaim (DEV2_Handle device)
     /*if ((device->mode == DEV2_OUTPUT) && (pFrame->addr == NULL))
        SW_BREAKPOINT; */
 
+    Log_info1("SAP_reclaim: Exiting with SIO2_OK for device 0x%x  ", device->mode);
     //TRACE_VERBOSE((&TR_MOD, "SAP_reclaim.%d, exit SIO2_OK", __LINE__));
     return SIO2_OK;
 } // SAP_reclaim
@@ -1120,6 +1146,7 @@ Int SAP_shutdown (DEV2_Handle device)
     // reset counter
     pDevExt->numQueued = 0;
 
+    //DJDBG_SAP_EDMA_dumpParams(1);
     // make sure active is linked to error
         EDMA3_DRV_linkChannel (hEdma, pDevExt->activeEdma, pDevExt->errorEdma);
 
@@ -1167,8 +1194,6 @@ Void SAP_watchDog (Void)
         return;
     }
 
-    // GJ: Revisit, along with other context protections here.
-    // GJ: Is this architecture ok?
     // protect context
     Task_disable (); // needed since we may call SEM_post
     //oldMask = Hwi_disable ();
@@ -1402,7 +1427,7 @@ Int SAP_EDMA_setupParam (DEV2_Handle device, XDAS_UInt32 targetEdma, XDAS_UInt32
     }
     else {
        //edmaConfig.opt |= EDMA3_DRV_OPT_SAM_SET_MASK (EDMA3_DRV_ADDR_MODE_FIFO); //DJDBG!!!
-       //edmaConfig.opt |= 1;
+       edmaConfig.opt |= 1;
     }
 
     // if regular transfer then enable interrupt with tcc code
@@ -1435,15 +1460,15 @@ Int SAP_EDMA_setupParam (DEV2_Handle device, XDAS_UInt32 targetEdma, XDAS_UInt32
                //if(pDevExt->edmaWordSize == 2)
                //edmaConfig.srcAddr= (unsigned int)edmaConfig.srcAddr+ 2;
             edmaConfig.destBIdx = 0;
-            edmaConfig.destAddr = (unsigned int) &sap_OVER;
+            edmaConfig.destAddr = (unsigned int) &sap_OVER_4LANE;
+            edmaConfig.cCnt = 1;
         }
     }
     else {
         edmaConfig.destBIdx = 0;
+        edmaConfig.srcBIdx  = pDevExt->edmaWordSize;
         edmaConfig.destAddr = (unsigned int) (hPort->xbufAddr);
-
         if (addr) {
-            edmaConfig.srcBIdx  = pDevExt->edmaWordSize;
             edmaConfig.srcCIdx  = pDevExt->edmaWordSize * pDevExt->numSers ;
             edmaConfig.srcAddr  = addr;
             //Edma3_CacheFlush ((unsigned int) addr, (size+3)/4);
@@ -1460,7 +1485,8 @@ Int SAP_EDMA_setupParam (DEV2_Handle device, XDAS_UInt32 targetEdma, XDAS_UInt32
     edmaConfig.srcAddr  = (unsigned int) getGlobalAddr(edmaConfig.srcAddr);
     edmaConfig.destAddr  = (unsigned int) getGlobalAddr(edmaConfig.destAddr);
 
-    //Log_info3("SAP: Inside SAP_EDMA_setupParam with targetEdma = 0x%x linked to childEdma = 0x%x & dest-addr: 0x%x", targetEdma, childEdma, edmaConfig.destAddr);
+    Log_info5("SAP: Inside SAP_EDMA_setupParam with size=0x%x, targetEdma = 0x%x, CCNT = %d with dest-addr: 0x%x and OPT=0x%x", size, targetEdma, edmaConfig.cCnt, edmaConfig.destAddr, edmaConfig.opt);
+    Log_info5("SAP: Inside SAP_EDMA_setupParam with aCnt=0x%x, bCnt = 0x%x, destBIdx = 0x%x destCIdx: 0x%x and bCntReload=0x%x", edmaConfig.aCnt, edmaConfig.bCnt, edmaConfig.destBIdx, edmaConfig.destCIdx, edmaConfig.bCntReload);
 
     EDMA3_DRV_setPaRAM (hEdma, targetEdma, &edmaConfig);
 
index 306650ba019aeaf9e72d3cd8033d66f9c95f99ce..e7933bd2d49fb663e7e0754dfe376a37a32d3d98 100644 (file)
@@ -848,15 +848,23 @@ static int manageInput (DEV2_Handle device, const SAP_D10_Rx_Params *pParams, PA
     {
 
         pStatusIn->emphasis = PAF_IEC_PREEMPHASIS_NO;
-        //pStatusIn->lock = 1;
-        //pStatusIn->nonaudio = PAF_IEC_AUDIOMODE_AUDIO;
 
-       if(!HDMIGpioGetState())
+        pStatusIn->lock = 1;
+        pStatusIn->nonaudio = PAF_IEC_AUDIOMODE_AUDIO;
+        RateHdmi = PAF_SAMPLERATE_192000HZ;
+        pStatusIn->sampleRateMeasured = RateTable_hdmi[RateHdmi];
+        pStatusIn->sampleRateData = pStatusIn->sampleRateMeasured;
+
+#if 0
+        if(!HDMIGpioGetState())
        {
+               Log_info0("SAP_D10: Entering HMINT!\n");
                clear_hdmi_hmint();
                gHmint_ctr++;
 
+               Log_info0("SAP_D10: Clearing HMINT!\n");
                RateHdmi=read_hdmi_samprate();
+               RateHdmi = PAF_SAMPLERATE_192000HZ;
                        pStatusIn->sampleRateMeasured = RateTable_hdmi[RateHdmi];
                        pStatusIn->sampleRateData = pStatusIn->sampleRateMeasured;
                        PrevSampRate = pStatusIn->sampleRateMeasured;
@@ -899,14 +907,14 @@ static int manageInput (DEV2_Handle device, const SAP_D10_Rx_Params *pParams, PA
                                gNonAudio_ctr++;
                                pStatusIn->nonaudio = PAF_IEC_AUDIOMODE_NONAUDIO;
                        }
-
-
        }
        else
        {
                pStatusIn->sampleRateMeasured = PrevSampRate;
                pStatusIn->sampleRateData = pStatusIn->sampleRateMeasured;
        }
+#endif
+
        }
 
     else