summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorGerrit Code Review <gerrit2@git-master.nvidia.com>2010-01-14 04:44:52 +0200
committerGerrit Code Review <gerrit2@git-master.nvidia.com>2010-01-14 04:44:52 +0200
commit33ec60d5a673c2a8ae781c19934d4e8968f0c4a6 (patch)
treebd91e285dc0775b9cc781d7d1752611290a4835f /arch/arm
parent285113eb1fc922c8ac05517d54ea76bfb61f5e74 (diff)
parent96f636d3ea8d4d773e6ce52b5437d3fcfdb95509 (diff)
Merge change I1eda05f2 into android-tegra-2.6.29
* changes: tegra spi: Removing the unused api for multipletransfer
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-tegra/include/rm_spi_slink.h10
-rw-r--r--arch/arm/mach-tegra/nvrm/io/ap15/rm_spi_slink.c143
2 files changed, 0 insertions, 153 deletions
diff --git a/arch/arm/mach-tegra/include/rm_spi_slink.h b/arch/arm/mach-tegra/include/rm_spi_slink.h
index 3147c58ed707..61714a1333c6 100644
--- a/arch/arm/mach-tegra/include/rm_spi_slink.h
+++ b/arch/arm/mach-tegra/include/rm_spi_slink.h
@@ -52,15 +52,5 @@ void NvRmSpiMultipleTransactions(
NvRmSpiTransactionInfo *t,
NvU32 NumOfTransactions);
-void NvRmSpiOptimizedMultipleTransactions(
- NvRmSpiHandle hRmSpi,
- NvU32 SpiPinMap,
- NvU32 ChipSelectId,
- NvU32 ClockSpeedInKHz,
- NvU32 PacketSizeInBits,
- NvRmSpiTransactionInfo *t,
- NvU32 NumOfTransactions);
-
-
#endif // INCLUDED_RM_SPI_SLINK_H
diff --git a/arch/arm/mach-tegra/nvrm/io/ap15/rm_spi_slink.c b/arch/arm/mach-tegra/nvrm/io/ap15/rm_spi_slink.c
index a78c29c4900a..ea67d79cd4d1 100644
--- a/arch/arm/mach-tegra/nvrm/io/ap15/rm_spi_slink.c
+++ b/arch/arm/mach-tegra/nvrm/io/ap15/rm_spi_slink.c
@@ -2539,149 +2539,6 @@ cleanup:
NV_ASSERT(Error == NvSuccess);
}
-/*
- * EXPERIMENTAL: A hack has been added so as to improve the performance of ethernet.
- * It is still experimental and will be done in a clean way once it is stable.
- * This is an optimized version of function NvRmSpiMultipleTransactions.
- * A separate function has been added instead of modifying an existing one since
- * that would break the compatibility with other builds.
- * Now it will power on the spi controller only in the beginning rather than doing
- * it on every packet transfer.
- */
-
-void NvRmSpiOptimizedMultipleTransactions(
- NvRmSpiHandle hRmSpi,
- NvU32 SpiPinMap,
- NvU32 ChipSelectId,
- NvU32 ClockSpeedInKHz,
- NvU32 PacketSizeInBits,
- NvRmSpiTransactionInfo *t,
- NvU32 NumOfTransactions)
-{
- NvError Error = NvSuccess;
- NvBool IsPackedMode;
- NvU32 BytesPerPacket;
- NvU32 PacketsTransferred;
- NvU32 PacketsPerWord;
- NvU32 TotalPacketsRequsted;
- NvU32 TotalWordsRequested;
- NvU32 i;
-
- NV_ASSERT(hRmSpi);
- NV_ASSERT((PacketSizeInBits > 0) && (PacketSizeInBits <= 32));
- NV_ASSERT(hRmSpi->IsMasterMode);
-
- // Chip select should be supported by the odm.
- NV_ASSERT(hRmSpi->IsChipSelSupported[ChipSelectId]);
-
- // Proper spi pin map if it is multiplexed otherwise 0.
- NV_ASSERT(((SpiPinMap) && (hRmSpi->SpiPinMap == NvOdmSpiPinMap_Multiplexed)) ||
- ((!SpiPinMap) && (hRmSpi->SpiPinMap != NvOdmSpiPinMap_Multiplexed)));
-
- // Select Packed mode for the 8/16 bit length.
- IsPackedMode = ((PacketSizeInBits == 8) || ((PacketSizeInBits == 16)));
- PacketsPerWord = (IsPackedMode) ? (PacketSizeInBits >> 3) : 1;
- BytesPerPacket = (PacketSizeInBits + 7)/8;
-
-
- // Lock the channel access by other client till this client finishes the ops
- NvOsMutexLock(hRmSpi->hChannelAccessMutex);
-
- hRmSpi->CurrTransferChipSelId = ChipSelectId;
-
- // Enable Power/Clock.
- Error = SetPowerControl(hRmSpi, NV_TRUE);
- if (Error != NvSuccess)
- goto cleanup;
-
- if (SpiPinMap)
- {
- NvRmPinMuxConfigSelect(hRmSpi->hDevice,hRmSpi->RmIoModuleId,
- hRmSpi->InstanceId, SpiPinMap);
- NvRmPinMuxConfigSetTristate(hRmSpi->hDevice,hRmSpi->RmIoModuleId,
- hRmSpi->InstanceId, SpiPinMap, NV_FALSE);
- }
- else
- {
- if (hRmSpi->IsIdleSignalTristate)
- NvRmPinMuxConfigSetTristate(hRmSpi->hDevice,hRmSpi->RmIoModuleId,
- hRmSpi->InstanceId, hRmSpi->SpiPinMap, NV_FALSE);
- }
-
- hRmSpi->CurrTransInfo.PacketsPerWord = PacketsPerWord;
- if (!Error)
- Error = SetChipSelectSignalLevel(hRmSpi, ChipSelectId, ClockSpeedInKHz,
- NV_TRUE, NV_TRUE);
- if (Error)
- goto cleanup;
-
- hRmSpi->hHwInterface->HwSetPacketLengthFxn(&hRmSpi->HwRegs,
- PacketSizeInBits, IsPackedMode);
-
- for (i=0; i< NumOfTransactions; i++, t++)
- {
- if (!((t->rxBuffer || t->txBuffer) && t->len))
- continue;
-
- hRmSpi->CurrTransInfo.pRxBuff = NULL;
- hRmSpi->CurrTransInfo.RxPacketsRemaining = 0;
- hRmSpi->CurrTransInfo.pTxBuff = NULL;
- hRmSpi->CurrTransInfo.TxPacketsRemaining = 0;
-
-
- /* If not packed mode, packet == word */
- TotalPacketsRequsted = t->len/BytesPerPacket;
- TotalWordsRequested = (TotalPacketsRequsted + PacketsPerWord -1)/PacketsPerWord;
- NV_ASSERT((t->len % BytesPerPacket) == 0);
- NV_ASSERT(TotalPacketsRequsted);
-
- hRmSpi->CurrentDirection = SerialHwDataFlow_None;
- if (t->txBuffer)
- hRmSpi->CurrentDirection |= SerialHwDataFlow_Tx;
- if (t->rxBuffer)
- hRmSpi->CurrentDirection |= SerialHwDataFlow_Rx;
- hRmSpi->hHwInterface->HwSetDataFlowFxn(&hRmSpi->HwRegs,
- hRmSpi->CurrentDirection, NV_TRUE);
-
- if ((!hRmSpi->IsApbDmaAllocated) ||
- (TotalWordsRequested <= hRmSpi->HwRegs.MaxWordTransfer))
- {
- Error = MasterModeReadWriteCpu(hRmSpi, t->rxBuffer, t->txBuffer,
- TotalPacketsRequsted, &PacketsTransferred,
- IsPackedMode, PacketSizeInBits);
- }
- else
- {
- Error = MasterModeReadWriteDma(hRmSpi, t->rxBuffer, t->txBuffer,
- TotalPacketsRequsted, &PacketsTransferred,
- IsPackedMode, PacketSizeInBits);
- }
- hRmSpi->hHwInterface->HwSetDataFlowFxn(&hRmSpi->HwRegs,
- hRmSpi->CurrentDirection, NV_FALSE);
- }
- hRmSpi->CurrentDirection = SerialHwDataFlow_None;
- (void)SetChipSelectSignalLevel(hRmSpi, ChipSelectId, ClockSpeedInKHz, NV_FALSE, NV_TRUE);
-
-cleanup:
- // Re-tristate multi-plexed controllers, and re-multiplex the controller.
- if (SpiPinMap)
- {
- NvRmPinMuxConfigSetTristate(hRmSpi->hDevice,hRmSpi->RmIoModuleId,
- hRmSpi->InstanceId, SpiPinMap, NV_TRUE);
-
- NvRmPinMuxConfigSelect(hRmSpi->hDevice,hRmSpi->RmIoModuleId,
- hRmSpi->InstanceId, hRmSpi->SpiPinMap);
- }
- else
- {
- if (hRmSpi->IsIdleSignalTristate)
- NvRmPinMuxConfigSetTristate(hRmSpi->hDevice,hRmSpi->RmIoModuleId,
- hRmSpi->InstanceId, hRmSpi->SpiPinMap, NV_TRUE);
- }
- SetPowerControl(hRmSpi, NV_FALSE);
- NvOsMutexUnlock(hRmSpi->hChannelAccessMutex);
- NV_ASSERT(Error == NvSuccess);
-}
/**
* Perform the data transfer.
*/