]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/pdk.git/commitdiff
PDK-5151: Board: Enabled oled diagnostic test for am64x evm
authorM V Pratap Reddy <x0257344@ti.com>
Mon, 19 Oct 2020 11:20:05 +0000 (16:50 +0530)
committerSivaraj R <sivaraj@ti.com>
Mon, 19 Oct 2020 13:28:50 +0000 (08:28 -0500)
packages/ti/board/diag/board_diag_component.mk
packages/ti/board/diag/oled_display/build/makefile [new file with mode: 0755]
packages/ti/board/diag/oled_display/src/icek2g_oled.c [changed mode: 0644->0755]
packages/ti/board/diag/oled_display/src/oled_display.c [changed mode: 0644->0755]
packages/ti/board/diag/oled_display/src/oled_display.h [changed mode: 0644->0755]
packages/ti/board/src/am64x_evm/include/board_cfg.h
packages/ti/board/src/am64x_evm/include/board_internal.h

index a99c5ae087aee60822ac0e7c773641fc8238a4fa..67d8d426985b1b7c7aabcb861951f9f2162dfe4c 100755 (executable)
@@ -760,6 +760,26 @@ export board_diag_norflash_$(SOC)_CORELIST
 export board_diag_norflash_SBL_APPIMAGEGEN = $(board_diag_APPIMAGEGEN_CTRL)
 board_diag_EXAMPLE_LIST += board_diag_norflash
 
+# OLED DISPLAY
+board_diag_oledDisplay_COMP_LIST = board_diag_oledDisplay
+board_diag_oledDisplay_RELPATH = ti/board/diag/oled_display/build
+board_diag_oledDisplay_PATH = $(PDK_BOARD_DIAG_COMP_PATH)/oled_display/build
+board_diag_oledDisplay_CUSTOM_BINPATH = $(board_diag_LOCAL_BINPATH)
+board_diag_oledDisplay_MAKEFILE = -f makefile
+board_diag_oledDisplay_BOARD_DEPENDENCY = yes
+board_diag_oledDisplay_CORE_DEPENDENCY = yes
+export board_diag_oledDisplay_COMP_LIST
+export board_diag_oledDisplay_BOARD_DEPENDENCY
+export board_diag_oledDisplay_CORE_DEPENDENCY
+export board_diag_oledDisplay_MAKEFILE
+board_diag_oledDisplay_PKG_LIST = board_diag_oledDisplay
+board_diag_oledDisplay_INCLUDE = $(board_diag_oledDisplay_PATH)
+board_diag_oledDisplay_BOARDLIST = am64x_evm
+board_diag_oledDisplay_$(SOC)_CORELIST = $(board_diag_$(SOC)_CORELIST)
+export board_diag_oledDisplay_$(SOC)_CORELIST
+export board_diag_oledDisplay_SBL_APPIMAGEGEN = $(board_diag_APPIMAGEGEN_CTRL)
+board_diag_EXAMPLE_LIST += board_diag_oledDisplay
+
 # OSPI
 board_diag_ospi_COMP_LIST = board_diag_ospi
 board_diag_ospi_RELPATH = ti/board/diag/ospi/build
diff --git a/packages/ti/board/diag/oled_display/build/makefile b/packages/ti/board/diag/oled_display/build/makefile
new file mode 100755 (executable)
index 0000000..6382667
--- /dev/null
@@ -0,0 +1,109 @@
+# Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/\r
+#\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
+# Macro definitions referenced below\r
+#\r
+\r
+#\r
+# This file is the makefile for building CSL uart app.\r
+#\r
+include $(PDK_INSTALL_PATH)/ti/build/Rules.make\r
+\r
+# Board diag parameters which can be controlled outside this makefile\r
+DIAGNAME ?= oledDisplay\r
+PROFILE ?= release\r
+TESTMODE ?= FUNCTIONAL_TEST\r
+MODENAME ?=\r
+BOARD_DIAG_CFLAGS ?=\r
+APP_NAME ?= board_diag_$(DIAGNAME)\r
+\r
+BUILD_PROFILE_$(CORE) = $(PROFILE)\r
+\r
+BUILD_OS_TYPE = baremetal\r
+LNKFLAGS_LOCAL_mpu1_0  += --entry Entry\r
+EXTERNAL_INTERFACES =\r
+XDC_CFG_FILE_mpu1_0 =\r
+XDC_CFG_FILE_mcu1_0 =\r
+\r
+ifeq ($(MODENAME), )\r
+ifeq ($(TESTMODE), STRESS_TEST)\r
+MODENAME = Stress\r
+endif\r
+endif\r
+\r
+SRCDIR = ../src ../../common/$(SOC) ./$(BOARD)\r
+INCDIR = ../../../../board ../src ../../../src/$(BOARD)/include ../../../src/$(BOARD) ../../../src/flash ../../common/$(SOC) ../../../../csl\r
+\r
+# List all the external components/interfaces, whose interface header files\r
+# need to be included for this component\r
+INCLUDE_EXTERNAL_INTERFACES = pdk\r
+\r
+# List all the components required by the application\r
+COMP_LIST_COMMON = $(PDK_COMMON_BAREMETAL_COMP)\r
+ifeq ($(SOC), $(filter $(SOC), am64x))\r
+COMP_LIST_COMMON += sciclient\r
+endif\r
+\r
+\r
+# Common source files and CFLAGS across all platforms and cores\r
+#PACKAGE_SRCS_COMMON = ../src makefile\r
+PACKAGE_SRCS_COMMON = ../src makefile\r
+PACKAGE_SRCS_COMMON += ../../common/$(SOC)\r
+PACKAGE_SRCS_COMMON += ../../board_diag_component.mk\r
+PACKAGE_SRCS_COMMON += ../../create_sd.bat ../../create_sd.sh\r
+\r
+SRCS_COMMON += oled_display.c icek2g_oled.c diag_common_cfg.c\r
+\r
+ifeq ($(CORE),$(filter $(CORE), mcu1_0))\r
+SRCS_ASM_COMMON += diag_entry_r5.asm\r
+EXTERNAL_LNKCMD_FILE_LOCAL = ../../common/$(SOC)/linker_$(CORE).lds\r
+endif\r
+\r
+ifeq ($(CORE),$(filter $(CORE), mpu1_0))\r
+SRCS_ASM_COMMON += diag_entry.asm\r
+EXTERNAL_LNKCMD_FILE_LOCAL = ../../common/$(SOC)/linker_$(CORE).lds\r
+endif\r
+\r
+CFLAGS_LOCAL_COMMON = $(PDK_CFLAGS) -DDIAG_$(TESTMODE) $(BOARD_DIAG_CFLAGS)\r
+\r
+# Include common make files\r
+ifeq ($(MAKERULEDIR), )\r
+#Makerule path not defined, define this and assume relative path from ROOTDIR\r
+  MAKERULEDIR := $(ROOTDIR)/ti/build/makerules\r
+  export MAKERULEDIR\r
+endif\r
+include $(MAKERULEDIR)/common.mk\r
+\r
+# OBJs and libraries are built by using rule defined in rules_<target>.mk\r
+#     and need not be explicitly specified here\r
+\r
+# Nothing beyond this point\r
old mode 100644 (file)
new mode 100755 (executable)
index ffa562f..c33e676
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Texas Instruments Incorporated
+ * Copyright (c) 2016-2020, Texas Instruments Incorporated
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -37,6 +37,9 @@
  *
  * \brief This contains specific oled functions.
  *
+ *  Supported SoCs : K2G & AM64X
+ *
+ *  Supported Platforms: k2g_ice & am64x_evm.
  ******************************************************************************/
 
 #include "icek2g_oled.h"
@@ -44,7 +47,7 @@
 #include <ti/drv/i2c/soc/I2C_soc.h>
 #include <ti/drv/uart/UART_stdio.h>
 
-#ifdef SOC_K2G
+#if defined(SOC_K2G) || defined(SOC_AM64X)
 #include "diag_common_cfg.h"
 #endif
 
old mode 100644 (file)
new mode 100755 (executable)
index 9c24b66..9f9fa5b
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Texas Instruments Incorporated
+ * Copyright (c) 2016-2020, Texas Instruments Incorporated
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  *
  * \brief This file contains oled display test functions.
  *
+ *  Supported SoCs : K2G & AM64X
+ *
+ *  Supported Platforms: k2g_ice & am64x_evm.
+ *
  ******************************************************************************/
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
+#if !defined(SOC_AM64X)
 #include <ti/drv/gpio/GPIO.h>
 #include <ti/drv/gpio/soc/GPIO_soc.h>
+#endif
 
 #include <ti/drv/i2c/I2C.h>
 #include <ti/drv/i2c/soc/I2C_soc.h>
 #include <ti/drv/uart/UART_stdio.h>
 
-#ifdef SOC_K2G
+#if defined(SOC_K2G) || defined(SOC_AM64X)
 #include "diag_common_cfg.h"
 #endif
 
 #include "oled_display.h"
 #include "icek2g_oled.h"
 
+#if defined(SOC_AM64X)
+#include <ti/drv/i2c/I2C.h>
+#include <ti/drv/i2c/soc/I2C_soc.h>
+#include "board_internal.h"
+#include "board_i2c_io_exp.h"
+
+/* Platform test return codes */
+#define TEST_PASS     (0)
+#define TEST_FAIL     (-1)
+
+#endif
+
+#if !defined(SOC_AM64X)
 /* GPIO pin value definitions */
 #define GPIO_PIN_VAL_LOW     (0U)
 #define GPIO_PIN_VAL_HIGH    (1U)
    Bits 7-0: Pin number  and Bits 15-8: Port number */
 #define LCD_BST_CONV_CTL_GPIO    0x002D
 #define LCD_RESET                0x0134
+#endif
 
 extern I2C_config_list I2C_config;
+
+#if !defined(SOC_AM64X)
 extern void BOARD_delay(uint32_t usecs);
 
 /* GPIO Driver board specific pin configuration structure */
@@ -92,6 +114,7 @@ GPIO_v0_Config GPIO_v0_config = {
     0,
 };
 
+#endif
 /**
  *  \brief    This function executes oled display detection test
  *
@@ -152,6 +175,7 @@ static TEST_STATUS oled_display_detect_test(void)
     return (TEST_PASS);
 }
 
+#if !defined(SOC_AM64X)
 /**
  * \brief      This function configures voltage regulator gpio's for lcd
  *
@@ -174,6 +198,7 @@ static TEST_STATUS lcd_gpio_config(void)
 
        return (TEST_PASS);
 }
+#endif
 
 /**
  *  \brief    This function is used to perform Oled display detection
@@ -190,6 +215,7 @@ static TEST_STATUS run_oled_display_test(void)
        OLED_RET retVal;
        TEST_STATUS testStatus;
 
+#if !defined(SOC_AM64X)
        GPIO_init();
 
        testStatus = lcd_gpio_config();
@@ -198,6 +224,7 @@ static TEST_STATUS run_oled_display_test(void)
                UART_printf("\n gpio_config Failed\n");
                return (testStatus);
        }
+#endif
 
     UART_printf("\nRunning Oled display Detect Test\n");
 
@@ -332,7 +359,10 @@ static TEST_STATUS run_oled_display_test(void)
                return TEST_FAIL;
        }
 
+#if !defined(SOC_AM64X)
     return (testStatus);
+#endif
+
 }
 
 /**
@@ -354,8 +384,38 @@ TEST_STATUS oledTest(void)
        UART_printf(  "********************************\n");
 
        //Release OLED reset
+#if defined(SOC_AM64X)
+    Board_I2cInitCfg_t i2cCfg;
+
+#if !defined (__aarch64__)
+    /* MCU I2C instance will be active by default for R5 core.
+     * Need update HW attrs to enable MAIN I2C instance.
+     */
+    enableMAINI2C(1, CSL_I2C1_CFG_BASE);
+#endif
+
+    i2cCfg.i2cInst   = BOARD_I2C_IOEXP_DEVICE1_INSTANCE;
+    i2cCfg.socDomain = BOARD_SOC_DOMAIN_MAIN;
+    Board_setI2cInitConfig(&i2cCfg);
+
+    Board_i2cIoExpInit();
+       Board_i2cIoExpSetPinDirection(BOARD_I2C_IOEXP_DEVICE1_ADDR,
+                                  THREE_PORT_IOEXP,
+                                  PORTNUM_1,
+                                  PIN_NUM_6,
+                                  PIN_DIRECTION_OUTPUT);
+
+    /* Pulling GPIO_OLED_RESETn pin to high for accessing the INA devices */
+    Board_i2cIoExpPinLevelSet(BOARD_I2C_IOEXP_DEVICE1_ADDR,
+                              THREE_PORT_IOEXP,
+                              PORTNUM_1,
+                              PIN_NUM_6,
+                              (i2cIoExpSignalLevel_t) GPIO_SIGNAL_LEVEL_HIGH);
+
+#else
        GPIO_init();
        GPIO_write(0, 1);
+#endif
 
        testStatus = run_oled_display_test();
        if(testStatus != 0)
@@ -370,6 +430,10 @@ TEST_STATUS oledTest(void)
        UART_printf("\nOled Tests Completed!!\n");
        UART_printf("\n-----------------X-----------------\n\n\n");
 
+#if defined(SOC_AM64X)
+    Board_i2cIoExpDeInit();
+#endif
+
        return (testStatus);
 
 } // oledTest
old mode 100644 (file)
new mode 100755 (executable)
index cc4c1ba..3f4c43e
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Texas Instruments Incorporated
+ * Copyright (c) 2016-2020, Texas Instruments Incorporated
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 
 #include "board_cfg.h"
 
+#if defined(SOC_AM64X)
+/* Platform test return type */
+typedef        int16_t TEST_STATUS;
+#endif
+
 /**
  * \brief This function performs oled test
  *
index 2d65c8487de9ea3d91c2eaee04f4a78fb62ded87..dcda0a0d5e82a0d8a485df3781c2e47efc71c374 100644 (file)
@@ -275,6 +275,9 @@ extern "C" {
 \r
 #define BOARD_I2C_CURRENT_MONITOR_INSTANCE              (2U)\r
 \r
+/* I2C instance connected to OLED DISPLAY */\r
+#define BOARD_OLED_DISPLAY_INSTANCE                     (1)\r
+\r
 /* Instance for interfaces connected to MMCSD */\r
 #define BOARD_MMCSD_SD_INSTANCE                         (1U)\r
 #define BOARD_MMCSD_EMMC_INSTANCE                       (0)\r
index 70f09e40ecb99bb9ec380c9d4ddfe3847f9fb3c8..7df311b632d891185e4894af5baaa63fa1eac550 100644 (file)
@@ -80,7 +80,7 @@ extern "C" {
 /*****************************************************************************\r
  * Internal Objects                                                          *\r
  *****************************************************************************/\r
-extern const I2C_Config I2C_config[];\r
+extern I2C_config_list I2C_config;\r
 \r
 typedef struct\r
 {\r