summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 32c6da0)
raw | patch | inline | side by side (parent: 32c6da0)
author | Lohith Kumar <l-kumar@ti.com> | |
Wed, 25 Jan 2023 12:29:11 +0000 (17:59 +0530) | ||
committer | Rishabh Garg <rishabh@ti.com> | |
Sat, 28 Jan 2023 04:34:22 +0000 (22:34 -0600) |
Currrently MCSPI dma transfers resticted to 32 bit address space,
since the txBuf/rxBuf is void*, converting it to uint64_t to support
transfers upto 48 bit.
Fixes: PDK-12258
Signed-off-by: Lohith Kumar <l-kumar@ti.com>
since the txBuf/rxBuf is void*, converting it to uint64_t to support
transfers upto 48 bit.
Fixes: PDK-12258
Signed-off-by: Lohith Kumar <l-kumar@ti.com>
index 6e1dc2b1a6b90dc430a7fc9d04599ae7ed1f9138..30a03b05e4e9c4c66d8a5f77fd4db62d166ce33d 100644 (file)
/*
- * Copyright (c) 2014-2015, Texas Instruments Incorporated
+ * Copyright (c) 2014-2023, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
typedef struct SPI_Transaction_s {
/* User input (write-only) fields */
size_t count; /*!< Number of frames for this transaction */
- void *txBuf; /*!< void * to a buffer with data to be transmitted */
- void *rxBuf; /*!< void * to a buffer to receive data */
+ uint64_t txDmaBuf; /*!< Pointer to a buffer with data to be transmitted */
+ uint64_t rxDmaBuf; /*!< Pointer to a buffer to receive data */
+ void *txBuf; /*!< Pointer to a buffer with data to be transmitted */
+ void *rxBuf; /*!< Pointer to a buffer to receive data */
void *arg; /*!< Argument to be passed to the callback function */
/* User output (read-only) fields */
diff --git a/packages/ti/drv/spi/example/mcspi_slavemode/src/main_mcspi_slave_mode.c b/packages/ti/drv/spi/example/mcspi_slavemode/src/main_mcspi_slave_mode.c
index 932a7f1184a71e17c23d8300a29e7f465786ce0f..cac0742e0fa21e806f5c57823a59f0da3ef4c657 100755 (executable)
*/
/*
- * Copyright (C) 2016 - 2020 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2016 - 2023 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
@@ -906,19 +906,43 @@ static bool SPI_test_mst_slv_xfer(void *spi, SPI_Tests *test, uint32_t xferLen,
{
if ((testId == SPI_TEST_ID_CB_CANCEL) || (testId == SPI_TEST_ID_DMA_CB_CANCEL))
{
- transaction.txBuf = (void *)addrCancelTxBuff;
- transaction.rxBuf = (void *)addrCancelRxBuff;
+ if (dmaMode == true)
+ {
+ transaction.txDmaBuf = (uint64_t)addrCancelTxBuff;
+ transaction.rxDmaBuf = (uint64_t)addrCancelRxBuff;
+ }
+ else
+ {
+ transaction.txBuf = (void *)addrCancelTxBuff;
+ transaction.rxBuf = (void *)addrCancelRxBuff;
+ }
}
else
{
- transaction.txBuf = (void *)addrMasterTxBuf;
- transaction.rxBuf = (void *)addrMasterRxBuf;
+ if (dmaMode == true)
+ {
+ transaction.txDmaBuf = (uint64_t)addrMasterTxBuf;
+ transaction.rxDmaBuf = (uint64_t)addrMasterRxBuf;
+ }
+ else
+ {
+ transaction.txBuf = (void *)addrMasterTxBuf;
+ transaction.rxBuf = (void *)addrMasterRxBuf;
+ }
}
}
else
{
- transaction.txBuf = (void *)addrSlaveTxBuf;
- transaction.rxBuf = (void *)addrSlaveRxBuf;
+ if (dmaMode == true)
+ {
+ transaction.txDmaBuf = (uint64_t)addrSlaveTxBuf;
+ transaction.rxDmaBuf = (uint64_t)addrSlaveRxBuf;
+ }
+ else
+ {
+ transaction.txBuf = (void *)addrSlaveTxBuf;
+ transaction.rxBuf = (void *)addrSlaveRxBuf;
+ }
}
/* Initiate SPI transfer */
index 8c82b8f774065fe3bca60260ad398e8daae2788f..ce8bc05c489a24bc54dc225903e754eaa765e427 100755 (executable)
*/
/*
- * Copyright (c) 2017 - 2020, Texas Instruments Incorporated
+ * Copyright (c) 2017 - 2023, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
static void MCSPI_udmaHpdInit(Udma_ChHandle chHandle,
uint8_t *pHpdMem,
- const void *bufPtr,
+ uint64_t bufPtr,
uint32_t length)
{
CSL_UdmapCppi5HMPD *pHpd = (CSL_UdmapCppi5HMPD *) pHpdMem;
}
static int32_t MCSPI_dmaTx(MCSPI_Handle mcHandle,
- const void *srcBuf,
+ uint64_t srcBuf,
uint32_t length)
{
int32_t retVal;
}
static int32_t MCSPI_dmaRx(MCSPI_Handle mcHandle,
- const void *destBuf,
+ uint64_t destBuf,
uint32_t length)
{
int32_t retVal;
transBytes = (uint32_t)transaction->count << chObj->wordLenShift;
if (chnCfg->trMode == MCSPI_TX_RX_MODE)
{
- (void)MCSPI_dmaRx(mcHandle, (const void *)transaction->rxBuf, transBytes);
- (void)MCSPI_dmaTx(mcHandle, (const void *)transaction->txBuf, transBytes);
+ (void)MCSPI_dmaRx(mcHandle, transaction->rxDmaBuf, transBytes);
+ (void)MCSPI_dmaTx(mcHandle, transaction->txDmaBuf, transBytes);
}
else if (chnCfg->trMode == MCSPI_TX_ONLY_MODE)
{
/* TX_ONLY Mode */
- (void)MCSPI_dmaTx(mcHandle, (const void *)transaction->txBuf, transBytes);
+ (void)MCSPI_dmaTx(mcHandle, transaction->txDmaBuf, transBytes);
}
else
{
/* RX_ONLY Mode */
- (void)MCSPI_dmaRx(mcHandle, (const void *)transaction->rxBuf, transBytes);
+ (void)MCSPI_dmaRx(mcHandle, transaction->rxDmaBuf, transBytes);
}
}