diff options
author | Gary King <gking@nvidia.com> | 2010-09-01 13:13:45 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2010-10-13 14:17:54 -0700 |
commit | 0a7b64e6dfc16de42b63c6eea32c0a1e0feba18b (patch) | |
tree | f10b6d2aa56134f5c9cb78179ef31a4f2664b6fd | |
parent | c0a15691155a1a97404b869ac83111b397aaff75 (diff) |
[ARM] tegra: nvrm_transport: send address message after AVP init
rather than storing the address message in the mailbox when the shared
message memory is allocated during kernel init, send the message after
the AVP is initialized.
this prevents the message from being "lost" if the system enters LP0
before initializing the AVP.
Change-Id: I14634e2a53abacf840ed906451f1a07016a99015
Signed-off-by: Gary King <gking@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_moduleloader.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_transport.c | 8 |
2 files changed, 13 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_moduleloader.c b/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_moduleloader.c index f15c90e79a8b..22241b72a70e 100644 --- a/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_moduleloader.c +++ b/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_moduleloader.c @@ -282,14 +282,12 @@ static NvError PrivateOsFopen( if (hFile == NULL) return NvError_InsufficientMemory; - NvOsDebugPrintf("%s <kernel impl>: file=%s\n", __func__, filename); - NvOsDebugPrintf("%s <kernel impl>: calling request_firmware()\n", __func__); + pr_debug("%s <kernel impl>: file=%s\n", __func__, filename); if (request_firmware(&s_FwEntry, filename, nvfw_dev.this_device) != 0) { pr_err("%s: Cannot read firmware '%s'\n", __func__, filename); return NvError_FileReadFailed; } - NvOsDebugPrintf("%s <kernel impl>: back from request_firmware()\n", __func__); hFile->pstart = s_FwEntry->data; hFile->pread = s_FwEntry->data; hFile->pend = s_FwEntry->data + s_FwEntry->size; @@ -316,7 +314,6 @@ NvError NvRmLoadLibrary( NvError Error = NvSuccess; NV_ASSERT(sizeOfArgs <= MAX_ARGS_SIZE); - NvOsDebugPrintf("%s <kernel impl>: file=%s\n", __func__, pLibName); Error = NvRmLoadLibraryEx(hDevice, pLibName, pArgs, sizeOfArgs, NV_FALSE, hLibHandle); return Error; @@ -341,8 +338,6 @@ NvError NvRmLoadLibraryEx( NV_ASSERT(sizeOfArgs <= MAX_ARGS_SIZE); - NvOsDebugPrintf("%s <kernel impl>: file=%s\n", __func__, pLibName); - NV_CHECK_ERROR_CLEANUP(NvRmPrivInitAvp(hDevice)); e = NvRmPrivRPCConnect(s_RPCHandle); @@ -535,6 +530,8 @@ static void NvRmPrivResetAvp(NvRmDeviceHandle hRm, unsigned long reset_va) writel(tmp, _TEGRA_AVP_RESET_VECTOR_ADDR); } +void NvRmPrivXpcSendMsgAddress(void); + static NvError NvRmPrivInitAvp(NvRmDeviceHandle hRm) { u32 *stub_phys = &_tegra_avp_launcher_stub_data[AVP_LAUNCHER_MMU_PHYSICAL]; @@ -573,6 +570,9 @@ static NvError NvRmPrivInitAvp(NvRmDeviceHandle hRm) NvRmPrivResetAvp(hRm, 0x00100000ul); NV_CHECK_ERROR_CLEANUP(NvRmPrivInitService(hRm)); + + NvRmPrivXpcSendMsgAddress(); + e = NvRmPrivInitModuleLoaderRPC(hRm); if (e != NvSuccess) { diff --git a/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_transport.c b/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_transport.c index 8227b9f2ca45..97a669879046 100644 --- a/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_transport.c +++ b/arch/arm/mach-tegra/nv/nvrm/core/common/nvrm_transport.c @@ -611,6 +611,13 @@ RegisterTransportInterrupt(NvRmDeviceHandle hDevice) return NvSuccess; } +void NvRmPrivXpcSendMsgAddress(void) +{ + BUG_ON(!s_TransportInfo.MessageMemPhysAddr); + NvRmPrivXpcSendMessage(s_TransportInfo.hXpc, + s_TransportInfo.MessageMemPhysAddr); +} + // allocate buffers to be used for sending/receiving messages. static void NvRmPrivTransportAllocBuffers(NvRmDeviceHandle hRmDevice) @@ -657,7 +664,6 @@ NvRmPrivTransportAllocBuffers(NvRmDeviceHandle hRmDevice) NvRmMemWr32(hNewMemHandle, 0, 0xdeadf00d); // set this non-zero to throttle messages to the avp till avp is ready. NvRmMemWr32(hNewMemHandle, MAX_MESSAGE_LENGTH + MAX_COMMAND_SIZE, 0); - NvRmPrivXpcSendMessage(s_TransportInfo.hXpc, s_TransportInfo.MessageMemPhysAddr); return; |