ipc/ipcdev.git
18 months agoam65xx: Update Resource type to match sciclient API change master
Sam Nelson [Thu, 2 Apr 2020 11:13:51 +0000 (07:13 -0400)]
am65xx: Update Resource type to match sciclient API change

This type is expected to work with both PG1 and PG2 versions

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
19 months agoRemoteproc: DRA7xx: Fix incorrect DSP HEAP1 address ipc-next 3.51.00.00A
Suman Anna [Wed, 12 Feb 2020 00:33:19 +0000 (18:33 -0600)]
Remoteproc: DRA7xx: Fix incorrect DSP HEAP1 address

Commit 23a7eefaf8e2 ("Remoteproc: DRA7xx: Adjust entries to fix carveout
allocation failures") has split up the single DSP heap at 0x95200000 of
size 3 MB into two chunks of 2 MB and 1 MB. This erroneously used the
address 0x95300000 for the second 1 MB chunk, when it should really be
0x95400000. Fix this properly.

Fixes: 23a7eefaf8e2 ("Remoteproc: DRA7xx: Adjust entries to fix carveout allocation failures")
Signed-off-by: Suman Anna <s-anna@ti.com>
19 months agoam65xx: Pass valid request pointer for Sciclient version check
Angela Stegmaier [Fri, 13 Mar 2020 19:12:35 +0000 (14:12 -0500)]
am65xx: Pass valid request pointer for Sciclient version check

Sciclient now requires request payload to be non-NULL.
This patch updates the payload pointer to be non-NULL value
in order to be able to check the version.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
20 months agoK2: Use FW_RSC_ADDR_ANY for vrings in R5F resource table 3.51.00.00
Sam Nelson [Mon, 20 Jan 2020 19:45:36 +0000 (14:45 -0500)]
K2: Use FW_RSC_ADDR_ANY for vrings in R5F resource table

Mark the vring device addresses as FW_RSC_ADDR_ANY, so that Linux kernel
knows it needs to update these to the actual dynamically allocated
memory locations. The virtqueue driver itself will poll for the
completion status of this update.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
20 months agoVirtQueue: K2: poll for init completion status
Sam Nelson [Mon, 20 Jan 2020 19:44:56 +0000 (14:44 -0500)]
VirtQueue: K2: poll for init completion status

Virtqueue device address is provided by host, so poll the completion
status for this operation before proceeding. Otherwise we end up using
bad virtqueue address.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
20 months agoRemoteproc: AM65XX: Use FW_RSC_ADDR_ANY for vrings in R5F resource table
Sam Nelson [Mon, 20 Jan 2020 19:36:05 +0000 (14:36 -0500)]
Remoteproc: AM65XX: Use FW_RSC_ADDR_ANY for vrings in R5F resource table

Mark the vring device addresses as FW_RSC_ADDR_ANY, so that Linux kernel
knows it needs to update these to the actual dynamically allocated
memory locations. The virtqueue driver itself will poll for the
completion status of this update.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
20 months agoVirtQueue: AM65X: poll for init completion status
Sam Nelson [Mon, 20 Jan 2020 19:26:28 +0000 (14:26 -0500)]
VirtQueue: AM65X: poll for init completion status

Virtqueue device address is provided by host, so poll the completion
status for this operation before proceeding. Otherwise we end up using
bad virtqueue address.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
20 months agoam65xx: Remove dependence on DEVMEM entry
Sam Nelson [Mon, 20 Jan 2020 19:05:09 +0000 (14:05 -0500)]
am65xx: Remove dependence on DEVMEM entry

AM65XX does not have an IOMMU, and currently the DEVMEM entry is used as
a work around.
But in reality the VA and PA are directly mapped and dependence on
DEVMEM to do the address translation need to be removed.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
22 months agoRemoteproc: DRA7xx: Use FW_RSC_ADDR_ANY for vrings in IPU resource table
Tero Kristo [Fri, 13 Dec 2019 11:26:24 +0000 (13:26 +0200)]
Remoteproc: DRA7xx: Use FW_RSC_ADDR_ANY for vrings in IPU resource table

Mark the vring device addresses as FW_RSC_ADDR_ANY, so that Linux kernel
knows it needs to update these to the actual dynamically allocated
memory locations. The virtqueue driver itself will poll for the
completion status of this update.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
22 months agoRemoteproc: DRA7xx: Use FW_RSC_ADDR_ANY for vrings in DSP resource table
Tero Kristo [Fri, 13 Dec 2019 11:23:05 +0000 (13:23 +0200)]
Remoteproc: DRA7xx: Use FW_RSC_ADDR_ANY for vrings in DSP resource table

Mark the vring device addresses as FW_RSC_ADDR_ANY, so that Linux kernel
knows it needs to update these to the actual dynamically allocated
memory locations. The virtqueue driver itself will poll for the
completion status of this update.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
22 months agoVirtQueue: dra7xx: poll for init completion status
Tero Kristo [Fri, 13 Dec 2019 11:21:15 +0000 (13:21 +0200)]
VirtQueue: dra7xx: poll for init completion status

Virtqueue device address is provided by host, so poll the completion
status for this operation before proceeding. Otherwise we end up using
bad virtqueue address.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
23 months agotest_omx: Add null termination to avoid out of bound access 3.50.04.08
Sam Nelson [Mon, 28 Oct 2019 21:30:51 +0000 (17:30 -0400)]
test_omx: Add null termination to avoid out of bound access

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
23 months agosrvmgr: Fix issue with memcopy
Sam Nelson [Mon, 28 Oct 2019 21:30:03 +0000 (17:30 -0400)]
srvmgr: Fix issue with memcopy

Previous fix to avoid the partial copy was wrong. Need to copy only the
task parameters after arg0.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoRemoteproc: DRA7xx: Adjust entries to fix carveout allocation failures
Sam Nelson [Fri, 18 Oct 2019 00:46:54 +0000 (19:46 -0500)]
Remoteproc: DRA7xx: Adjust entries to fix carveout allocation failures

If the linux device tree uses DMA pools for carving out memory for the
slave cores, the DMA pools uses the next power of 2 page order
fitting the requested size (eg: 6 MB gets attempted to be allocated
using 8 MB and at 8 MB alignments), and this may result in allocation
failures if the overall DMA pool size does not have enough room to
support the different RSC_CARVEOUT aligned size.

This adjustment of the entries are updated carefully to make sure the
allocation does not fail due to this alignment. The 1 MB IPC_DATA
carveout entry is placed immediately after the vdev resource so that
the image carveouts are always aligned on an even 2 MB boundary.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
2 years agoRemoteproc: DRA7xx: Drop invalid MEM_IOBUFS devmem entry
Suman Anna [Thu, 19 Sep 2019 19:33:24 +0000 (14:33 -0500)]
Remoteproc: DRA7xx: Drop invalid MEM_IOBUFS devmem entry

The MEM_IOBUFS DEVMEM entry of size 90 MB was a left-over from
OMAP4/OMAP5 code, and this was used to map a static carveout of
the same size at 0xBA300000 address into the DSP and IPU MMUs.
This region is fully owned by the Linux kernel on DRA7xx/AM57xx
SoCs, so it should not be mapped into the IPU and DSP memory space.
Drop these invalid entries from both the IPU & DSP resource tables.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agotest_omx: Update not to fill the whole buffer 3.50.04.07A
Sam Nelson [Wed, 9 Oct 2019 17:41:13 +0000 (13:41 -0400)]
test_omx: Update not to fill the whole buffer

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoSysMin: Fix missed local variable
Sam Nelson [Wed, 9 Oct 2019 17:40:03 +0000 (13:40 -0400)]
SysMin: Fix missed local variable

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoSysMin: Fix double usage of variable i
Sam Nelson [Wed, 9 Oct 2019 03:21:21 +0000 (23:21 -0400)]
SysMin: Fix double usage of variable i

Renamed local usage inside loop

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agotests: Fix issue with parameter order for strncpy
Sam Nelson [Wed, 9 Oct 2019 03:20:12 +0000 (23:20 -0400)]
tests: Fix issue with parameter order for strncpy

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoRcmServer: Update cast to match type compared
Sam Nelson [Wed, 9 Oct 2019 03:19:26 +0000 (23:19 -0400)]
RcmServer: Update cast to match type compared

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agopackage.bld: Remove --gcc option
Sam Nelson [Tue, 8 Oct 2019 13:38:43 +0000 (09:38 -0400)]
package.bld: Remove --gcc option

--gcc is deprecated and will be removed in a subsequent
   release. GCC compatibility is implemented through the --relaxed_ansi
option
   and is the default behavior of the compiler.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agotests: Add error check to be more robust
Sam Nelson [Tue, 8 Oct 2019 04:51:51 +0000 (00:51 -0400)]
tests: Add error check to be more robust

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agotransports: Fix to avoid potential divide by zero error
Sam Nelson [Tue, 8 Oct 2019 04:51:02 +0000 (00:51 -0400)]
transports: Fix to avoid potential divide by zero error

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agonsremote: Add additional check to handle assert disabled
Sam Nelson [Tue, 8 Oct 2019 04:50:16 +0000 (00:50 -0400)]
nsremote: Add additional check to handle assert disabled

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoheaps: Avoid possible divide by zero error
Sam Nelson [Tue, 8 Oct 2019 04:48:04 +0000 (00:48 -0400)]
heaps: Avoid possible divide by zero error

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoNotifySetup: Initialize retval
Sam Nelson [Tue, 8 Oct 2019 01:11:05 +0000 (21:11 -0400)]
NotifySetup: Initialize retval

This is to avoid uninitialized variable usage

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoListMP: Add additional check to handle no Assert case
Sam Nelson [Tue, 8 Oct 2019 01:09:34 +0000 (21:09 -0400)]
ListMP: Add additional check to handle no Assert case

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoSysMin: Update type to match print pattern
Sam Nelson [Tue, 8 Oct 2019 01:08:47 +0000 (21:08 -0400)]
SysMin: Update type to match print pattern

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoRPMessage: Add additional check to handle no Assert case
Sam Nelson [Tue, 8 Oct 2019 01:07:47 +0000 (21:07 -0400)]
RPMessage: Add additional check to handle no Assert case

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agogrcm: fix issue with Uint32 to Ptr conversion
Sam Nelson [Mon, 7 Oct 2019 17:21:14 +0000 (13:21 -0400)]
grcm: fix issue with Uint32 to Ptr conversion

Adding cast to UArg to indicate this is intentional

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoGateMP: Update handling of address > 32 bit for local Gate only
Sam Nelson [Mon, 7 Oct 2019 20:14:03 +0000 (16:14 -0400)]
GateMP: Update handling of address > 32 bit for local Gate only

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoListMP: Update to handle the case without Shared address translation
Sam Nelson [Mon, 7 Oct 2019 20:11:59 +0000 (16:11 -0400)]
ListMP: Update to handle the case without Shared address translation

Fixes compiler warnings

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoTransportShmCirc: Fix handling of address > 32 bits
Sam Nelson [Mon, 7 Oct 2019 19:52:42 +0000 (15:52 -0400)]
TransportShmCirc: Fix handling of address > 32 bits

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoTransportShm: Fix handling of address > 32 bits
Sam Nelson [Mon, 7 Oct 2019 19:52:11 +0000 (15:52 -0400)]
TransportShm: Fix handling of address > 32 bits

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoNameServer: Fix for handling address > 32 bits
Sam Nelson [Mon, 7 Oct 2019 19:51:11 +0000 (15:51 -0400)]
NameServer: Fix for handling address > 32 bits

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoNameServerRemoteNotify: Fix handling of address > 32 bits
Sam Nelson [Mon, 7 Oct 2019 19:48:48 +0000 (15:48 -0400)]
NameServerRemoteNotify: Fix handling of address > 32 bits

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoNotifyDriverShm: Fix handling of address > 32 bits
Sam Nelson [Mon, 7 Oct 2019 19:48:16 +0000 (15:48 -0400)]
NotifyDriverShm: Fix handling of address > 32 bits

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoNotifyDriverCirc: Fix handling of address > 32 bits
Sam Nelson [Mon, 7 Oct 2019 19:45:17 +0000 (15:45 -0400)]
NotifyDriverCirc: Fix handling of address > 32 bits

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoHeapMultiBufMP: Update to handle > 32 bit address
Sam Nelson [Mon, 7 Oct 2019 19:43:05 +0000 (15:43 -0400)]
HeapMultiBufMP: Update to handle > 32 bit address

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoHeapMemMP: Update handling of > 32bit shared addresses
Sam Nelson [Mon, 7 Oct 2019 19:37:26 +0000 (15:37 -0400)]
HeapMemMP: Update handling of > 32bit shared addresses

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoHeapBufMP: Update handling for > 32 bit addresses
Sam Nelson [Mon, 7 Oct 2019 19:36:54 +0000 (15:36 -0400)]
HeapBufMP: Update handling for > 32 bit addresses

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoNotifySetup: Add return value check for cases not using Assert
Sam Nelson [Mon, 7 Oct 2019 19:31:25 +0000 (15:31 -0400)]
NotifySetup: Add return value check for cases not using Assert

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoIpc: Add round up function separately for Address pointers
Sam Nelson [Mon, 7 Oct 2019 19:28:41 +0000 (15:28 -0400)]
Ipc: Add round up function separately for Address pointers

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoSharedRegion: Update to handle address calculation > 32 bits correctly
Sam Nelson [Mon, 7 Oct 2019 19:27:53 +0000 (15:27 -0400)]
SharedRegion: Update to handle address calculation > 32 bits correctly

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoIpc: Add proper hanlding of shared pointer and addresses
Sam Nelson [Mon, 7 Oct 2019 19:22:08 +0000 (15:22 -0400)]
Ipc: Add proper hanlding of shared pointer and addresses

Add appropriate handling of shared pointer which is limited to 32 bit.
But the addresses can be 64 bits for some cores.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoGateMP: Update arg to accomodate pointer for local Gate
Sam Nelson [Mon, 7 Oct 2019 19:14:49 +0000 (15:14 -0400)]
GateMP: Update arg to accomodate pointer for local Gate

arg is storing value of a pointer. Need to accomodate more than 32 bit
in 64 bit cores

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoVirtQueue: Add additional checks to handle, assert not enabled
Sam Nelson [Mon, 7 Oct 2019 17:22:18 +0000 (13:22 -0400)]
VirtQueue: Add additional checks to handle, assert not enabled

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agomm: Update code for better portability
Sam Nelson [Sat, 5 Oct 2019 15:11:51 +0000 (11:11 -0400)]
mm: Update code for better portability

Replaced UInt32 with UArg

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agobuild: Remove deprecated --gcc option
Sam Nelson [Sat, 5 Oct 2019 13:34:40 +0000 (09:34 -0400)]
build: Remove deprecated --gcc option

With the --gcc option the current gcc compiler gives warning and hence
removed

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agotrace: Update to snprintf for robustness
Sam Nelson [Sat, 5 Oct 2019 13:32:59 +0000 (09:32 -0400)]
trace: Update to snprintf for robustness

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agosrvmgr: Add NULL check for robustness
Sam Nelson [Sat, 5 Oct 2019 13:31:45 +0000 (09:31 -0400)]
srvmgr: Add NULL check for robustness

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agosrvmgr: Update shutdown variable type to volatile
Sam Nelson [Sat, 5 Oct 2019 13:31:19 +0000 (09:31 -0400)]
srvmgr: Update shutdown variable type to volatile

The shutdown vraiable can be set by a different task to indicate
shutdown
Also updates string copy not to use the last element in character array

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agosrvmgr: update copy of the whole taskParams structure
Sam Nelson [Sat, 5 Oct 2019 13:28:01 +0000 (09:28 -0400)]
srvmgr: update copy of the whole taskParams structure

No need to do caluculation of size using assumptions on structure
element

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoTransportShm: Add NULL check for robustness
Sam Nelson [Sat, 5 Oct 2019 13:16:51 +0000 (09:16 -0400)]
TransportShm: Add NULL check for robustness

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoNameServerRemoteNotify: Add NULL check for robustness
Sam Nelson [Sat, 5 Oct 2019 13:16:09 +0000 (09:16 -0400)]
NameServerRemoteNotify: Add NULL check for robustness

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoNotifyDriverShm: Update local variable types match usage
Sam Nelson [Sat, 5 Oct 2019 13:15:36 +0000 (09:15 -0400)]
NotifyDriverShm: Update local variable types match usage

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoHeapMultiBufMP: Add NULL check for robustness
Sam Nelson [Sat, 5 Oct 2019 13:14:23 +0000 (09:14 -0400)]
HeapMultiBufMP: Add NULL check for robustness

Add cast to match types

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoHeapMemMP: Add NULL check for robustness
Sam Nelson [Sat, 5 Oct 2019 13:13:12 +0000 (09:13 -0400)]
HeapMemMP: Add NULL check for robustness

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoHeapBufMP: Add NULL check for robustness
Sam Nelson [Sat, 5 Oct 2019 13:12:50 +0000 (09:12 -0400)]
HeapBufMP: Add NULL check for robustness

Also removes unnecessary Int32 cast

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoGatePersonN: Update stack variable to match usage
Sam Nelson [Sat, 5 Oct 2019 13:11:15 +0000 (09:11 -0400)]
GatePersonN: Update stack variable to match usage

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoGateHWSpinlock: Update stack variable to match usage
Sam Nelson [Sat, 5 Oct 2019 13:10:39 +0000 (09:10 -0400)]
GateHWSpinlock: Update stack variable to match usage

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoGateHWSem: Update stack variable to match usage
Sam Nelson [Sat, 5 Oct 2019 13:09:38 +0000 (09:09 -0400)]
GateHWSem: Update stack variable to match usage

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoNotify: Add NULL check for robustness
Sam Nelson [Sat, 5 Oct 2019 13:08:38 +0000 (09:08 -0400)]
Notify: Add NULL check for robustness

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agolistMP: Add NULL check for robustness
Sam Nelson [Sat, 5 Oct 2019 13:08:09 +0000 (09:08 -0400)]
listMP: Add NULL check for robustness

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoIpc: Fix mismatched types for comparison
Sam Nelson [Sat, 5 Oct 2019 13:07:33 +0000 (09:07 -0400)]
Ipc: Fix mismatched types for comparison

Also adds null checks for robustness

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoGateMP: Cast to common type for comparison
Sam Nelson [Sat, 5 Oct 2019 03:46:58 +0000 (23:46 -0400)]
GateMP: Cast to common type for comparison

Also adds NULL check

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoIpcPowerDsp_dra7xx: Add NULL check to avoid NULL pointer access
Sam Nelson [Sat, 5 Oct 2019 03:31:02 +0000 (23:31 -0400)]
IpcPowerDsp_dra7xx: Add NULL check to avoid NULL pointer access

Also make curInit volatile so that multiple threads can touch the same
variable

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoIpcPower: Add NULL check to avoid NULL pointer access
Sam Nelson [Sat, 5 Oct 2019 03:29:24 +0000 (23:29 -0400)]
IpcPower: Add NULL check to avoid NULL pointer access

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoTransportRpmsg: Add NULL check to avoid NULL pointer access
Sam Nelson [Sat, 5 Oct 2019 03:28:46 +0000 (23:28 -0400)]
TransportRpmsg: Add NULL check to avoid NULL pointer access

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoVirtQueue: Avoid mismatch of types in comparison
Sam Nelson [Sat, 5 Oct 2019 03:27:53 +0000 (23:27 -0400)]
VirtQueue: Avoid mismatch of types in comparison

Convert to common unsigned int
Also add error check where needed

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoWatchdog: Add NULL check to avoid NULL pointer access
Sam Nelson [Sat, 5 Oct 2019 03:26:19 +0000 (23:26 -0400)]
Watchdog: Add NULL check to avoid NULL pointer access

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoam65xx: Update core type for sciclient 3.50.04.07
Sam Nelson [Fri, 30 Aug 2019 02:03:16 +0000 (02:03 +0000)]
am65xx: Update core type for sciclient

The sciclient has library for mcu1_0, mcu1_1 and mpu1_0 separately.
Adding configuration to specify the right core type.
( Note this is supported in only new version of sciclient library)

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agobuild: Descoping C64x and C66 big endian 3.50.04.06
Mahesh Radhakrishnan [Thu, 1 Aug 2019 19:03:18 +0000 (19:03 +0000)]
build: Descoping C64x and C66 big endian

The C64x and c66 big endian platform are no longer supported and hence
getting removed from the build files
.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agotests: Update memory map to match update in Linux dts
Sam Nelson [Wed, 31 Jul 2019 22:45:35 +0000 (22:45 +0000)]
tests: Update memory map to match update in Linux dts

Updated memory region for each core to be 16 MB each
R5F0: 0xA0000000-0xA0FFFFFF: 16 MB
R5F1: 0xA1000000-0xA1FFFFFF: 16 MB
Also re-arranged memory sections to keep the resource table on the top
at offset 0x100000.
Updated resource table addresses and MPU settings accordingly.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
Reviewed-by: Suman Anna <s-anna@ti.com>
2 years agoRemoteproc: OMAPL138: Use FW_RSC_ADDR_ANY for vrings in resource table
Suman Anna [Tue, 26 Mar 2019 23:00:56 +0000 (18:00 -0500)]
Remoteproc: OMAPL138: Use FW_RSC_ADDR_ANY for vrings in resource table

The memory for vrings are allocated dynamically by the Linux kernel-side,
and the corresponding resource table vring da fields are updated with the
allocated vring physical addresses. The current resource table uses fixed
addresses, and these happen to match the allocated addresses with the
current DSP device DMA/CMA pools. Newer Linux kernels > 4.19 still do
dynamic allocation, but only update these fields if they are read as
FW_RSC_ADDR_ANY. The OMAPL138 platforms do not have an MMU and so must
use the actual allocated addresses, so update the current resource table
to use FW_RSC_ADDR_ANY for the vring da fields. The previously defined
macros are also cleaned up.

The patch can only be used after the vdev synchronization logic commit
("omapl138: VirtQueue: Add vdev status synchronization logic").

Signed-off-by: Suman Anna <s-anna@ti.com>
2 years agoomapl138: VirtQueue: Add vdev status synchronization logic
Suman Anna [Tue, 26 Mar 2019 23:00:55 +0000 (18:00 -0500)]
omapl138: VirtQueue: Add vdev status synchronization logic

The VirtQueue objects are currently initialized using the vring
addresses from the corresponding vring entries in the resource
table. The memory for vrings is always allocated on the Linux
kernel at runtime, and the resource table entry is updated with
the corresponding allocated address.

This allocation always used to happen during the vdev resource
handling previously on the Linux kernel side, but this behavior
has changed in newer Linux kernels > 4.19. The memory is allocated
now after all the resources are handled, and the resource table
is updated only when the virtio_rpmsg_bus driver is probed, and
only if a FW_RSC_ADDR_ANY is passed in the resource table. This
driver can be installed after the remoteproc is up, which results
in the RTOS code using a stale value.

Resolve this by adding a synchronization logic for the vdev
status (set during virtio_rpmsg_bus probe on kernel-side). The
synchronization is added during the creation of the first VirtQueue
object. This can probably be done in module startup as well since
the VirtQueue code on OMAPL138 is a XDC module, but the design
follows the non-XDC usage as on DRA7xx/AM57xx platforms.

Signed-off-by: Suman Anna <s-anna@ti.com>
2 years agoomapl138: VirtQueue: Fixup mapVAtoPA() and mapPAtoVA()
Suman Anna [Tue, 26 Mar 2019 23:00:54 +0000 (18:00 -0500)]
omapl138: VirtQueue: Fixup mapVAtoPA() and mapPAtoVA()

The mapVAtoPA() and mapPAtoVA() functions used in the OMAPL138
VirtQueue code uses a hard-coded address translating logic that
caters to only a specific set of images. The DSPs on OMAPL138
do not have MMUs, so the addresses seen in the vring control
structures should be identical between the processor view and
the actual DDR address. The only case where this might not be
true is if the MPAX is being used to perform some address
translations, but this is not the case today.

So, fixup these functions to provide a one-to-one exact translation.
This fixes up issues with latest upstream kernels (v5.1+) where
the virtio buffers are no longer allocated from the same remoteproc
device DMA pool, and so can be allocated anywhere in DDR memory
(from the default Linux DMA/CMA pool).

Signed-off-by: Suman Anna <s-anna@ti.com>
2 years agoRemoteproc: OMAPL138: Remove unused macros from resource table
Suman Anna [Tue, 26 Mar 2019 23:00:53 +0000 (18:00 -0500)]
Remoteproc: OMAPL138: Remove unused macros from resource table

There are couple of macros that are defined in the OMAPL138 resource
table file, but are not used anywhere. These are left-overs from very
old code, so clean them up.

Signed-off-by: Suman Anna <s-anna@ti.com>
2 years agorsc_types: Add the definition of FW_RSC_ADDR_ANY
Suman Anna [Tue, 26 Mar 2019 23:00:52 +0000 (18:00 -0500)]
rsc_types: Add the definition of FW_RSC_ADDR_ANY

Add the definition for a FW_RSC_ADDR_ANY macro. This macro
should be used for da in various resource types if that
particular memory needs to be dynamically allocated on the
kernel. This value is now actively used in all the upstream
kernels post the v4.19 release.

Signed-off-by: Suman Anna <s-anna@ti.com>
2 years agorsc_types: Use the correct integer type in fw_rsc_vdev
Suman Anna [Tue, 26 Mar 2019 23:00:51 +0000 (18:00 -0500)]
rsc_types: Use the correct integer type in fw_rsc_vdev

The Linux kernel uses an unsigned 8-bit integer type for the
status, num_of_vrings and reserved fields of the fw_rsc_vdev
structure. These are slightly mis-represented as a 8-bit Char
type within the IPC code. Fix this by using the equivalent
BIOS-side variable type - UInt8 in the rsc_types.h header
file.

This does fix couple of warnings about comparision between
mixed types.

Signed-off-by: Suman Anna <s-anna@ti.com>
2 years agoResource: Fix compile warning in Resource_getTraceBufSize()
Suman Anna [Tue, 26 Mar 2019 23:00:50 +0000 (18:00 -0500)]
Resource: Fix compile warning in Resource_getTraceBufSize()

The function Resource_getTraceBufSize() should return a value
of type SizeT, but is currently returning a value of NULL upon
failures. This generates the following compile warning,
"warning: return value type does not match the function type".

Fix this properly by simply returning a value of 0.

Signed-off-by: Suman Anna <s-anna@ti.com>
2 years agoLinux: Update user AF_RPMSG define for 4.18+ kernels ipc-3.50-next 3.50.03.05
Suman Anna [Fri, 21 Dec 2018 23:47:53 +0000 (17:47 -0600)]
Linux: Update user AF_RPMSG define for 4.18+ kernels

IPC's Linux user space support contains a copy of a few
kernel-defined structs and definitions including the socket
address family used for rpmsg-based sockets - AF_RPMSG. This
driver is currently out-of-tree and so it's definition is
always 'one more' than the last address family defined by
the mainline kernel's socket.h.

A new address family was introduced in 4.18 (AF_XDP), and as
a result, the AF_RPMSG macro needs to be set to 45 post 4.18
kernel. The user space header has been updated to reflect on
the kernel version and appropriately assign the value of
AF_RPMSG.

Do note that a specific value of AF_RPMSG can always be provided
through the products.mak when KERNEL_INSTALL_DIR is not set.

Signed-off-by: Suman Anna <s-anna@ti.com>
2 years agotrace: Update to remove direct dependence on SysMin 3.50.03.04
Sam Nelson [Thu, 29 Nov 2018 19:40:03 +0000 (14:40 -0500)]
trace: Update to remove direct dependence on SysMin

The size of trace buffer here instead obtaining from the Sysmin
parameter from headerfile, is now obtained directly from the resource
table
Also fixes backward compatibility issues with applications using
xdc/runtime/SysMin.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoam65xx: Update to remove reference to sciclient internal header file
Sam Nelson [Mon, 12 Nov 2018 21:52:33 +0000 (16:52 -0500)]
am65xx: Update to remove reference to sciclient internal header file

Note that this reference to
ti/drv/sciclient/include/V0/tisci_resasg_types.h was added due to an
issue with the sciclient in terms of API.
Now that the issue is resolved sciclient, the reference to this header
file can  be removed.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoc66x: Update compiler options to reduce code size
Gaurav Mitra [Mon, 29 Oct 2018 15:00:41 +0000 (11:00 -0400)]
c66x: Update compiler options to reduce code size

Reduce IPC unit test code size for C66 binaries when using compiler
version 8.3.x by using optimization -mf=2 or --opt_for_speed=2

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agotests: R5F Memory map cleanup
Sam Nelson [Wed, 24 Oct 2018 15:52:27 +0000 (11:52 -0400)]
tests: R5F Memory map cleanup

Added section to capture unused sections
Added align to avoid issues with unaligned load

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
2 years agoam65xx: Fix issue for R5F0 to R5F1 communication
Sam Nelson [Thu, 25 Oct 2018 17:08:54 +0000 (13:08 -0400)]
am65xx: Fix issue for R5F0 to R5F1 communication

This code was originally designed to use local interrupt mechanisms
between R5F-0 and R5F-1 cores. But the implementation now assumes
mailbox interrupts to be directly used. So removing the code here which
bypasses enabling and disable of mailbox interrupts

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
3 years agotests: Remove misleading memory comments 3.50.03.03
Sam Nelson [Mon, 22 Oct 2018 21:11:47 +0000 (17:11 -0400)]
tests: Remove misleading memory comments

The memory section itself is self explanatory.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
3 years agoipc: Remove compiler warnings
Sam Nelson [Sun, 21 Oct 2018 20:52:52 +0000 (16:52 -0400)]
ipc: Remove compiler warnings

Removes warnings due to Assert_isTrue id set to NULL
Also removes warnings due to int to pointer conversion

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
3 years agoam65xx: Fix Compilation warnings on int to pointer conversion
Sam Nelson [Sun, 21 Oct 2018 20:42:47 +0000 (16:42 -0400)]
am65xx: Fix Compilation warnings on int to pointer conversion

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
3 years agotests: R5F Split mode support
Sam Nelson [Sun, 21 Oct 2018 20:41:25 +0000 (16:41 -0400)]
tests: R5F Split mode support

Add code to build separate test images for R5F0, R5F1.
R5F0 images can be used AS-IS with R5F cores in Lock step mode

Note the DDR memory is partitioned according to the Linux device tree
nodes for r5f-0 and r5f-1

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
3 years agoam65x: Update resource table for split R5F cores
Sam Nelson [Mon, 22 Oct 2018 19:43:14 +0000 (15:43 -0400)]
am65x: Update resource table for split R5F cores

Note the memory is partitioned between the two split cores and the
sections should match what is the Linux device tree nodes for R5F0 &
R5F1

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
3 years agoRemoteproc: AM65xx: Remove all RSC_CARVEOUT entries
Suman Anna [Thu, 18 Oct 2018 21:56:12 +0000 (16:56 -0500)]
Remoteproc: AM65xx: Remove all RSC_CARVEOUT entries

The R5F cores on AM65xx SoCs do not have an MMU, and so use
direct mapping of CPU memory to DDR memory. The Region Address
Translator (RAT) sub-module can provide linear address translations
but is not currently supported. The RSC_CARVEOUT entries are
currently being used to allocate memory on the Linux side for
various firmware image sections, but this was a temporary
workaround to leverage existing infrastructure on the Linux kernel
side.

Remove all the RSC_CARVEOUT entries and rely on the newly added
support on the Linux kernel side for fixed memory regions for
loading firmware images. The firmware image linker map sections
should fit the addresses defined through the reserved memory nodes
associated with the remoteproc device on the Linux kernel side.

NOTE:
The RSC_DEVMEM resource entry is retained for now until the
address translation logic in AM65xx VirtQueue code is fixed up,
since this resource type is not supported for remoteprocs without
any MMUs.

Signed-off-by: Suman Anna <s-anna@ti.com>
3 years agoam65xx: Update to use static resources from System firmware
Sam Nelson [Sat, 20 Oct 2018 02:43:00 +0000 (22:43 -0400)]
am65xx: Update to use static resources from System firmware

Instead of hard coding the interrupt resource, use the ones statically
configured as part of the board config

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
3 years agotests: Update MPU configuration for non-shared memory
Sam Nelson [Sun, 21 Oct 2018 12:50:37 +0000 (08:50 -0400)]
tests: Update MPU configuration for non-shared memory

Making the code/data memory shareable makes the memory non-cacheable and
performance is affected.
Modified MPU configuration, so that only the shared region is marked as
shareable and other regions used for code/data are mareked as non-
shareable.
This results in better performance.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
3 years agorsc_table: Update to fix backward compatibilty with xdc SysMin
Sam Nelson [Thu, 13 Sep 2018 18:20:03 +0000 (14:20 -0400)]
rsc_table: Update to fix backward compatibilty with xdc SysMin

With this, application can use either ti.trace.SysMin or
xdc.runtime.SysMin.
Old applications using xdc.runtime.SysMin can still work.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
3 years agoam65xx: Integrate sciclient for interrupt routing through system-fw 3.50.01.01
Sam Nelson [Fri, 17 Aug 2018 15:17:48 +0000 (11:17 -0400)]
am65xx: Integrate sciclient for interrupt routing through system-fw

- Adds dependency on sciclient part of the PDK package
- Add new module ti.sdo.ip.family.am65xx.NotifySciClient which
configures interrupt routes by communicating with system core using
sciclient module.
- removes old code which configured directly the interrupt routes to cpu

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
3 years agotests: Add idle function to test code 3.50.01.00C
Sam Nelson [Fri, 17 Aug 2018 16:05:16 +0000 (12:05 -0400)]
tests: Add idle function to test code

This is to plug in function to handle idle state

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
3 years agoam65xx: Add Power module for idle routine
Sam Nelson [Fri, 17 Aug 2018 16:03:22 +0000 (12:03 -0400)]
am65xx: Add Power module for idle routine

Idle routine is needed to put cpu in safe state for the host processor
to reset.

Signed-off-by: Sam Nelson <sam.nelson@ti.com>
3 years agoping_rpmsg: OMAPL138: Add program section for tracebuf
Sam Nelson [Wed, 22 Aug 2018 14:22:54 +0000 (10:22 -0400)]
ping_rpmsg: OMAPL138: Add program section for tracebuf

This is needed when you use ti.trace.SysMin

Signed-off-by: Sam Nelson <sam.nelson@ti.com>