summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 269f059)
raw | patch | inline | side by side (parent: 269f059)
author | Hao Zhang <hzhang@ti.com> | |
Fri, 19 Jun 2020 18:09:24 +0000 (14:09 -0400) | ||
committer | Hao Zhang <hzhang@ti.com> | |
Mon, 22 Jun 2020 21:39:49 +0000 (16:39 -0500) |
Send reset command to flash after disabling/enabling the OSPI
controller. This is a workaround to address the Synopsis flash model
reset issue on Zebu.
Signed-off-by: Hao Zhang <hzhang@ti.com>
controller. This is a workaround to address the Synopsis flash model
reset issue on Zebu.
Signed-off-by: Hao Zhang <hzhang@ti.com>
diff --git a/packages/ti/board/src/flash/nor/ospi/nor_ospi.c b/packages/ti/board/src/flash/nor/ospi/nor_ospi.c
index 56a778f87f975dea1a221845fea88e61675f3669..925f3ec158029f501e448125aa1ba643b21b944e 100755 (executable)
OSPI_socGetInitCfg(portNum, &ospi_cfg);\r
if (ospi_cfg.xferLines == OSPI_XFER_LINES_OCTAL)\r
{\r
+#if defined (VLAB_SIM)\r
+ /* workaround to reset memory for Zebu */\r
+ ospi_cfg.xferLines = OSPI_XFER_LINES_SINGLE;\r
+ OSPI_socSetInitCfg(portNum, &ospi_cfg);\r
+ Nor_ospiSetOpcode(hwHandle);\r
+ Nor_ospiResetMemory(hwHandle);\r
+ ospi_cfg.xferLines = OSPI_XFER_LINES_OCTAL;\r
+ OSPI_socSetInitCfg(portNum, &ospi_cfg);\r
+ Nor_ospiSetOpcode(hwHandle);\r
+#endif\r
+\r
/* Enable DDR or SDR mode for Octal lines */\r
if (ospi_cfg.dtrEnable == true)\r
{\r
index 69213a76cd5e1c9b1c992df848c7188808966ac1..43410346cd0b895fe7d386ccf4e1fcb6b10c8989 100644 (file)
.bootCode : {} palign(8) > MSMC3
.startupCode : {} palign(8) > MSMC3
.startupData : {} palign(8) > MSMC3, type = NOINIT
- .text : {} palign(8) > DDR0
- .const : {} palign(8) > DDR0
- .cinit : {} palign(8) > DDR0
- .pinit : {} palign(8) > DDR0
- .bss : {} align(4) > DDR0
- .far : {} align(4) > DDR0
- .data : {} palign(128) > DDR0
- .boardcfg_data : {} palign(128) > DDR0
- .sysmem : {} > DDR0
- .data_buffer : {} palign(128) > DDR0
+ .text : {} palign(8) > MSMC3
+ .const : {} palign(8) > MSMC3
+ .cinit : {} palign(8) > MSMC3
+ .pinit : {} palign(8) > MSMC3
+ .bss : {} align(4) > MSMC3
+ .far : {} align(4) > MSMC3
+ .data : {} palign(128) > MSMC3
+ .boardcfg_data : {} palign(128) > MSMC3
+ .sysmem : {} > MSMC3
+ .data_buffer : {} palign(128) > MSMC3
/* USB or any other LLD buffer for benchmarking */
- .benchmark_buffer (NOLOAD) {} ALIGN (8) > DDR0
+ .benchmark_buffer (NOLOAD) {} ALIGN (8) > MSMC3
- .stack : {} align(4) > DDR0 (HIGH)
- .irqStack : {. = . + __IRQ_STACK_SIZE;} align(4) > DDR0 (HIGH)
+ .stack : {} align(4) > MSMC3 (HIGH)
+ .irqStack : {. = . + __IRQ_STACK_SIZE;} align(4) > MSMC3 (HIGH)
RUN_START(__IRQ_STACK_START)
RUN_END(__IRQ_STACK_END)
- .fiqStack : {. = . + __FIQ_STACK_SIZE;} align(4) > DDR0 (HIGH)
+ .fiqStack : {. = . + __FIQ_STACK_SIZE;} align(4) > MSMC3 (HIGH)
RUN_START(__FIQ_STACK_START)
RUN_END(__FIQ_STACK_END)
- .abortStack : {. = . + __ABORT_STACK_SIZE;} align(4) > DDR0 (HIGH)
+ .abortStack : {. = . + __ABORT_STACK_SIZE;} align(4) > MSMC3 (HIGH)
RUN_START(__ABORT_STACK_START)
RUN_END(__ABORT_STACK_END)
- .undStack : {. = . + __UND_STACK_SIZE;} align(4) > DDR0 (HIGH)
+ .undStack : {. = . + __UND_STACK_SIZE;} align(4) > MSMC3 (HIGH)
RUN_START(__UND_STACK_START)
RUN_END(__UND_STACK_END)
- .svcStack : {. = . + __SVC_STACK_SIZE;} align(4) > DDR0 (HIGH)
+ .svcStack : {. = . + __SVC_STACK_SIZE;} align(4) > MSMC3 (HIGH)
RUN_START(__SVC_STACK_START)
RUN_END(__SVC_STACK_END)
}
index 102a75f2bb92c880235903dc39a49af2b1cb6572..8e2e410f1b95af9ec7b9e248f8fe995db12568d4 100644 (file)
@@ -1596,7 +1596,19 @@ static int32_t OSPI_control_v0(SPI_Handle handle, uint32_t cmd, const void *arg)
case SPI_V0_CMD_SET_XFER_LINES:
{
+ uint32_t numAddrBytes;
object->xferLines = *ctrlData;
+ numAddrBytes = CSL_OSPI_MEM_MAP_NUM_ADDR_BYTES_3;
+ if ((object->xferLines == OSPI_XFER_LINES_OCTAL) && (hwAttrs->dtrEnable))
+ {
+ numAddrBytes = CSL_OSPI_MEM_MAP_NUM_ADDR_BYTES_4;
+ }
+
+ /* Set device size cofigurations */
+ CSL_ospiSetDevSize((const CSL_ospi_flash_cfgRegs *)(hwAttrs->baseAddr),
+ numAddrBytes,
+ hwAttrs->pageSize,
+ hwAttrs->blkSize);
retVal = SPI_STATUS_SUCCESS;
break;
}
diff --git a/packages/ti/drv/spi/test/ospi_flash/src/main_ospi_flash_test.c b/packages/ti/drv/spi/test/ospi_flash/src/main_ospi_flash_test.c
index f2d76246501bc97f8955f02221885c5e550d4d4c..a4fcc70eff52f5284f8510ae51e59b1a0a81c702 100644 (file)
/**********************************************************************
************************** Macros ************************************
**********************************************************************/
-#define OSPI_PROFILE /* Enable profiling */
+//#define OSPI_PROFILE /* Enable profiling */
#define OSPI_WRITE /* Enable write */
static bool OSPI_flash_test(void *arg)
{
Board_flashHandle boardHandle;
- Board_FlashInfo *flashInfo;
+ //Board_FlashInfo *flashInfo;
#ifdef OSPI_WRITE
uint32_t blockNum; /* flash block number */
uint32_t pageNum; /* flash page number */
if (!boardHandle)
{
- SPI_log("\n Board_flashOpen failed. \n");
+ //SPI_log("\n Board_flashOpen failed. \n");
testPassed = false;
goto err;
}
else
{
- flashInfo = (Board_FlashInfo *)boardHandle;
- SPI_log("\n OSPI NOR device ID: 0x%x, manufacturer ID: 0x%x \n",
- flashInfo->device_id, flashInfo->manufacturer_id);
+ //flashInfo = (Board_FlashInfo *)boardHandle;
+ //SPI_log("\n OSPI NOR device ID: 0x%x, manufacturer ID: 0x%x \n",
+ // flashInfo->device_id, flashInfo->manufacturer_id);
}
/* Generate the data */
goto err;
}
}
-
+ if (*((uint32_t *)0x60000000) != 0xffffffff)
+ {
+ printf("\nerase failed!\n");
+ while(1);
+ }
#ifdef OSPI_PROFILE
#ifdef USE_BIOS
Load_reset( );
if (Board_flashRead(boardHandle, offset, &rxBuf[i],
xferLen, (void *)(&ioMode)))
{
- SPI_log("\n Board_flashRead failed. \n");
+ //SPI_log("\n Board_flashRead failed. \n");
testPassed = false;
goto err;
}
break;
}
- OSPI_configClk(test->clk, true);
+ //OSPI_configClk(test->clk, true);
- OSPI_test_print_test_desc(test);
+ //OSPI_test_print_test_desc(test);
if (test->testFunc((void *)test) == true)
{
Task_Handle task;
Error_Block eb;
#endif
- boardCfg = BOARD_INIT_PINMUX_CONFIG |
- BOARD_INIT_MODULE_CLOCK |
- BOARD_INIT_UART_STDIO;
+ boardCfg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_UART_STDIO;
+ /*BOARD_INIT_MODULE_CLOCK |
+ BOARD_INIT_UART_STDIO;*/
Board_init(boardCfg);